Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 1 | dnl Process this file with autoconf to create configure. |
| 2 | |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 3 | AC_PREREQ([2.59]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 4 | |
Dan Nicholson | 00994ac | 2008-04-30 15:06:00 -0700 | [diff] [blame] | 5 | dnl Versioning - scrape the version from configs/default |
| 6 | m4_define([mesa_version], |
Vinson Lee | 48f8a76 | 2010-05-11 12:33:30 -0700 | [diff] [blame] | 7 | [m4_esyscmd([${MAKE-make} -s -f bin/version.mk version | tr -d '\n' | tr -d '\r'])]) |
Dan Nicholson | 356f311 | 2009-04-29 06:49:27 -0700 | [diff] [blame] | 8 | m4_ifval(mesa_version,, |
| 9 | [m4_fatal([Failed to get the Mesa version from `make -f bin/version.mk version`])]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 10 | |
Dan Nicholson | e97ab72 | 2008-07-01 08:55:42 -0700 | [diff] [blame] | 11 | dnl Tell the user about autoconf.html in the --help output |
| 12 | m4_divert_once([HELP_END], [ |
| 13 | See docs/autoconf.html for more details on the options for Mesa.]) |
| 14 | |
Dan Nicholson | 00994ac | 2008-04-30 15:06:00 -0700 | [diff] [blame] | 15 | AC_INIT([Mesa],[mesa_version], |
Dan Nicholson | f64d6fe | 2007-12-12 17:57:45 -0800 | [diff] [blame] | 16 | [https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa]) |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 17 | AC_CONFIG_AUX_DIR([bin]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 18 | AC_CANONICAL_HOST |
| 19 | |
Dan Nicholson | cc77e8f | 2008-05-05 14:38:22 -0700 | [diff] [blame] | 20 | dnl Versions for external dependencies |
Chris Wilson | faf1dda | 2011-03-01 18:39:15 +0000 | [diff] [blame] | 21 | LIBDRM_REQUIRED=2.4.24 |
| 22 | LIBDRM_RADEON_REQUIRED=2.4.24 |
| 23 | LIBDRM_INTEL_REQUIRED=2.4.24 |
Kristian Høgsberg | aa0cd70 | 2010-02-15 10:44:05 -0500 | [diff] [blame] | 24 | DRI2PROTO_REQUIRED=2.1 |
Jesse Barnes | f2f83d9 | 2010-01-11 17:28:10 -0500 | [diff] [blame] | 25 | GLPROTO_REQUIRED=1.4.11 |
Chris Wilson | faf1dda | 2011-03-01 18:39:15 +0000 | [diff] [blame] | 26 | LIBDRM_XORG_REQUIRED=2.4.24 |
Jakob Bornecrantz | 683a099 | 2010-03-11 19:23:15 +0000 | [diff] [blame] | 27 | LIBKMS_XORG_REQUIRED=1.0.0 |
Dan Nicholson | cc77e8f | 2008-05-05 14:38:22 -0700 | [diff] [blame] | 28 | |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 29 | dnl Check for progs |
| 30 | AC_PROG_CPP |
| 31 | AC_PROG_CC |
| 32 | AC_PROG_CXX |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 33 | AC_CHECK_PROGS([MAKE], [gmake make]) |
Kenneth Graunke | 3acc826 | 2010-10-25 13:52:58 -0700 | [diff] [blame] | 34 | AC_CHECK_PROGS([PYTHON2], [python2 python]) |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 35 | AC_PATH_PROG([MKDEP], [makedepend]) |
| 36 | AC_PATH_PROG([SED], [sed]) |
Dan Nicholson | 41b0070 | 2007-12-12 08:48:30 -0800 | [diff] [blame] | 37 | |
Luca Barbieri | f762f7b | 2010-09-24 10:10:09 +0200 | [diff] [blame] | 38 | if test "x$MKDEP" = "x"; then |
| 39 | AC_MSG_ERROR([makedepend is required to build Mesa]) |
| 40 | fi |
| 41 | |
Dan Nicholson | bc302b2 | 2009-05-22 09:39:02 -0700 | [diff] [blame] | 42 | dnl Our fallback install-sh is a symlink to minstall. Use the existing |
| 43 | dnl configuration in that case. |
| 44 | AC_PROG_INSTALL |
| 45 | test "x$INSTALL" = "x$ac_install_sh" && INSTALL='$(MINSTALL)' |
| 46 | |
Dan Nicholson | bfb27b5 | 2008-06-30 09:40:30 -0700 | [diff] [blame] | 47 | dnl We need a POSIX shell for parts of the build. Assume we have one |
| 48 | dnl in most cases. |
Alan Coopersmith | e1f9adc | 2008-06-20 17:58:53 -0700 | [diff] [blame] | 49 | case "$host_os" in |
| 50 | solaris*) |
| 51 | # Solaris /bin/sh is too old/non-POSIX compliant |
| 52 | AC_PATH_PROGS(POSIX_SHELL, [ksh93 ksh sh]) |
Dan Nicholson | bfb27b5 | 2008-06-30 09:40:30 -0700 | [diff] [blame] | 53 | SHELL="$POSIX_SHELL" |
Alan Coopersmith | e1f9adc | 2008-06-20 17:58:53 -0700 | [diff] [blame] | 54 | ;; |
| 55 | esac |
| 56 | |
nobled | 2a50187 | 2010-08-29 20:03:37 -0400 | [diff] [blame] | 57 | dnl clang is mostly GCC-compatible, but its version is much lower, |
| 58 | dnl so we have to check for it. |
| 59 | AC_MSG_CHECKING([if compiling with clang]) |
| 60 | |
| 61 | AC_COMPILE_IFELSE( |
| 62 | [AC_LANG_PROGRAM([], [[ |
| 63 | #ifndef __clang__ |
| 64 | not clang |
| 65 | #endif |
| 66 | ]])], |
| 67 | [CLANG=yes], [CLANG=no]) |
| 68 | |
| 69 | AC_MSG_RESULT([$CLANG]) |
| 70 | |
Ian Romanick | 9aa3aa7 | 2010-03-03 15:59:37 -0800 | [diff] [blame] | 71 | dnl If we're using GCC, make sure that it is at least version 3.3.0. Older |
| 72 | dnl versions are explictly not supported. |
nobled | 2a50187 | 2010-08-29 20:03:37 -0400 | [diff] [blame] | 73 | if test "x$GCC" = xyes -a "x$CLANG" = xno; then |
Ian Romanick | 9aa3aa7 | 2010-03-03 15:59:37 -0800 | [diff] [blame] | 74 | AC_MSG_CHECKING([whether gcc version is sufficient]) |
| 75 | major=0 |
| 76 | minor=0 |
| 77 | |
| 78 | GCC_VERSION=`$CC -dumpversion` |
| 79 | if test $? -eq 0; then |
| 80 | major=`echo $GCC_VERSION | cut -d. -f1` |
| 81 | minor=`echo $GCC_VERSION | cut -d. -f1` |
| 82 | fi |
| 83 | |
| 84 | if test $major -lt 3 -o $major -eq 3 -a $minor -lt 3 ; then |
| 85 | AC_MSG_RESULT([no]) |
| 86 | AC_MSG_ERROR([If using GCC, version 3.3.0 or later is required.]) |
| 87 | else |
| 88 | AC_MSG_RESULT([yes]) |
| 89 | fi |
| 90 | fi |
| 91 | |
| 92 | |
Dan Nicholson | db7fc63 | 2008-03-07 11:48:09 -0800 | [diff] [blame] | 93 | MKDEP_OPTIONS=-fdepend |
Kristian Høgsberg | bcecea6 | 2008-02-25 18:50:26 -0500 | [diff] [blame] | 94 | dnl Ask gcc where it's keeping its secret headers |
| 95 | if test "x$GCC" = xyes; then |
Dan Nicholson | a3d223f | 2009-01-30 10:52:09 -0800 | [diff] [blame] | 96 | for dir in include include-fixed; do |
| 97 | GCC_INCLUDES=`$CC -print-file-name=$dir` |
| 98 | if test "x$GCC_INCLUDES" != x && \ |
| 99 | test "$GCC_INCLUDES" != "$dir" && \ |
| 100 | test -d "$GCC_INCLUDES"; then |
| 101 | MKDEP_OPTIONS="$MKDEP_OPTIONS -I$GCC_INCLUDES" |
| 102 | fi |
| 103 | done |
Kristian Høgsberg | bcecea6 | 2008-02-25 18:50:26 -0500 | [diff] [blame] | 104 | fi |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 105 | AC_SUBST([MKDEP_OPTIONS]) |
Kristian Høgsberg | bcecea6 | 2008-02-25 18:50:26 -0500 | [diff] [blame] | 106 | |
Dan Nicholson | 41b0070 | 2007-12-12 08:48:30 -0800 | [diff] [blame] | 107 | dnl Make sure the pkg-config macros are defined |
Dan Nicholson | 356f311 | 2009-04-29 06:49:27 -0700 | [diff] [blame] | 108 | m4_ifndef([PKG_PROG_PKG_CONFIG], |
| 109 | [m4_fatal([Could not locate the pkg-config autoconf macros. |
| 110 | These are usually located in /usr/share/aclocal/pkg.m4. If your macros |
| 111 | are in a different location, try setting the environment variable |
| 112 | ACLOCAL="aclocal -I/other/macro/dir" before running autoreconf.])]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 113 | PKG_PROG_PKG_CONFIG() |
| 114 | |
| 115 | dnl LIB_DIR - library basename |
| 116 | LIB_DIR=`echo $libdir | $SED 's%.*/%%'` |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 117 | AC_SUBST([LIB_DIR]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 118 | |
| 119 | dnl Cache LDFLAGS so we can add EXTRA_LIB_PATH and restore it later |
| 120 | _SAVE_LDFLAGS="$LDFLAGS" |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 121 | AC_ARG_VAR([EXTRA_LIB_PATH],[Extra -L paths for the linker]) |
| 122 | AC_SUBST([EXTRA_LIB_PATH]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 123 | |
| 124 | dnl Cache CPPFLAGS so we can add *_INCLUDES and restore it later |
| 125 | _SAVE_CPPFLAGS="$CPPFLAGS" |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 126 | AC_ARG_VAR([X11_INCLUDES],[Extra -I paths for X11 headers]) |
| 127 | AC_SUBST([X11_INCLUDES]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 128 | |
| 129 | dnl Compiler macros |
| 130 | DEFINES="" |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 131 | AC_SUBST([DEFINES]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 132 | case "$host_os" in |
Samuel Thibault | d18dd6a | 2009-04-23 05:43:22 -0700 | [diff] [blame] | 133 | linux*|*-gnu*|gnu*) |
Dan Nicholson | 29f603a | 2009-01-12 11:10:31 -0800 | [diff] [blame] | 134 | DEFINES="$DEFINES -D_GNU_SOURCE -DPTHREADS" |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 135 | ;; |
Alan Coopersmith | e1f9adc | 2008-06-20 17:58:53 -0700 | [diff] [blame] | 136 | solaris*) |
| 137 | DEFINES="$DEFINES -DPTHREADS -DSVR4" |
| 138 | ;; |
Brian Paul | 9798890 | 2010-02-18 12:46:12 -0700 | [diff] [blame] | 139 | cygwin*) |
| 140 | DEFINES="$DEFINES -DPTHREADS" |
| 141 | ;; |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 142 | esac |
| 143 | |
| 144 | dnl Add flags for gcc and g++ |
| 145 | if test "x$GCC" = xyes; then |
Eric Anholt | a3c2bd4 | 2010-08-30 14:19:23 -0700 | [diff] [blame] | 146 | CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -std=c99" |
| 147 | if test "x$CLANG" = "xno"; then |
| 148 | CFLAGS="$CFLAGS -ffast-math" |
| 149 | fi |
Alan Coopersmith | adda7f3 | 2010-01-16 18:34:23 -0800 | [diff] [blame] | 150 | |
| 151 | # Enable -fvisibility=hidden if using a gcc that supports it |
| 152 | save_CFLAGS="$CFLAGS" |
Alan Coopersmith | f8107a4 | 2010-01-21 16:42:58 -0800 | [diff] [blame] | 153 | AC_MSG_CHECKING([whether $CC supports -fvisibility=hidden]) |
Christopher James Halse Rogers | d1e28b2 | 2011-02-03 11:19:32 +1100 | [diff] [blame] | 154 | VISIBILITY_CFLAGS="-fvisibility=hidden" |
| 155 | CFLAGS="$CFLAGS $VISIBILITY_CFLAGS" |
Alan Coopersmith | adda7f3 | 2010-01-16 18:34:23 -0800 | [diff] [blame] | 156 | AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]), |
Christopher James Halse Rogers | d1e28b2 | 2011-02-03 11:19:32 +1100 | [diff] [blame] | 157 | [VISIBILITY_CFLAGS=""; AC_MSG_RESULT([no])]); |
| 158 | |
| 159 | # Restore CFLAGS; VISIBILITY_CFLAGS are added to it where needed. |
| 160 | CFLAGS=$save_CFLAGS |
Dan Nicholson | 0c275b6 | 2008-01-15 22:52:25 -0800 | [diff] [blame] | 161 | |
| 162 | # Work around aliasing bugs - developers should comment this out |
| 163 | CFLAGS="$CFLAGS -fno-strict-aliasing" |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 164 | fi |
| 165 | if test "x$GXX" = xyes; then |
| 166 | CXXFLAGS="$CXXFLAGS -Wall" |
Dan Nicholson | 0c275b6 | 2008-01-15 22:52:25 -0800 | [diff] [blame] | 167 | |
Kristian Høgsberg | 7b34fcc | 2010-09-08 20:34:07 -0400 | [diff] [blame] | 168 | # Enable -fvisibility=hidden if using a gcc that supports it |
| 169 | save_CXXFLAGS="$CXXFLAGS" |
| 170 | AC_MSG_CHECKING([whether $CXX supports -fvisibility=hidden]) |
Christopher James Halse Rogers | d1e28b2 | 2011-02-03 11:19:32 +1100 | [diff] [blame] | 171 | VISIBILITY_CXXFLAGS="-fvisibility=hidden" |
| 172 | CXXFLAGS="$CXXFLAGS $VISIBILITY_CXXFLAGS" |
Kristian Høgsberg | 7b34fcc | 2010-09-08 20:34:07 -0400 | [diff] [blame] | 173 | AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]), |
Christopher James Halse Rogers | d1e28b2 | 2011-02-03 11:19:32 +1100 | [diff] [blame] | 174 | [VISIBILITY_CXXFLAGS="" ; AC_MSG_RESULT([no])]); |
| 175 | |
| 176 | # Restore CXXFLAGS; VISIBILITY_CXXFLAGS are added to it where needed. |
| 177 | CXXFLAGS=$save_CXXFLAGS |
Kristian Høgsberg | 7b34fcc | 2010-09-08 20:34:07 -0400 | [diff] [blame] | 178 | |
Dan Nicholson | 0c275b6 | 2008-01-15 22:52:25 -0800 | [diff] [blame] | 179 | # Work around aliasing bugs - developers should comment this out |
| 180 | CXXFLAGS="$CXXFLAGS -fno-strict-aliasing" |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 181 | fi |
| 182 | |
Christopher James Halse Rogers | d1e28b2 | 2011-02-03 11:19:32 +1100 | [diff] [blame] | 183 | AC_SUBST([VISIBILITY_CFLAGS]) |
| 184 | AC_SUBST([VISIBILITY_CXXFLAGS]) |
| 185 | |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 186 | dnl These should be unnecessary, but let the user set them if they want |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 187 | AC_ARG_VAR([OPT_FLAGS], [Additional optimization flags for the compiler. |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 188 | Default is to use CFLAGS.]) |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 189 | AC_ARG_VAR([ARCH_FLAGS], [Additional architecture specific flags for the |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 190 | compiler. Default is to use CFLAGS.]) |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 191 | AC_SUBST([OPT_FLAGS]) |
| 192 | AC_SUBST([ARCH_FLAGS]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 193 | |
| 194 | dnl |
Dan Nicholson | ab57cba | 2007-12-26 11:12:29 -0600 | [diff] [blame] | 195 | dnl Hacks to enable 32 or 64 bit build |
| 196 | dnl |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 197 | AC_ARG_ENABLE([32-bit], |
Dan Nicholson | ab57cba | 2007-12-26 11:12:29 -0600 | [diff] [blame] | 198 | [AS_HELP_STRING([--enable-32-bit], |
| 199 | [build 32-bit libraries @<:@default=auto@:>@])], |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 200 | [enable_32bit="$enableval"], |
| 201 | [enable_32bit=auto] |
Dan Nicholson | ab57cba | 2007-12-26 11:12:29 -0600 | [diff] [blame] | 202 | ) |
| 203 | if test "x$enable_32bit" = xyes; then |
| 204 | if test "x$GCC" = xyes; then |
| 205 | CFLAGS="$CFLAGS -m32" |
Marc Dietrich | c705e72 | 2009-08-31 08:56:33 -0700 | [diff] [blame] | 206 | ARCH_FLAGS="$ARCH_FLAGS -m32" |
Dan Nicholson | ab57cba | 2007-12-26 11:12:29 -0600 | [diff] [blame] | 207 | fi |
| 208 | if test "x$GXX" = xyes; then |
| 209 | CXXFLAGS="$CXXFLAGS -m32" |
| 210 | fi |
| 211 | fi |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 212 | AC_ARG_ENABLE([64-bit], |
Dan Nicholson | ab57cba | 2007-12-26 11:12:29 -0600 | [diff] [blame] | 213 | [AS_HELP_STRING([--enable-64-bit], |
| 214 | [build 64-bit libraries @<:@default=auto@:>@])], |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 215 | [enable_64bit="$enableval"], |
| 216 | [enable_64bit=auto] |
Dan Nicholson | ab57cba | 2007-12-26 11:12:29 -0600 | [diff] [blame] | 217 | ) |
| 218 | if test "x$enable_64bit" = xyes; then |
| 219 | if test "x$GCC" = xyes; then |
| 220 | CFLAGS="$CFLAGS -m64" |
| 221 | fi |
| 222 | if test "x$GXX" = xyes; then |
| 223 | CXXFLAGS="$CXXFLAGS -m64" |
| 224 | fi |
| 225 | fi |
| 226 | |
| 227 | dnl |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 228 | dnl shared/static libraries, mimic libtool options |
| 229 | dnl |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 230 | AC_ARG_ENABLE([static], |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 231 | [AS_HELP_STRING([--enable-static], |
Dan Nicholson | 79ad458 | 2007-12-07 19:11:01 -0800 | [diff] [blame] | 232 | [build static libraries @<:@default=disabled@:>@])], |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 233 | [enable_static="$enableval"], |
| 234 | [enable_static=no] |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 235 | ) |
| 236 | case "x$enable_static" in |
| 237 | xyes|xno ) ;; |
| 238 | x ) enable_static=no ;; |
| 239 | * ) |
| 240 | AC_MSG_ERROR([Static library option '$enable_static' is not a valid]) |
| 241 | ;; |
| 242 | esac |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 243 | AC_ARG_ENABLE([shared], |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 244 | [AS_HELP_STRING([--disable-shared], |
Dan Nicholson | 79ad458 | 2007-12-07 19:11:01 -0800 | [diff] [blame] | 245 | [build shared libraries @<:@default=enabled@:>@])], |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 246 | [enable_shared="$enableval"], |
| 247 | [enable_shared=yes] |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 248 | ) |
| 249 | case "x$enable_shared" in |
| 250 | xyes|xno ) ;; |
| 251 | x ) enable_shared=yes ;; |
| 252 | * ) |
| 253 | AC_MSG_ERROR([Shared library option '$enable_shared' is not a valid]) |
| 254 | ;; |
| 255 | esac |
| 256 | |
| 257 | dnl Can't have static and shared libraries, default to static if user |
| 258 | dnl explicitly requested. If both disabled, set to static since shared |
| 259 | dnl was explicitly requirested. |
| 260 | case "x$enable_static$enable_shared" in |
| 261 | xyesyes ) |
| 262 | AC_MSG_WARN([Can't build static and shared libraries, disabling shared]) |
| 263 | enable_shared=no |
| 264 | ;; |
| 265 | xnono ) |
| 266 | AC_MSG_WARN([Can't disable both static and shared libraries, enabling static]) |
| 267 | enable_static=yes |
| 268 | ;; |
| 269 | esac |
| 270 | |
| 271 | dnl |
| 272 | dnl mklib options |
| 273 | dnl |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 274 | AC_ARG_VAR([MKLIB_OPTIONS],[Options for the Mesa library script, mklib]) |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 275 | if test "$enable_static" = yes; then |
| 276 | MKLIB_OPTIONS="$MKLIB_OPTIONS -static" |
| 277 | fi |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 278 | AC_SUBST([MKLIB_OPTIONS]) |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 279 | |
Dan Nicholson | 23656c4 | 2007-12-12 09:02:31 -0800 | [diff] [blame] | 280 | dnl |
| 281 | dnl other compiler options |
| 282 | dnl |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 283 | AC_ARG_ENABLE([debug], |
Dan Nicholson | 23656c4 | 2007-12-12 09:02:31 -0800 | [diff] [blame] | 284 | [AS_HELP_STRING([--enable-debug], |
| 285 | [use debug compiler flags and macros @<:@default=disabled@:>@])], |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 286 | [enable_debug="$enableval"], |
| 287 | [enable_debug=no] |
Dan Nicholson | 23656c4 | 2007-12-12 09:02:31 -0800 | [diff] [blame] | 288 | ) |
| 289 | if test "x$enable_debug" = xyes; then |
| 290 | DEFINES="$DEFINES -DDEBUG" |
| 291 | if test "x$GCC" = xyes; then |
| 292 | CFLAGS="$CFLAGS -g" |
| 293 | fi |
| 294 | if test "x$GXX" = xyes; then |
| 295 | CXXFLAGS="$CXXFLAGS -g" |
| 296 | fi |
| 297 | fi |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 298 | |
| 299 | dnl |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 300 | dnl library names |
| 301 | dnl |
Jon TURNEY | c55a8a7 | 2010-07-24 12:05:34 +0100 | [diff] [blame] | 302 | LIB_PREFIX_GLOB='lib' |
| 303 | LIB_VERSION_SEPARATOR='.' |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 304 | if test "$enable_static" = yes; then |
Dan Nicholson | 8217f24 | 2009-02-11 15:16:00 -0800 | [diff] [blame] | 305 | LIB_EXTENSION='a' |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 306 | else |
Siddhartha Chaudhuri | 1a46c8a | 2009-02-09 07:58:38 -0700 | [diff] [blame] | 307 | case "$host_os" in |
| 308 | darwin* ) |
| 309 | LIB_EXTENSION='dylib' ;; |
Jon TURNEY | 7eed6ab | 2009-06-08 16:02:18 +0100 | [diff] [blame] | 310 | cygwin* ) |
Jon TURNEY | c55a8a7 | 2010-07-24 12:05:34 +0100 | [diff] [blame] | 311 | dnl prefix can be 'cyg' or 'lib' |
| 312 | LIB_PREFIX_GLOB='???' |
| 313 | LIB_VERSION_SEPARATOR='-' |
| 314 | LIB_EXTENSION='dll' ;; |
Tom Fogal | 9282edf | 2009-10-13 10:55:33 -0700 | [diff] [blame] | 315 | aix* ) |
| 316 | LIB_EXTENSION='a' ;; |
Siddhartha Chaudhuri | 1a46c8a | 2009-02-09 07:58:38 -0700 | [diff] [blame] | 317 | * ) |
| 318 | LIB_EXTENSION='so' ;; |
| 319 | esac |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 320 | fi |
Dan Nicholson | 8217f24 | 2009-02-11 15:16:00 -0800 | [diff] [blame] | 321 | |
| 322 | GL_LIB_NAME='lib$(GL_LIB).'${LIB_EXTENSION} |
| 323 | GLU_LIB_NAME='lib$(GLU_LIB).'${LIB_EXTENSION} |
| 324 | GLUT_LIB_NAME='lib$(GLUT_LIB).'${LIB_EXTENSION} |
| 325 | GLW_LIB_NAME='lib$(GLW_LIB).'${LIB_EXTENSION} |
| 326 | OSMESA_LIB_NAME='lib$(OSMESA_LIB).'${LIB_EXTENSION} |
Chia-I Wu | d4c1ee0 | 2009-12-21 11:13:18 +0800 | [diff] [blame] | 327 | EGL_LIB_NAME='lib$(EGL_LIB).'${LIB_EXTENSION} |
Kristian Høgsberg | 9339c12 | 2010-03-05 19:01:43 -0500 | [diff] [blame] | 328 | GLESv1_CM_LIB_NAME='lib$(GLESv1_CM_LIB).'${LIB_EXTENSION} |
| 329 | GLESv2_LIB_NAME='lib$(GLESv2_LIB).'${LIB_EXTENSION} |
Chia-I Wu | 874ccd5 | 2010-05-04 22:43:05 +0800 | [diff] [blame] | 330 | VG_LIB_NAME='lib$(VG_LIB).'${LIB_EXTENSION} |
Chia-I Wu | 9767d3b | 2010-12-26 18:02:59 +0800 | [diff] [blame] | 331 | GLAPI_LIB_NAME='lib$(GLAPI_LIB).'${LIB_EXTENSION} |
Benjamin Franzke | 214fc6e | 2011-02-04 12:24:08 +0100 | [diff] [blame] | 332 | WAYLAND_EGL_LIB_NAME='lib$(WAYLAND_EGL_LIB).'${LIB_EXTENSION} |
Dan Nicholson | 8217f24 | 2009-02-11 15:16:00 -0800 | [diff] [blame] | 333 | |
Jon TURNEY | c55a8a7 | 2010-07-24 12:05:34 +0100 | [diff] [blame] | 334 | GL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*' |
| 335 | GLU_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLU_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*' |
| 336 | GLUT_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLUT_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*' |
| 337 | GLW_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLW_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*' |
| 338 | OSMESA_LIB_GLOB=${LIB_PREFIX_GLOB}'$(OSMESA_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*' |
| 339 | EGL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(EGL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*' |
| 340 | EGL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(EGL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*' |
| 341 | GLESv1_CM_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLESv1_CM_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*' |
| 342 | GLESv2_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLESv2_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*' |
| 343 | 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] | 344 | GLAPI_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLAPI_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*' |
Benjamin Franzke | 214fc6e | 2011-02-04 12:24:08 +0100 | [diff] [blame] | 345 | WAYLAND_EGL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(WAYLAND_EGL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*' |
Dan Nicholson | 8217f24 | 2009-02-11 15:16:00 -0800 | [diff] [blame] | 346 | |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 347 | AC_SUBST([GL_LIB_NAME]) |
| 348 | AC_SUBST([GLU_LIB_NAME]) |
| 349 | AC_SUBST([GLUT_LIB_NAME]) |
| 350 | AC_SUBST([GLW_LIB_NAME]) |
| 351 | AC_SUBST([OSMESA_LIB_NAME]) |
Chia-I Wu | d4c1ee0 | 2009-12-21 11:13:18 +0800 | [diff] [blame] | 352 | AC_SUBST([EGL_LIB_NAME]) |
Kristian Høgsberg | 9339c12 | 2010-03-05 19:01:43 -0500 | [diff] [blame] | 353 | AC_SUBST([GLESv1_CM_LIB_NAME]) |
| 354 | AC_SUBST([GLESv2_LIB_NAME]) |
Chia-I Wu | 874ccd5 | 2010-05-04 22:43:05 +0800 | [diff] [blame] | 355 | AC_SUBST([VG_LIB_NAME]) |
Chia-I Wu | 9767d3b | 2010-12-26 18:02:59 +0800 | [diff] [blame] | 356 | AC_SUBST([GLAPI_LIB_NAME]) |
Benjamin Franzke | 214fc6e | 2011-02-04 12:24:08 +0100 | [diff] [blame] | 357 | AC_SUBST([WAYLAND_EGL_LIB_NAME]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 358 | |
Siddhartha Chaudhuri | 1a46c8a | 2009-02-09 07:58:38 -0700 | [diff] [blame] | 359 | AC_SUBST([GL_LIB_GLOB]) |
| 360 | AC_SUBST([GLU_LIB_GLOB]) |
| 361 | AC_SUBST([GLUT_LIB_GLOB]) |
| 362 | AC_SUBST([GLW_LIB_GLOB]) |
| 363 | AC_SUBST([OSMESA_LIB_GLOB]) |
Chia-I Wu | d4c1ee0 | 2009-12-21 11:13:18 +0800 | [diff] [blame] | 364 | AC_SUBST([EGL_LIB_GLOB]) |
Kristian Høgsberg | 9339c12 | 2010-03-05 19:01:43 -0500 | [diff] [blame] | 365 | AC_SUBST([GLESv1_CM_LIB_GLOB]) |
| 366 | AC_SUBST([GLESv2_LIB_GLOB]) |
Chia-I Wu | 874ccd5 | 2010-05-04 22:43:05 +0800 | [diff] [blame] | 367 | AC_SUBST([VG_LIB_GLOB]) |
Chia-I Wu | 9767d3b | 2010-12-26 18:02:59 +0800 | [diff] [blame] | 368 | AC_SUBST([GLAPI_LIB_GLOB]) |
Benjamin Franzke | 214fc6e | 2011-02-04 12:24:08 +0100 | [diff] [blame] | 369 | AC_SUBST([WAYLAND_EGL_LIB_GLOB]) |
Siddhartha Chaudhuri | 1a46c8a | 2009-02-09 07:58:38 -0700 | [diff] [blame] | 370 | |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 371 | dnl |
Dan Nicholson | 871125a | 2008-06-04 13:00:35 -0700 | [diff] [blame] | 372 | dnl Arch/platform-specific settings |
| 373 | dnl |
| 374 | AC_ARG_ENABLE([asm], |
| 375 | [AS_HELP_STRING([--disable-asm], |
| 376 | [disable assembly usage @<:@default=enabled on supported plaforms@:>@])], |
| 377 | [enable_asm="$enableval"], |
| 378 | [enable_asm=yes] |
| 379 | ) |
| 380 | asm_arch="" |
| 381 | ASM_FLAGS="" |
Dan Nicholson | c5bae14 | 2009-02-11 11:04:29 -0800 | [diff] [blame] | 382 | MESA_ASM_SOURCES="" |
| 383 | GLAPI_ASM_SOURCES="" |
Dan Nicholson | 871125a | 2008-06-04 13:00:35 -0700 | [diff] [blame] | 384 | AC_MSG_CHECKING([whether to enable assembly]) |
| 385 | test "x$enable_asm" = xno && AC_MSG_RESULT([no]) |
| 386 | # disable if cross compiling on x86/x86_64 since we must run gen_matypes |
| 387 | if test "x$enable_asm" = xyes && test "x$cross_compiling" = xyes; then |
| 388 | case "$host_cpu" in |
| 389 | i?86 | x86_64) |
| 390 | enable_asm=no |
| 391 | AC_MSG_RESULT([no, cross compiling]) |
| 392 | ;; |
| 393 | esac |
| 394 | fi |
| 395 | # check for supported arches |
| 396 | if test "x$enable_asm" = xyes; then |
| 397 | case "$host_cpu" in |
| 398 | i?86) |
| 399 | case "$host_os" in |
Pierre Allegraud | 8fd8de3 | 2011-01-06 07:58:57 -0700 | [diff] [blame] | 400 | linux* | *freebsd* | dragonfly* | *netbsd*) |
Dan Nicholson | 871125a | 2008-06-04 13:00:35 -0700 | [diff] [blame] | 401 | test "x$enable_64bit" = xyes && asm_arch=x86_64 || asm_arch=x86 |
| 402 | ;; |
| 403 | esac |
| 404 | ;; |
| 405 | x86_64) |
| 406 | case "$host_os" in |
Pierre Allegraud | 8fd8de3 | 2011-01-06 07:58:57 -0700 | [diff] [blame] | 407 | linux* | *freebsd* | dragonfly* | *netbsd*) |
Dan Nicholson | 871125a | 2008-06-04 13:00:35 -0700 | [diff] [blame] | 408 | test "x$enable_32bit" = xyes && asm_arch=x86 || asm_arch=x86_64 |
| 409 | ;; |
| 410 | esac |
| 411 | ;; |
| 412 | powerpc) |
| 413 | case "$host_os" in |
| 414 | linux*) |
| 415 | asm_arch=ppc |
| 416 | ;; |
| 417 | esac |
| 418 | ;; |
David S. Miller | 857ac1e | 2009-02-26 05:35:15 -0800 | [diff] [blame] | 419 | sparc*) |
| 420 | case "$host_os" in |
| 421 | linux*) |
| 422 | asm_arch=sparc |
| 423 | ;; |
| 424 | esac |
| 425 | ;; |
Dan Nicholson | 871125a | 2008-06-04 13:00:35 -0700 | [diff] [blame] | 426 | esac |
| 427 | |
| 428 | case "$asm_arch" in |
| 429 | x86) |
Dan Nicholson | 61e925f | 2009-02-11 10:42:34 -0800 | [diff] [blame] | 430 | ASM_FLAGS="-DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM" |
Dan Nicholson | c5bae14 | 2009-02-11 11:04:29 -0800 | [diff] [blame] | 431 | MESA_ASM_SOURCES='$(X86_SOURCES)' |
| 432 | GLAPI_ASM_SOURCES='$(X86_API)' |
Dan Nicholson | 871125a | 2008-06-04 13:00:35 -0700 | [diff] [blame] | 433 | AC_MSG_RESULT([yes, x86]) |
| 434 | ;; |
| 435 | x86_64) |
| 436 | ASM_FLAGS="-DUSE_X86_64_ASM" |
Dan Nicholson | c5bae14 | 2009-02-11 11:04:29 -0800 | [diff] [blame] | 437 | MESA_ASM_SOURCES='$(X86-64_SOURCES)' |
| 438 | GLAPI_ASM_SOURCES='$(X86-64_API)' |
Dan Nicholson | 871125a | 2008-06-04 13:00:35 -0700 | [diff] [blame] | 439 | AC_MSG_RESULT([yes, x86_64]) |
| 440 | ;; |
| 441 | ppc) |
| 442 | ASM_FLAGS="-DUSE_PPC_ASM -DUSE_VMX_ASM" |
Dan Nicholson | c5bae14 | 2009-02-11 11:04:29 -0800 | [diff] [blame] | 443 | MESA_ASM_SOURCES='$(PPC_SOURCES)' |
Dan Nicholson | 871125a | 2008-06-04 13:00:35 -0700 | [diff] [blame] | 444 | AC_MSG_RESULT([yes, ppc]) |
| 445 | ;; |
David S. Miller | 857ac1e | 2009-02-26 05:35:15 -0800 | [diff] [blame] | 446 | sparc) |
| 447 | ASM_FLAGS="-DUSE_SPARC_ASM" |
| 448 | MESA_ASM_SOURCES='$(SPARC_SOURCES)' |
| 449 | GLAPI_ASM_SOURCES='$(SPARC_API)' |
| 450 | AC_MSG_RESULT([yes, sparc]) |
| 451 | ;; |
Dan Nicholson | 871125a | 2008-06-04 13:00:35 -0700 | [diff] [blame] | 452 | *) |
| 453 | AC_MSG_RESULT([no, platform not supported]) |
| 454 | ;; |
| 455 | esac |
| 456 | fi |
| 457 | AC_SUBST([ASM_FLAGS]) |
Dan Nicholson | c5bae14 | 2009-02-11 11:04:29 -0800 | [diff] [blame] | 458 | AC_SUBST([MESA_ASM_SOURCES]) |
| 459 | AC_SUBST([GLAPI_ASM_SOURCES]) |
Dan Nicholson | 871125a | 2008-06-04 13:00:35 -0700 | [diff] [blame] | 460 | |
| 461 | dnl PIC code macro |
| 462 | MESA_PIC_FLAGS |
| 463 | |
| 464 | dnl Check to see if dlopen is in default libraries (like Solaris, which |
| 465 | dnl has it in libc), or if libdl is needed to get it. |
| 466 | AC_CHECK_FUNC([dlopen], [], |
| 467 | [AC_CHECK_LIB([dl], [dlopen], [DLOPEN_LIBS="-ldl"])]) |
Chia-I Wu | 08f4bc0 | 2010-07-16 20:09:29 +0800 | [diff] [blame] | 468 | AC_SUBST([DLOPEN_LIBS]) |
Dan Nicholson | 871125a | 2008-06-04 13:00:35 -0700 | [diff] [blame] | 469 | |
Dan Nicholson | 985e1cd | 2008-06-04 13:17:06 -0700 | [diff] [blame] | 470 | dnl See if posix_memalign is available |
| 471 | AC_CHECK_FUNC([posix_memalign], [DEFINES="$DEFINES -DHAVE_POSIX_MEMALIGN"]) |
| 472 | |
Dan Nicholson | 871125a | 2008-06-04 13:00:35 -0700 | [diff] [blame] | 473 | dnl SELinux awareness. |
| 474 | AC_ARG_ENABLE([selinux], |
| 475 | [AS_HELP_STRING([--enable-selinux], |
| 476 | [Build SELinux-aware Mesa @<:@default=disabled@:>@])], |
| 477 | [MESA_SELINUX="$enableval"], |
| 478 | [MESA_SELINUX=no]) |
| 479 | if test "x$enable_selinux" = "xyes"; then |
| 480 | AC_CHECK_HEADER([selinux/selinux.h],[], |
| 481 | [AC_MSG_ERROR([SELinux headers not found])]) |
| 482 | AC_CHECK_LIB([selinux],[is_selinux_enabled],[], |
| 483 | [AC_MSG_ERROR([SELinux library not found])]) |
| 484 | SELINUX_LIBS="-lselinux" |
| 485 | DEFINES="$DEFINES -DMESA_SELINUX" |
| 486 | fi |
| 487 | |
Chia-I Wu | be5f34a | 2010-10-27 16:14:27 +0800 | [diff] [blame] | 488 | dnl Determine which APIs to support |
| 489 | AC_ARG_ENABLE([opengl], |
| 490 | [AS_HELP_STRING([--disable-opengl], |
| 491 | [disable support for standard OpenGL API @<:@default=no@:>@])], |
| 492 | [enable_opengl="$enableval"], |
| 493 | [enable_opengl=yes]) |
| 494 | AC_ARG_ENABLE([gles1], |
| 495 | [AS_HELP_STRING([--enable-gles1], |
| 496 | [enable support for OpenGL ES 1.x API @<:@default=no@:>@])], |
| 497 | [enable_gles1="$enableval"], |
| 498 | [enable_gles1=no]) |
| 499 | AC_ARG_ENABLE([gles2], |
| 500 | [AS_HELP_STRING([--enable-gles2], |
| 501 | [enable support for OpenGL ES 2.x API @<:@default=no@:>@])], |
| 502 | [enable_gles2="$enableval"], |
| 503 | [enable_gles2=no]) |
| 504 | AC_ARG_ENABLE([gles-overlay], |
| 505 | [AS_HELP_STRING([--enable-gles-overlay], |
Chia-I Wu | 1258317 | 2011-01-07 17:24:16 +0800 | [diff] [blame] | 506 | [DEPRECATED. Same as --enable-gles1 and --enable-gles2])], |
| 507 | [enable_gles1="$enableval"; enable_gles2="$enableval"], |
| 508 | []) |
Chia-I Wu | be5f34a | 2010-10-27 16:14:27 +0800 | [diff] [blame] | 509 | |
| 510 | AC_ARG_ENABLE([openvg], |
| 511 | [AS_HELP_STRING([--enable-openvg], |
| 512 | [enable support for OpenVG API @<:@default=no@:>@])], |
| 513 | [enable_openvg="$enableval"], |
| 514 | [enable_openvg=no]) |
| 515 | |
Chia-I Wu | 156e955 | 2010-10-30 14:26:01 +0800 | [diff] [blame] | 516 | dnl smooth the transition; should be removed eventually |
| 517 | if test "x$enable_openvg" = xno; then |
| 518 | case "x$with_state_trackers" in |
| 519 | x*vega*) |
| 520 | AC_MSG_WARN([vega state tracker is enabled without --enable-openvg]) |
| 521 | enable_openvg=yes |
| 522 | ;; |
| 523 | esac |
| 524 | fi |
| 525 | |
Chia-I Wu | be5f34a | 2010-10-27 16:14:27 +0800 | [diff] [blame] | 526 | if test "x$enable_opengl" = xno -a \ |
| 527 | "x$enable_gles1" = xno -a \ |
| 528 | "x$enable_gles2" = xno -a \ |
Chia-I Wu | be5f34a | 2010-10-27 16:14:27 +0800 | [diff] [blame] | 529 | "x$enable_openvg" = xno; then |
| 530 | AC_MSG_ERROR([at least one API should be enabled]) |
| 531 | fi |
| 532 | |
| 533 | API_DEFINES="" |
Chia-I Wu | be5f34a | 2010-10-27 16:14:27 +0800 | [diff] [blame] | 534 | if test "x$enable_opengl" = xno; then |
| 535 | API_DEFINES="$API_DEFINES -DFEATURE_GL=0" |
| 536 | else |
| 537 | API_DEFINES="$API_DEFINES -DFEATURE_GL=1" |
| 538 | fi |
| 539 | if test "x$enable_gles1" = xyes; then |
| 540 | API_DEFINES="$API_DEFINES -DFEATURE_ES1=1" |
| 541 | fi |
| 542 | if test "x$enable_gles2" = xyes; then |
| 543 | API_DEFINES="$API_DEFINES -DFEATURE_ES2=1" |
| 544 | fi |
Chia-I Wu | be5f34a | 2010-10-27 16:14:27 +0800 | [diff] [blame] | 545 | AC_SUBST([API_DEFINES]) |
Chia-I Wu | be5f34a | 2010-10-27 16:14:27 +0800 | [diff] [blame] | 546 | |
Chia-I Wu | e8c7d75 | 2010-12-26 18:24:13 +0800 | [diff] [blame] | 547 | AC_ARG_ENABLE([shared-glapi], |
| 548 | [AS_HELP_STRING([--enable-shared-glapi], |
| 549 | [EXPERIMENTAL. Enable shared glapi for OpenGL @<:@default=no@:>@])], |
| 550 | [enable_shared_glapi="$enableval"], |
| 551 | [enable_shared_glapi=no]) |
| 552 | |
| 553 | SHARED_GLAPI="0" |
| 554 | if test "x$enable_shared_glapi" = xyes; then |
| 555 | SHARED_GLAPI="1" |
| 556 | fi |
| 557 | AC_SUBST([SHARED_GLAPI]) |
| 558 | |
Dan Nicholson | 871125a | 2008-06-04 13:00:35 -0700 | [diff] [blame] | 559 | dnl |
Dan Nicholson | a130718 | 2007-12-12 17:49:49 -0800 | [diff] [blame] | 560 | dnl Driver configuration. Options are xlib, dri and osmesa right now. |
Kristian Høgsberg | 4387580 | 2010-02-25 15:49:18 -0500 | [diff] [blame] | 561 | dnl More later: fbdev, ... |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 562 | dnl |
Eric Anholt | 711222b | 2008-04-18 15:03:01 -0700 | [diff] [blame] | 563 | default_driver="xlib" |
| 564 | |
| 565 | case "$host_os" in |
| 566 | linux*) |
| 567 | case "$host_cpu" in |
David S. Miller | 32dc28a | 2009-02-24 20:06:05 -0700 | [diff] [blame] | 568 | i*86|x86_64|powerpc*|sparc*) default_driver="dri";; |
Eric Anholt | 711222b | 2008-04-18 15:03:01 -0700 | [diff] [blame] | 569 | esac |
| 570 | ;; |
Pierre Allegraud | 8fd8de3 | 2011-01-06 07:58:57 -0700 | [diff] [blame] | 571 | *freebsd* | dragonfly* | *netbsd*) |
Eric Anholt | 711222b | 2008-04-18 15:03:01 -0700 | [diff] [blame] | 572 | case "$host_cpu" in |
Robert Noland | 48f0543 | 2009-04-10 11:41:27 -0500 | [diff] [blame] | 573 | i*86|x86_64|powerpc*|sparc*) default_driver="dri";; |
Eric Anholt | 711222b | 2008-04-18 15:03:01 -0700 | [diff] [blame] | 574 | esac |
| 575 | ;; |
| 576 | esac |
| 577 | |
Chia-I Wu | be5f34a | 2010-10-27 16:14:27 +0800 | [diff] [blame] | 578 | if test "x$enable_opengl" = xno; then |
| 579 | default_driver="no" |
| 580 | fi |
| 581 | |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 582 | AC_ARG_WITH([driver], |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 583 | [AS_HELP_STRING([--with-driver=DRIVER], |
Eric Anholt | 711222b | 2008-04-18 15:03:01 -0700 | [diff] [blame] | 584 | [driver for Mesa: xlib,dri,osmesa @<:@default=dri when available, or xlib@:>@])], |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 585 | [mesa_driver="$withval"], |
| 586 | [mesa_driver="$default_driver"]) |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 587 | dnl Check for valid option |
| 588 | case "x$mesa_driver" in |
Dan Nicholson | a130718 | 2007-12-12 17:49:49 -0800 | [diff] [blame] | 589 | xxlib|xdri|xosmesa) |
Chia-I Wu | be5f34a | 2010-10-27 16:14:27 +0800 | [diff] [blame] | 590 | if test "x$enable_opengl" = xno; then |
| 591 | AC_MSG_ERROR([Driver '$mesa_driver' requires OpenGL enabled]) |
| 592 | fi |
| 593 | ;; |
| 594 | xno) |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 595 | ;; |
| 596 | *) |
| 597 | AC_MSG_ERROR([Driver '$mesa_driver' is not a valid option]) |
| 598 | ;; |
| 599 | esac |
| 600 | |
| 601 | dnl |
| 602 | dnl Driver specific build directories |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 603 | dnl |
Chia-I Wu | 99a37ed | 2010-01-05 17:39:05 +0800 | [diff] [blame] | 604 | |
| 605 | dnl this variable will be prepended to SRC_DIRS and is not exported |
Chia-I Wu | be5f34a | 2010-10-27 16:14:27 +0800 | [diff] [blame] | 606 | CORE_DIRS="" |
Chia-I Wu | 99a37ed | 2010-01-05 17:39:05 +0800 | [diff] [blame] | 607 | |
Jakob Bornecrantz | 0528106 | 2010-06-05 13:33:58 +0200 | [diff] [blame] | 608 | SRC_DIRS="" |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 609 | GLU_DIRS="sgi" |
Jakob Bornecrantz | 7e54d7d | 2009-02-11 02:38:21 +0100 | [diff] [blame] | 610 | GALLIUM_DIRS="auxiliary drivers state_trackers" |
Keith Whitwell | 51bff09 | 2010-03-11 14:43:00 +0000 | [diff] [blame] | 611 | GALLIUM_TARGET_DIRS="" |
Jakob Bornecrantz | c9f9867 | 2010-03-16 13:54:18 +0000 | [diff] [blame] | 612 | GALLIUM_WINSYS_DIRS="sw" |
Jerome Glisse | 3349517 | 2011-01-09 21:04:41 -0500 | [diff] [blame] | 613 | GALLIUM_DRIVERS_DIRS="softpipe failover galahad trace rbug noop identity" |
Jakob Bornecrantz | 7e54d7d | 2009-02-11 02:38:21 +0100 | [diff] [blame] | 614 | GALLIUM_STATE_TRACKERS_DIRS="" |
| 615 | |
Chia-I Wu | e8c7d75 | 2010-12-26 18:24:13 +0800 | [diff] [blame] | 616 | # build shared-glapi if enabled for OpenGL or if OpenGL ES is enabled |
Jon TURNEY | aa6a5cf | 2011-02-16 13:37:57 +0000 | [diff] [blame] | 617 | case "x$enable_shared_glapi$enable_gles1$enable_gles2" in |
Chia-I Wu | 9767d3b | 2010-12-26 18:02:59 +0800 | [diff] [blame] | 618 | x*yes*) |
| 619 | CORE_DIRS="$CORE_DIRS mapi/shared-glapi" |
| 620 | ;; |
| 621 | esac |
| 622 | |
Chia-I Wu | be5f34a | 2010-10-27 16:14:27 +0800 | [diff] [blame] | 623 | # build glapi if OpenGL is enabled |
| 624 | if test "x$enable_opengl" = xyes; then |
| 625 | CORE_DIRS="$CORE_DIRS mapi/glapi" |
| 626 | fi |
| 627 | |
Chia-I Wu | 1258317 | 2011-01-07 17:24:16 +0800 | [diff] [blame] | 628 | # build es1api if OpenGL ES 1.x is enabled |
| 629 | if test "x$enable_gles1" = xyes; then |
| 630 | CORE_DIRS="$CORE_DIRS mapi/es1api" |
| 631 | fi |
| 632 | |
| 633 | # build es2api if OpenGL ES 2.x is enabled |
| 634 | if test "x$enable_gles2" = xyes; then |
| 635 | CORE_DIRS="$CORE_DIRS mapi/es2api" |
| 636 | fi |
Chia-I Wu | be5f34a | 2010-10-27 16:14:27 +0800 | [diff] [blame] | 637 | |
| 638 | # build vgapi if OpenVG is enabled |
| 639 | if test "x$enable_openvg" = xyes; then |
| 640 | CORE_DIRS="$CORE_DIRS mapi/vgapi" |
| 641 | fi |
| 642 | |
| 643 | # build glsl and mesa if OpenGL or OpenGL ES is enabled |
Chia-I Wu | 1258317 | 2011-01-07 17:24:16 +0800 | [diff] [blame] | 644 | case "x$enable_opengl$enable_gles1$enable_gles2" in |
Chia-I Wu | be5f34a | 2010-10-27 16:14:27 +0800 | [diff] [blame] | 645 | x*yes*) |
| 646 | CORE_DIRS="$CORE_DIRS glsl mesa" |
| 647 | ;; |
| 648 | esac |
| 649 | |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 650 | case "$mesa_driver" in |
Dan Nicholson | a130718 | 2007-12-12 17:49:49 -0800 | [diff] [blame] | 651 | xlib) |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 652 | DRIVER_DIRS="x11" |
Jakob Bornecrantz | c9f9867 | 2010-03-16 13:54:18 +0000 | [diff] [blame] | 653 | GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/xlib" |
Keith Whitwell | 51bff09 | 2010-03-11 14:43:00 +0000 | [diff] [blame] | 654 | GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS libgl-xlib" |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 655 | ;; |
| 656 | dri) |
Kristian Høgsberg | 6e8897f | 2010-02-09 09:58:36 -0500 | [diff] [blame] | 657 | SRC_DIRS="$SRC_DIRS glx" |
Jakob Bornecrantz | 7e54d7d | 2009-02-11 02:38:21 +0100 | [diff] [blame] | 658 | DRIVER_DIRS="dri" |
Jakob Bornecrantz | 23a915e | 2010-06-23 03:31:18 +0200 | [diff] [blame] | 659 | GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/xlib sw/dri" |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 660 | ;; |
Dan Nicholson | 979ff51 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 661 | osmesa) |
| 662 | DRIVER_DIRS="osmesa" |
| 663 | ;; |
Chia-I Wu | be5f34a | 2010-10-27 16:14:27 +0800 | [diff] [blame] | 664 | no) |
| 665 | DRIVER_DRIS="" |
| 666 | ;; |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 667 | esac |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 668 | AC_SUBST([SRC_DIRS]) |
| 669 | AC_SUBST([GLU_DIRS]) |
| 670 | AC_SUBST([DRIVER_DIRS]) |
Jakob Bornecrantz | 7e54d7d | 2009-02-11 02:38:21 +0100 | [diff] [blame] | 671 | AC_SUBST([GALLIUM_DIRS]) |
Keith Whitwell | 51bff09 | 2010-03-11 14:43:00 +0000 | [diff] [blame] | 672 | AC_SUBST([GALLIUM_TARGET_DIRS]) |
Jerome Glisse | 14f79d4 | 2008-12-18 13:36:07 +0100 | [diff] [blame] | 673 | AC_SUBST([GALLIUM_WINSYS_DIRS]) |
Jakob Bornecrantz | d67bd60 | 2009-02-20 11:03:18 +0000 | [diff] [blame] | 674 | AC_SUBST([GALLIUM_DRIVERS_DIRS]) |
Jakob Bornecrantz | 7e54d7d | 2009-02-11 02:38:21 +0100 | [diff] [blame] | 675 | AC_SUBST([GALLIUM_STATE_TRACKERS_DIRS]) |
Dave Airlie | 81fe198 | 2010-04-22 14:59:29 +1000 | [diff] [blame] | 676 | AC_SUBST([MESA_LLVM]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 677 | |
| 678 | dnl |
Dan Nicholson | e6a0609 | 2008-05-05 15:16:22 -0700 | [diff] [blame] | 679 | dnl Find out if X is available. The variable have_x is set if libX11 is |
Dan Nicholson | 99803a4 | 2008-07-01 09:03:15 -0700 | [diff] [blame] | 680 | dnl found to mimic AC_PATH_XTRA. |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 681 | dnl |
| 682 | if test -n "$PKG_CONFIG"; then |
| 683 | AC_MSG_CHECKING([pkg-config files for X11 are available]) |
Dan Nicholson | e6a0609 | 2008-05-05 15:16:22 -0700 | [diff] [blame] | 684 | PKG_CHECK_EXISTS([x11],[ |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 685 | x11_pkgconfig=yes |
| 686 | have_x=yes |
Dan Nicholson | e6a0609 | 2008-05-05 15:16:22 -0700 | [diff] [blame] | 687 | ],[ |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 688 | x11_pkgconfig=no |
Dan Nicholson | e6a0609 | 2008-05-05 15:16:22 -0700 | [diff] [blame] | 689 | ]) |
| 690 | AC_MSG_RESULT([$x11_pkgconfig]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 691 | else |
| 692 | x11_pkgconfig=no |
| 693 | fi |
| 694 | dnl Use the autoconf macro if no pkg-config files |
Jeff Smith | 8d86d39 | 2010-03-12 18:55:09 -0600 | [diff] [blame] | 695 | if test "$x11_pkgconfig" = yes; then |
Dan Nicholson | e725ef1 | 2010-03-15 20:53:56 -0700 | [diff] [blame] | 696 | PKG_CHECK_MODULES([X11], [x11]) |
Jeff Smith | 8d86d39 | 2010-03-12 18:55:09 -0600 | [diff] [blame] | 697 | else |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 698 | AC_PATH_XTRA |
Dan Nicholson | e725ef1 | 2010-03-15 20:53:56 -0700 | [diff] [blame] | 699 | test -z "$X11_CFLAGS" && X11_CFLAGS="$X_CFLAGS" |
| 700 | test -z "$X11_LIBS" && X11_LIBS="$X_LIBS -lX11" |
| 701 | AC_SUBST([X11_CFLAGS]) |
| 702 | AC_SUBST([X11_LIBS]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 703 | fi |
| 704 | |
Dan Nicholson | 99803a4 | 2008-07-01 09:03:15 -0700 | [diff] [blame] | 705 | dnl Try to tell the user that the --x-* options are only used when |
| 706 | dnl pkg-config is not available. This must be right after AC_PATH_XTRA. |
| 707 | m4_divert_once([HELP_BEGIN], |
| 708 | [These options are only used when the X libraries cannot be found by the |
| 709 | pkg-config utility.]) |
| 710 | |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 711 | dnl We need X for xlib and dri, so bomb now if it's not found |
| 712 | case "$mesa_driver" in |
Dan Nicholson | a130718 | 2007-12-12 17:49:49 -0800 | [diff] [blame] | 713 | xlib|dri) |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 714 | if test "$no_x" = yes; then |
| 715 | AC_MSG_ERROR([X11 development libraries needed for $mesa_driver driver]) |
| 716 | fi |
| 717 | ;; |
| 718 | esac |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 719 | |
Dan Nicholson | 2d709fe | 2008-05-06 10:51:49 -0700 | [diff] [blame] | 720 | dnl XCB - this is only used for GLX right now |
| 721 | AC_ARG_ENABLE([xcb], |
| 722 | [AS_HELP_STRING([--enable-xcb], |
| 723 | [use XCB for GLX @<:@default=disabled@:>@])], |
| 724 | [enable_xcb="$enableval"], |
| 725 | [enable_xcb=no]) |
| 726 | if test "x$enable_xcb" = xyes; then |
| 727 | DEFINES="$DEFINES -DUSE_XCB" |
| 728 | else |
| 729 | enable_xcb=no |
| 730 | fi |
| 731 | |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 732 | dnl |
| 733 | dnl libGL configuration per driver |
| 734 | dnl |
| 735 | case "$mesa_driver" in |
Dan Nicholson | a130718 | 2007-12-12 17:49:49 -0800 | [diff] [blame] | 736 | xlib) |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 737 | if test "$x11_pkgconfig" = yes; then |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 738 | PKG_CHECK_MODULES([XLIBGL], [x11 xext]) |
Dan Nicholson | 71e208b | 2008-11-24 11:01:57 -0800 | [diff] [blame] | 739 | GL_PC_REQ_PRIV="x11 xext" |
Dan Nicholson | a130718 | 2007-12-12 17:49:49 -0800 | [diff] [blame] | 740 | X11_INCLUDES="$X11_INCLUDES $XLIBGL_CFLAGS" |
| 741 | GL_LIB_DEPS="$XLIBGL_LIBS" |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 742 | else |
| 743 | # should check these... |
| 744 | X11_INCLUDES="$X11_INCLUDES $X_CFLAGS" |
| 745 | GL_LIB_DEPS="$X_LIBS -lX11 -lXext" |
Dan Nicholson | 71e208b | 2008-11-24 11:01:57 -0800 | [diff] [blame] | 746 | GL_PC_LIB_PRIV="$GL_LIB_DEPS" |
| 747 | GL_PC_CFLAGS="$X11_INCLUDES" |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 748 | fi |
Kenneth Graunke | d1d81205 | 2011-01-16 16:01:54 -0800 | [diff] [blame] | 749 | GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm -lpthread" |
| 750 | GL_PC_LIB_PRIV="$GL_PC_LIB_PRIV $SELINUX_LIBS -lm -lpthread" |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 751 | |
| 752 | # if static, move the external libraries to the programs |
| 753 | # and empty the libraries for libGL |
| 754 | if test "$enable_static" = yes; then |
| 755 | APP_LIB_DEPS="$APP_LIB_DEPS $GL_LIB_DEPS" |
| 756 | GL_LIB_DEPS="" |
| 757 | fi |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 758 | ;; |
Chia-I Wu | be5f34a | 2010-10-27 16:14:27 +0800 | [diff] [blame] | 759 | dri|no) # these checks are still desired when there is no mesa_driver |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 760 | # DRI must be shared, I think |
| 761 | if test "$enable_static" = yes; then |
| 762 | AC_MSG_ERROR([Can't use static libraries for DRI drivers]) |
| 763 | fi |
| 764 | |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 765 | # Check for libdrm |
Dan Nicholson | cc77e8f | 2008-05-05 14:38:22 -0700 | [diff] [blame] | 766 | PKG_CHECK_MODULES([LIBDRM], [libdrm >= $LIBDRM_REQUIRED]) |
| 767 | PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= $DRI2PROTO_REQUIRED]) |
Jesse Barnes | f2f83d9 | 2010-01-11 17:28:10 -0500 | [diff] [blame] | 768 | PKG_CHECK_MODULES([GLPROTO], [glproto >= $GLPROTO_REQUIRED]) |
Jesse Barnes | ed59b13 | 2010-01-13 15:48:14 -0500 | [diff] [blame] | 769 | GL_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED dri2proto >= $DRI2PROTO_REQUIRED glproto >= $GLPROTO_REQUIRED" |
| 770 | DRI_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED" |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 771 | |
| 772 | # find the DRI deps for libGL |
| 773 | if test "$x11_pkgconfig" = yes; then |
Jon TURNEY | 2b9dac3 | 2010-04-21 12:58:54 +0100 | [diff] [blame] | 774 | dri_modules="x11 xext xdamage xfixes" |
| 775 | |
| 776 | # add xf86vidmode if available |
| 777 | PKG_CHECK_MODULES([XF86VIDMODE], [xxf86vm], HAVE_XF86VIDMODE=yes, HAVE_XF86VIDMODE=no) |
| 778 | if test "$HAVE_XF86VIDMODE" = yes ; then |
| 779 | dri_modules="$dri_modules xxf86vm" |
| 780 | fi |
| 781 | |
Dan Nicholson | 2d709fe | 2008-05-06 10:51:49 -0700 | [diff] [blame] | 782 | # add xcb modules if necessary |
Dan Nicholson | 2d709fe | 2008-05-06 10:51:49 -0700 | [diff] [blame] | 783 | if test "$enable_xcb" = yes; then |
| 784 | dri_modules="$dri_modules x11-xcb xcb-glx" |
| 785 | fi |
| 786 | |
| 787 | PKG_CHECK_MODULES([DRIGL], [$dri_modules]) |
Dan Nicholson | 71e208b | 2008-11-24 11:01:57 -0800 | [diff] [blame] | 788 | GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV $dri_modules" |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 789 | X11_INCLUDES="$X11_INCLUDES $DRIGL_CFLAGS" |
| 790 | GL_LIB_DEPS="$DRIGL_LIBS" |
| 791 | else |
| 792 | # should check these... |
| 793 | X11_INCLUDES="$X11_INCLUDES $X_CFLAGS" |
| 794 | GL_LIB_DEPS="$X_LIBS -lX11 -lXext -lXxf86vm -lXdamage -lXfixes" |
Dan Nicholson | 71e208b | 2008-11-24 11:01:57 -0800 | [diff] [blame] | 795 | GL_PC_LIB_PRIV="$GL_LIB_DEPS" |
| 796 | GL_PC_CFLAGS="$X11_INCLUDES" |
Dan Nicholson | 2d709fe | 2008-05-06 10:51:49 -0700 | [diff] [blame] | 797 | |
| 798 | # XCB can only be used from pkg-config |
| 799 | if test "$enable_xcb" = yes; then |
| 800 | PKG_CHECK_MODULES([XCB],[x11-xcb xcb-glx]) |
Dan Nicholson | 71e208b | 2008-11-24 11:01:57 -0800 | [diff] [blame] | 801 | GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV x11-xcb xcb-glx" |
Dan Nicholson | 2d709fe | 2008-05-06 10:51:49 -0700 | [diff] [blame] | 802 | X11_INCLUDES="$X11_INCLUDES $XCB_CFLAGS" |
| 803 | GL_LIB_DEPS="$GL_LIB_DEPS $XCB_LIBS" |
| 804 | fi |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 805 | fi |
| 806 | |
| 807 | # need DRM libs, -lpthread, etc. |
Alan Coopersmith | 3cf6e62 | 2009-03-23 16:51:54 -0700 | [diff] [blame] | 808 | GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS" |
| 809 | GL_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS" |
Kristian Høgsberg | 9339c12 | 2010-03-05 19:01:43 -0500 | [diff] [blame] | 810 | GLESv1_CM_LIB_DEPS="$LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS" |
Kristian Høgsberg | 74399d4 | 2010-05-02 09:51:13 -0400 | [diff] [blame] | 811 | GLESv1_CM_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS" |
Kristian Høgsberg | 9339c12 | 2010-03-05 19:01:43 -0500 | [diff] [blame] | 812 | GLESv2_LIB_DEPS="$LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS" |
Kristian Høgsberg | 74399d4 | 2010-05-02 09:51:13 -0400 | [diff] [blame] | 813 | GLESv2_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS" |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 814 | ;; |
Dan Nicholson | 979ff51 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 815 | osmesa) |
| 816 | # No libGL for osmesa |
Alan Coopersmith | 3cf6e62 | 2009-03-23 16:51:54 -0700 | [diff] [blame] | 817 | GL_LIB_DEPS="" |
Dan Nicholson | 979ff51 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 818 | ;; |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 819 | esac |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 820 | AC_SUBST([GL_LIB_DEPS]) |
Dan Nicholson | 71e208b | 2008-11-24 11:01:57 -0800 | [diff] [blame] | 821 | AC_SUBST([GL_PC_REQ_PRIV]) |
| 822 | AC_SUBST([GL_PC_LIB_PRIV]) |
| 823 | AC_SUBST([GL_PC_CFLAGS]) |
| 824 | AC_SUBST([DRI_PC_REQ_PRIV]) |
Li Peng | c33c191 | 2010-07-30 12:26:15 +0800 | [diff] [blame] | 825 | AC_SUBST([GLESv1_CM_LIB_DEPS]) |
Kristian Høgsberg | 9e4f2da | 2010-05-04 14:13:11 -0400 | [diff] [blame] | 826 | AC_SUBST([GLESv1_CM_PC_LIB_PRIV]) |
Kristian Høgsberg | 9339c12 | 2010-03-05 19:01:43 -0500 | [diff] [blame] | 827 | AC_SUBST([GLESv2_LIB_DEPS]) |
Kristian Høgsberg | 9e4f2da | 2010-05-04 14:13:11 -0400 | [diff] [blame] | 828 | AC_SUBST([GLESv2_PC_LIB_PRIV]) |
| 829 | |
Chia-I Wu | 9767d3b | 2010-12-26 18:02:59 +0800 | [diff] [blame] | 830 | GLAPI_LIB_DEPS="-lpthread" |
| 831 | AC_SUBST([GLAPI_LIB_DEPS]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 832 | |
Christopher James Halse Rogers | d1e28b2 | 2011-02-03 11:19:32 +1100 | [diff] [blame] | 833 | |
| 834 | dnl Setup default DRI CFLAGS |
| 835 | DRI_CFLAGS='$(CFLAGS)' |
| 836 | DRI_CXXFLAGS='$(CXXFLAGS)' |
| 837 | DRI_LIB_DEPS='$(TOP)/src/mesa/libmesa.a' |
| 838 | MESA_MODULES='$(TOP)/src/mesa/libmesa.a' |
| 839 | |
| 840 | AC_ARG_ENABLE([shared-dricore], |
| 841 | [AS_HELP_STRING([--enable-shared-dricore], |
| 842 | [link DRI modules with shared core DRI routines @<:@default=disabled@:>@])], |
| 843 | [enable_dricore="$enableval"], |
| 844 | [enable_dricore=no]) |
| 845 | if test "$mesa_driver" = dri ; then |
| 846 | if test "$enable_dricore" = yes ; then |
| 847 | if test "$GCC$GXX" != yesyes ; then |
| 848 | AC_MSG_WARN([Shared dricore requires GCC-compatible rpath handling. Disabling shared dricore]) |
| 849 | enable_dricore=no |
| 850 | else |
| 851 | DRICORE_GLSL_LIBS='$(TOP)/$(LIB_DIR)/libglsl.so' |
| 852 | DRICORE_LIBS='$(TOP)/$(LIB_DIR)/libdricore.so' |
| 853 | DRICORE_LIB_DEPS='-L$(TOP)/$(LIB_DIR) -Wl,-R$(DRI_DRIVER_INSTALL_DIR) -lglsl' |
| 854 | DRI_LIB_DEPS='-L$(TOP)/$(LIB_DIR) -Wl,-R$(DRI_DRIVER_INSTALL_DIR) -ldricore -lglsl' |
| 855 | DRI_CFLAGS='$(CFLAGS_NOVISIBILITY) -DUSE_DRICORE' |
| 856 | DRI_CXXFLAGS='$(CXXFLAGS_NOVISIBILITY) -DUSE_DRICORE' |
| 857 | MESA_MODULES='$(DRICORE_LIBS) $(DRICORE_GLSL_LIBS)' |
| 858 | fi |
| 859 | fi |
| 860 | fi |
| 861 | AC_SUBST([DRICORE_LIBS]) |
| 862 | AC_SUBST([DRICORE_GLSL_LIBS]) |
| 863 | AC_SUBST([DRICORE_LIB_DEPS]) |
| 864 | AC_SUBST([DRI_CXXFLAGS]) |
| 865 | AC_SUBST([DRI_CFLAGS]) |
| 866 | AC_SUBST([MESA_MODULES]) |
| 867 | |
Jon TURNEY | 2b9dac3 | 2010-04-21 12:58:54 +0100 | [diff] [blame] | 868 | AC_SUBST([HAVE_XF86VIDMODE]) |
| 869 | |
Marek Olšák | a1aec2e | 2010-09-26 17:52:58 +0200 | [diff] [blame] | 870 | PKG_CHECK_MODULES([LIBDRM_RADEON], |
Marek Olšák | ec96b0e | 2011-02-06 15:42:55 +0100 | [diff] [blame] | 871 | [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED], |
Marek Olšák | a1aec2e | 2010-09-26 17:52:58 +0200 | [diff] [blame] | 872 | HAVE_LIBDRM_RADEON=yes, |
| 873 | HAVE_LIBDRM_RADEON=no) |
| 874 | |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 875 | dnl |
| 876 | dnl More X11 setup |
| 877 | dnl |
Dan Nicholson | a130718 | 2007-12-12 17:49:49 -0800 | [diff] [blame] | 878 | if test "$mesa_driver" = xlib; then |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 879 | DEFINES="$DEFINES -DUSE_XSHM" |
| 880 | fi |
| 881 | |
| 882 | dnl |
Tom Fogal | 31351dc | 2010-12-05 17:58:32 -0700 | [diff] [blame] | 883 | dnl TLS detection |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 884 | dnl |
Tom Fogal | 31351dc | 2010-12-05 17:58:32 -0700 | [diff] [blame] | 885 | |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 886 | AC_ARG_ENABLE([glx-tls], |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 887 | [AS_HELP_STRING([--enable-glx-tls], |
Dan Nicholson | 79ad458 | 2007-12-07 19:11:01 -0800 | [diff] [blame] | 888 | [enable TLS support in GLX @<:@default=disabled@:>@])], |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 889 | [GLX_USE_TLS="$enableval"], |
| 890 | [GLX_USE_TLS=no]) |
Tom Fogal | 31351dc | 2010-12-05 17:58:32 -0700 | [diff] [blame] | 891 | AC_SUBST(GLX_TLS, ${GLX_USE_TLS}) |
| 892 | |
Tom Fogal | 4484297 | 2011-02-21 22:32:18 -0700 | [diff] [blame] | 893 | AS_IF([test "x$GLX_USE_TLS" = xyes], |
| 894 | [DEFINES="${DEFINES} -DGLX_USE_TLS -DPTHREADS"]) |
| 895 | |
Tom Fogal | 31351dc | 2010-12-05 17:58:32 -0700 | [diff] [blame] | 896 | dnl |
| 897 | dnl More DRI setup |
| 898 | dnl |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 899 | dnl Directory for DRI drivers |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 900 | AC_ARG_WITH([dri-driverdir], |
Dan Nicholson | af3d2f2 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 901 | [AS_HELP_STRING([--with-dri-driverdir=DIR], |
Dan Nicholson | 5dbbde5 | 2008-05-06 06:21:41 -0700 | [diff] [blame] | 902 | [directory for the DRI drivers @<:@${libdir}/dri@:>@])], |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 903 | [DRI_DRIVER_INSTALL_DIR="$withval"], |
Dan Nicholson | 5dbbde5 | 2008-05-06 06:21:41 -0700 | [diff] [blame] | 904 | [DRI_DRIVER_INSTALL_DIR='${libdir}/dri']) |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 905 | AC_SUBST([DRI_DRIVER_INSTALL_DIR]) |
Chow Loong Jin | 35506de | 2009-10-28 14:34:14 +0800 | [diff] [blame] | 906 | dnl Extra search path for DRI drivers |
| 907 | AC_ARG_WITH([dri-searchpath], |
| 908 | [AS_HELP_STRING([--with-dri-searchpath=DIRS...], |
| 909 | [semicolon delimited DRI driver search directories @<:@${libdir}/dri@:>@])], |
| 910 | [DRI_DRIVER_SEARCH_DIR="$withval"], |
| 911 | [DRI_DRIVER_SEARCH_DIR='${DRI_DRIVER_INSTALL_DIR}']) |
| 912 | AC_SUBST([DRI_DRIVER_SEARCH_DIR]) |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 913 | dnl Direct rendering or just indirect rendering |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 914 | AC_ARG_ENABLE([driglx-direct], |
Dan Nicholson | 79ad458 | 2007-12-07 19:11:01 -0800 | [diff] [blame] | 915 | [AS_HELP_STRING([--disable-driglx-direct], |
Chia-I Wu | cf588ab | 2010-07-06 14:34:43 +0800 | [diff] [blame] | 916 | [enable direct rendering in GLX and EGL for DRI @<:@default=enabled@:>@])], |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 917 | [driglx_direct="$enableval"], |
| 918 | [driglx_direct="yes"]) |
Dan Nicholson | af3d2f2 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 919 | dnl Which drivers to build - default is chosen by platform |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 920 | AC_ARG_WITH([dri-drivers], |
Dan Nicholson | af3d2f2 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 921 | [AS_HELP_STRING([--with-dri-drivers@<:@=DIRS...@:>@], |
Dan Nicholson | 5cae1b7 | 2008-06-30 10:28:02 -0700 | [diff] [blame] | 922 | [comma delimited DRI drivers list, e.g. |
Michel Dänzer | cade071 | 2009-07-10 14:49:46 +0200 | [diff] [blame] | 923 | "swrast,i965,radeon" @<:@default=auto@:>@])], |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 924 | [with_dri_drivers="$withval"], |
| 925 | [with_dri_drivers=yes]) |
Dan Nicholson | af3d2f2 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 926 | if test "x$with_dri_drivers" = x; then |
| 927 | with_dri_drivers=no |
| 928 | fi |
| 929 | |
| 930 | dnl If $with_dri_drivers is yes, directories will be added through |
| 931 | dnl platform checks |
| 932 | DRI_DIRS="" |
| 933 | case "$with_dri_drivers" in |
Florent Thoumie | b5095ab | 2008-07-28 14:44:43 +0100 | [diff] [blame] | 934 | no) ;; |
| 935 | yes) |
| 936 | DRI_DIRS="yes" |
| 937 | ;; |
Dan Nicholson | af3d2f2 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 938 | *) |
| 939 | # verify the requested driver directories exist |
Dan Nicholson | e6e4f25 | 2008-07-06 14:17:39 -0700 | [diff] [blame] | 940 | dri_drivers=`IFS=', '; echo $with_dri_drivers` |
Dan Nicholson | af3d2f2 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 941 | for driver in $dri_drivers; do |
| 942 | test -d "$srcdir/src/mesa/drivers/dri/$driver" || \ |
| 943 | AC_MSG_ERROR([DRI driver directory '$driver' doesn't exist]) |
| 944 | done |
| 945 | DRI_DIRS="$dri_drivers" |
| 946 | ;; |
| 947 | esac |
| 948 | |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 949 | dnl Set DRI_DIRS, DEFINES and LIB_DEPS |
Chia-I Wu | be5f34a | 2010-10-27 16:14:27 +0800 | [diff] [blame] | 950 | if test "$mesa_driver" = dri -o "$mesa_driver" = no; then |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 951 | # Platform specific settings and drivers to build |
| 952 | case "$host_os" in |
| 953 | linux*) |
| 954 | DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER" |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 955 | if test "x$driglx_direct" = xyes; then |
| 956 | DEFINES="$DEFINES -DGLX_DIRECT_RENDERING" |
| 957 | fi |
Jerome Glisse | 14f79d4 | 2008-12-18 13:36:07 +0100 | [diff] [blame] | 958 | DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS" |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 959 | |
| 960 | case "$host_cpu" in |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 961 | x86_64) |
Kristian Høgsberg | 79aeafd | 2010-02-25 16:12:58 -0500 | [diff] [blame] | 962 | # sis is missing because they have not be converted to use |
| 963 | # the new interface. i810 are missing because there is no |
| 964 | # x86-64 system where they could *ever* be used. |
Florent Thoumie | b5095ab | 2008-07-28 14:44:43 +0100 | [diff] [blame] | 965 | if test "x$DRI_DIRS" = "xyes"; then |
Alex Deucher | 4138bdb | 2009-04-08 15:16:35 -0400 | [diff] [blame] | 966 | DRI_DIRS="i915 i965 mach64 mga r128 r200 r300 r600 radeon \ |
George Sapountzis | 280bf89 | 2008-05-11 14:43:40 +0300 | [diff] [blame] | 967 | savage tdfx unichrome swrast" |
Dan Nicholson | af3d2f2 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 968 | fi |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 969 | ;; |
| 970 | powerpc*) |
Dan Nicholson | a76e245 | 2007-12-07 11:25:08 -0800 | [diff] [blame] | 971 | # Build only the drivers for cards that exist on PowerPC. |
| 972 | # At some point MGA will be added, but not yet. |
Florent Thoumie | b5095ab | 2008-07-28 14:44:43 +0100 | [diff] [blame] | 973 | if test "x$DRI_DIRS" = "xyes"; then |
Alex Deucher | 4138bdb | 2009-04-08 15:16:35 -0400 | [diff] [blame] | 974 | DRI_DIRS="mach64 r128 r200 r300 r600 radeon tdfx swrast" |
Dan Nicholson | af3d2f2 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 975 | fi |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 976 | ;; |
Dave Airlie | 2b0e75e | 2008-06-12 12:06:50 +1000 | [diff] [blame] | 977 | sparc*) |
| 978 | # Build only the drivers for cards that exist on sparc` |
Florent Thoumie | b5095ab | 2008-07-28 14:44:43 +0100 | [diff] [blame] | 979 | if test "x$DRI_DIRS" = "xyes"; then |
Kristian Høgsberg | 79aeafd | 2010-02-25 16:12:58 -0500 | [diff] [blame] | 980 | DRI_DIRS="mach64 r128 r200 r300 r600 radeon swrast" |
Dave Airlie | 2b0e75e | 2008-06-12 12:06:50 +1000 | [diff] [blame] | 981 | fi |
| 982 | ;; |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 983 | esac |
| 984 | ;; |
Pierre Allegraud | 8fd8de3 | 2011-01-06 07:58:57 -0700 | [diff] [blame] | 985 | freebsd* | dragonfly* | *netbsd*) |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 986 | DEFINES="$DEFINES -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1" |
| 987 | DEFINES="$DEFINES -DIN_DRI_DRIVER -DHAVE_ALIAS" |
| 988 | DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING" |
| 989 | if test "x$driglx_direct" = xyes; then |
| 990 | DEFINES="$DEFINES -DGLX_DIRECT_RENDERING" |
| 991 | fi |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 992 | |
Florent Thoumie | b5095ab | 2008-07-28 14:44:43 +0100 | [diff] [blame] | 993 | if test "x$DRI_DIRS" = "xyes"; then |
Alex Deucher | 4138bdb | 2009-04-08 15:16:35 -0400 | [diff] [blame] | 994 | DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 r600 radeon tdfx \ |
George Sapountzis | 280bf89 | 2008-05-11 14:43:40 +0300 | [diff] [blame] | 995 | unichrome savage sis swrast" |
Dan Nicholson | af3d2f2 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 996 | fi |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 997 | ;; |
Samuel Thibault | d18dd6a | 2009-04-23 05:43:22 -0700 | [diff] [blame] | 998 | gnu*) |
| 999 | DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER" |
| 1000 | DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS" |
| 1001 | ;; |
Alan Coopersmith | e1f9adc | 2008-06-20 17:58:53 -0700 | [diff] [blame] | 1002 | solaris*) |
| 1003 | DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER" |
| 1004 | DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING" |
| 1005 | if test "x$driglx_direct" = xyes; then |
| 1006 | DEFINES="$DEFINES -DGLX_DIRECT_RENDERING" |
| 1007 | fi |
| 1008 | ;; |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 1009 | esac |
Dan Nicholson | 112a40e | 2008-02-21 10:17:19 -0800 | [diff] [blame] | 1010 | |
| 1011 | # default drivers |
Florent Thoumie | b5095ab | 2008-07-28 14:44:43 +0100 | [diff] [blame] | 1012 | if test "x$DRI_DIRS" = "xyes"; then |
Corbin Simpson | 8e4657a | 2009-10-22 12:29:30 -0700 | [diff] [blame] | 1013 | DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 r600 radeon \ |
Kristian Høgsberg | 79aeafd | 2010-02-25 16:12:58 -0500 | [diff] [blame] | 1014 | savage sis tdfx unichrome swrast" |
Dan Nicholson | 112a40e | 2008-02-21 10:17:19 -0800 | [diff] [blame] | 1015 | fi |
| 1016 | |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 1017 | DRI_DIRS=`echo "$DRI_DIRS" | $SED 's/ */ /g'` |
| 1018 | |
| 1019 | # Check for expat |
Chia-I Wu | be5f34a | 2010-10-27 16:14:27 +0800 | [diff] [blame] | 1020 | if test "$mesa_driver" = dri; then |
| 1021 | EXPAT_INCLUDES="" |
| 1022 | EXPAT_LIB=-lexpat |
| 1023 | AC_ARG_WITH([expat], |
| 1024 | [AS_HELP_STRING([--with-expat=DIR], |
| 1025 | [expat install directory])],[ |
| 1026 | EXPAT_INCLUDES="-I$withval/include" |
| 1027 | CPPFLAGS="$CPPFLAGS $EXPAT_INCLUDES" |
| 1028 | LDFLAGS="$LDFLAGS -L$withval/$LIB_DIR" |
| 1029 | EXPAT_LIB="-L$withval/$LIB_DIR -lexpat" |
| 1030 | ]) |
| 1031 | AC_CHECK_HEADER([expat.h],[],[AC_MSG_ERROR([Expat required for DRI.])]) |
| 1032 | AC_CHECK_LIB([expat],[XML_ParserCreate],[], |
| 1033 | [AC_MSG_ERROR([Expat required for DRI.])]) |
| 1034 | fi |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 1035 | |
Christopher James Halse Rogers | d1e28b2 | 2011-02-03 11:19:32 +1100 | [diff] [blame] | 1036 | # put all the necessary libs together, including possibly libdricore |
| 1037 | DRI_LIB_DEPS="$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] | 1038 | fi |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 1039 | AC_SUBST([DRI_DIRS]) |
| 1040 | AC_SUBST([EXPAT_INCLUDES]) |
| 1041 | AC_SUBST([DRI_LIB_DEPS]) |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 1042 | |
Kristian Høgsberg | 8616cec | 2010-01-01 17:03:33 -0500 | [diff] [blame] | 1043 | case $DRI_DIRS in |
| 1044 | *i915*|*i965*) |
Tormod Volden | 903185b | 2011-01-25 13:25:18 -0800 | [diff] [blame] | 1045 | PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED]) |
Kristian Høgsberg | 8616cec | 2010-01-01 17:03:33 -0500 | [diff] [blame] | 1046 | ;; |
Kristian Høgsberg | 27fe7a7 | 2010-01-07 10:29:29 -0500 | [diff] [blame] | 1047 | esac |
Kristian Høgsberg | 8616cec | 2010-01-01 17:03:33 -0500 | [diff] [blame] | 1048 | |
Kristian Høgsberg | 27fe7a7 | 2010-01-07 10:29:29 -0500 | [diff] [blame] | 1049 | case $DRI_DIRS in |
Kristian Høgsberg | 8616cec | 2010-01-01 17:03:33 -0500 | [diff] [blame] | 1050 | *radeon*|*r200*|*r300*|*r600*) |
Marek Olšák | a1aec2e | 2010-09-26 17:52:58 +0200 | [diff] [blame] | 1051 | if test "x$HAVE_LIBDRM_RADEON" = xyes; then |
Kristian Høgsberg | 8616cec | 2010-01-01 17:03:33 -0500 | [diff] [blame] | 1052 | RADEON_CFLAGS="-DHAVE_LIBDRM_RADEON=1 $LIBDRM_RADEON_CFLAGS" |
| 1053 | RADEON_LDFLAGS=$LIBDRM_RADEON_LIBS |
| 1054 | fi |
| 1055 | ;; |
| 1056 | esac |
| 1057 | AC_SUBST([RADEON_CFLAGS]) |
| 1058 | AC_SUBST([RADEON_LDFLAGS]) |
| 1059 | |
| 1060 | |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 1061 | dnl |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 1062 | dnl OSMesa configuration |
| 1063 | dnl |
Dan Nicholson | a130718 | 2007-12-12 17:49:49 -0800 | [diff] [blame] | 1064 | if test "$mesa_driver" = xlib; then |
Dan Nicholson | 544ab20 | 2007-12-30 08:41:53 -0800 | [diff] [blame] | 1065 | default_gl_osmesa=yes |
Dan Nicholson | 979ff51 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 1066 | else |
Dan Nicholson | 544ab20 | 2007-12-30 08:41:53 -0800 | [diff] [blame] | 1067 | default_gl_osmesa=no |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 1068 | fi |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 1069 | AC_ARG_ENABLE([gl-osmesa], |
Dan Nicholson | 544ab20 | 2007-12-30 08:41:53 -0800 | [diff] [blame] | 1070 | [AS_HELP_STRING([--enable-gl-osmesa], |
Dan Nicholson | cbf30fc | 2010-06-16 09:23:17 -0700 | [diff] [blame] | 1071 | [enable OSMesa with libGL @<:@default=enabled for xlib driver@:>@])], |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 1072 | [gl_osmesa="$enableval"], |
| 1073 | [gl_osmesa="$default_gl_osmesa"]) |
Dan Nicholson | 544ab20 | 2007-12-30 08:41:53 -0800 | [diff] [blame] | 1074 | if test "x$gl_osmesa" = xyes; then |
Chia-I Wu | be5f34a | 2010-10-27 16:14:27 +0800 | [diff] [blame] | 1075 | if test "x$enable_opengl" = xno; then |
| 1076 | AC_MSG_ERROR([OpenGL is not available for OSMesa driver]) |
| 1077 | fi |
Dan Nicholson | 544ab20 | 2007-12-30 08:41:53 -0800 | [diff] [blame] | 1078 | if test "$mesa_driver" = osmesa; then |
| 1079 | AC_MSG_ERROR([libGL is not available for OSMesa driver]) |
Dan Nicholson | 979ff51 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 1080 | else |
Dan Nicholson | 544ab20 | 2007-12-30 08:41:53 -0800 | [diff] [blame] | 1081 | DRIVER_DIRS="$DRIVER_DIRS osmesa" |
Dan Nicholson | 979ff51 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 1082 | fi |
| 1083 | fi |
| 1084 | |
Dan Nicholson | 6689f9e | 2007-12-05 21:04:15 -0800 | [diff] [blame] | 1085 | dnl Configure the channel bits for OSMesa (libOSMesa, libOSMesa16, ...) |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 1086 | AC_ARG_WITH([osmesa-bits], |
Dan Nicholson | 6689f9e | 2007-12-05 21:04:15 -0800 | [diff] [blame] | 1087 | [AS_HELP_STRING([--with-osmesa-bits=BITS], |
| 1088 | [OSMesa channel bits and library name: 8, 16, 32 @<:@default=8@:>@])], |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 1089 | [osmesa_bits="$withval"], |
| 1090 | [osmesa_bits=8]) |
Dan Nicholson | 6689f9e | 2007-12-05 21:04:15 -0800 | [diff] [blame] | 1091 | if test "$mesa_driver" != osmesa && test "x$osmesa_bits" != x8; then |
| 1092 | AC_MSG_WARN([Ignoring OSMesa channel bits for non-OSMesa driver]) |
| 1093 | osmesa_bits=8 |
| 1094 | fi |
| 1095 | case "x$osmesa_bits" in |
| 1096 | x8) |
| 1097 | OSMESA_LIB=OSMesa |
| 1098 | ;; |
| 1099 | x16|x32) |
| 1100 | OSMESA_LIB="OSMesa$osmesa_bits" |
| 1101 | DEFINES="$DEFINES -DCHAN_BITS=$osmesa_bits -DDEFAULT_SOFTWARE_DEPTH_BITS=31" |
| 1102 | ;; |
| 1103 | *) |
| 1104 | AC_MSG_ERROR([OSMesa bits '$osmesa_bits' is not a valid option]) |
| 1105 | ;; |
| 1106 | esac |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 1107 | AC_SUBST([OSMESA_LIB]) |
Dan Nicholson | 6689f9e | 2007-12-05 21:04:15 -0800 | [diff] [blame] | 1108 | |
Dan Nicholson | cbf30fc | 2010-06-16 09:23:17 -0700 | [diff] [blame] | 1109 | case "$DRIVER_DIRS" in |
| 1110 | *osmesa*) |
Alan Coopersmith | e1f9adc | 2008-06-20 17:58:53 -0700 | [diff] [blame] | 1111 | # only link libraries with osmesa if shared |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 1112 | if test "$enable_static" = no; then |
Kenneth Graunke | d1d81205 | 2011-01-16 16:01:54 -0800 | [diff] [blame] | 1113 | OSMESA_LIB_DEPS="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS" |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 1114 | else |
| 1115 | OSMESA_LIB_DEPS="" |
| 1116 | fi |
Dan Nicholson | 979ff51 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 1117 | OSMESA_MESA_DEPS="" |
Kenneth Graunke | d1d81205 | 2011-01-16 16:01:54 -0800 | [diff] [blame] | 1118 | OSMESA_PC_LIB_PRIV="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS" |
Dan Nicholson | 979ff51 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 1119 | ;; |
Dan Nicholson | 979ff51 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 1120 | esac |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 1121 | AC_SUBST([OSMESA_LIB_DEPS]) |
| 1122 | AC_SUBST([OSMESA_MESA_DEPS]) |
Dan Nicholson | 8be02fc | 2008-12-14 09:35:29 -0800 | [diff] [blame] | 1123 | AC_SUBST([OSMESA_PC_REQ]) |
| 1124 | AC_SUBST([OSMESA_PC_LIB_PRIV]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 1125 | |
| 1126 | dnl |
Dan Nicholson | 53b3734 | 2009-02-25 17:45:34 -0800 | [diff] [blame] | 1127 | dnl EGL configuration |
| 1128 | dnl |
Dan Nicholson | 66f9786 | 2009-04-29 12:11:43 -0700 | [diff] [blame] | 1129 | AC_ARG_ENABLE([egl], |
| 1130 | [AS_HELP_STRING([--disable-egl], |
| 1131 | [disable EGL library @<:@default=enabled@:>@])], |
| 1132 | [enable_egl="$enableval"], |
| 1133 | [enable_egl=yes]) |
Chia-I Wu | be5f34a | 2010-10-27 16:14:27 +0800 | [diff] [blame] | 1134 | if test "x$enable_egl" = xno; then |
| 1135 | if test "x$mesa_driver" = xno; then |
| 1136 | AC_MSG_ERROR([cannot disable EGL when there is no mesa driver]) |
| 1137 | fi |
| 1138 | if test "x$enable_openvg" = xyes; then |
| 1139 | AC_MSG_ERROR([cannot enable OpenVG without EGL]) |
| 1140 | fi |
| 1141 | fi |
Dan Nicholson | 66f9786 | 2009-04-29 12:11:43 -0700 | [diff] [blame] | 1142 | if test "x$enable_egl" = xyes; then |
| 1143 | SRC_DIRS="$SRC_DIRS egl" |
Chia-I Wu | d4c1ee0 | 2009-12-21 11:13:18 +0800 | [diff] [blame] | 1144 | EGL_LIB_DEPS="$DLOPEN_LIBS -lpthread" |
| 1145 | EGL_DRIVERS_DIRS="" |
Chia-I Wu | 2eb7a2f | 2010-02-05 10:46:11 +0800 | [diff] [blame] | 1146 | if test "$enable_static" != yes; then |
Chia-I Wu | d4c1ee0 | 2009-12-21 11:13:18 +0800 | [diff] [blame] | 1147 | # build egl_glx when libGL is built |
Chia-I Wu | be5f34a | 2010-10-27 16:14:27 +0800 | [diff] [blame] | 1148 | if test "$mesa_driver" = xlib -o "$mesa_driver" = dri; then |
Chia-I Wu | 2eb7a2f | 2010-02-05 10:46:11 +0800 | [diff] [blame] | 1149 | EGL_DRIVERS_DIRS="glx" |
| 1150 | fi |
| 1151 | |
Chia-I Wu | 39ae965 | 2010-07-16 19:48:52 +0800 | [diff] [blame] | 1152 | if test "$mesa_driver" = dri; then |
| 1153 | # build egl_dri2 when xcb-dri2 is available |
| 1154 | PKG_CHECK_MODULES([XCB_DRI2], [x11-xcb xcb-dri2 xcb-xfixes], |
| 1155 | [have_xcb_dri2=yes],[have_xcb_dri2=no]) |
| 1156 | PKG_CHECK_MODULES([LIBUDEV], [libudev > 150], |
| 1157 | [have_libudev=yes],[have_libudev=no]) |
| 1158 | |
| 1159 | if test "$have_xcb_dri2" = yes; then |
| 1160 | EGL_DRIVER_DRI2=dri2 |
| 1161 | DEFINES="$DEFINES -DHAVE_XCB_DRI2" |
| 1162 | if test "$have_libudev" = yes; then |
| 1163 | DEFINES="$DEFINES -DHAVE_LIBUDEV" |
| 1164 | fi |
| 1165 | fi |
| 1166 | fi |
Kristian Høgsberg | 2168b87 | 2010-06-02 22:48:06 -0400 | [diff] [blame] | 1167 | |
| 1168 | EGL_DRIVERS_DIRS="$EGL_DRIVERS_DIRS $EGL_DRIVER_DRI2" |
Kristian Høgsberg | 42fa009 | 2010-02-03 10:18:28 -0500 | [diff] [blame] | 1169 | fi |
Dan Nicholson | 53b3734 | 2009-02-25 17:45:34 -0800 | [diff] [blame] | 1170 | fi |
Dan Nicholson | 53b3734 | 2009-02-25 17:45:34 -0800 | [diff] [blame] | 1171 | AC_SUBST([EGL_LIB_DEPS]) |
Chia-I Wu | d4c1ee0 | 2009-12-21 11:13:18 +0800 | [diff] [blame] | 1172 | AC_SUBST([EGL_DRIVERS_DIRS]) |
Dan Nicholson | 53b3734 | 2009-02-25 17:45:34 -0800 | [diff] [blame] | 1173 | |
| 1174 | dnl |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 1175 | dnl GLU configuration |
| 1176 | dnl |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 1177 | AC_ARG_ENABLE([glu], |
Dan Nicholson | 79ad458 | 2007-12-07 19:11:01 -0800 | [diff] [blame] | 1178 | [AS_HELP_STRING([--disable-glu], |
| 1179 | [enable OpenGL Utility library @<:@default=enabled@:>@])], |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 1180 | [enable_glu="$enableval"], |
| 1181 | [enable_glu=yes]) |
Chia-I Wu | be5f34a | 2010-10-27 16:14:27 +0800 | [diff] [blame] | 1182 | |
| 1183 | if test "x$enable_glu" = xyes -a "x$mesa_driver" = xno; then |
| 1184 | AC_MSG_NOTICE([Disabling GLU since there is no OpenGL driver]) |
| 1185 | enable_glu=no |
| 1186 | fi |
| 1187 | |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 1188 | if test "x$enable_glu" = xyes; then |
| 1189 | SRC_DIRS="$SRC_DIRS glu" |
| 1190 | |
Dan Nicholson | 979ff51 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 1191 | case "$mesa_driver" in |
| 1192 | osmesa) |
Dan Nicholson | 979ff51 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 1193 | # Link libGLU to libOSMesa instead of libGL |
| 1194 | GLU_LIB_DEPS="" |
Dan Nicholson | 8be02fc | 2008-12-14 09:35:29 -0800 | [diff] [blame] | 1195 | GLU_PC_REQ="osmesa" |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 1196 | if test "$enable_static" = no; then |
| 1197 | GLU_MESA_DEPS='-l$(OSMESA_LIB)' |
| 1198 | else |
| 1199 | GLU_MESA_DEPS="" |
| 1200 | fi |
Dan Nicholson | 979ff51 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 1201 | ;; |
| 1202 | *) |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 1203 | # If static, empty GLU_LIB_DEPS and add libs for programs to link |
Dan Nicholson | 71e208b | 2008-11-24 11:01:57 -0800 | [diff] [blame] | 1204 | GLU_PC_REQ="gl" |
| 1205 | GLU_PC_LIB_PRIV="-lm" |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 1206 | if test "$enable_static" = no; then |
| 1207 | GLU_LIB_DEPS="-lm" |
| 1208 | GLU_MESA_DEPS='-l$(GL_LIB)' |
| 1209 | else |
| 1210 | GLU_LIB_DEPS="" |
| 1211 | GLU_MESA_DEPS="" |
| 1212 | APP_LIB_DEPS="$APP_LIB_DEPS -lstdc++" |
| 1213 | fi |
Dan Nicholson | 979ff51 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 1214 | ;; |
| 1215 | esac |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 1216 | fi |
Alan Coopersmith | e1f9adc | 2008-06-20 17:58:53 -0700 | [diff] [blame] | 1217 | if test "$enable_static" = no; then |
| 1218 | GLU_LIB_DEPS="$GLU_LIB_DEPS $OS_CPLUSPLUS_LIBS" |
| 1219 | fi |
Dan Nicholson | 71e208b | 2008-11-24 11:01:57 -0800 | [diff] [blame] | 1220 | GLU_PC_LIB_PRIV="$GLU_PC_LIB_PRIV $OS_CPLUSPLUS_LIBS" |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 1221 | AC_SUBST([GLU_LIB_DEPS]) |
| 1222 | AC_SUBST([GLU_MESA_DEPS]) |
Dan Nicholson | 71e208b | 2008-11-24 11:01:57 -0800 | [diff] [blame] | 1223 | AC_SUBST([GLU_PC_REQ]) |
| 1224 | AC_SUBST([GLU_PC_REQ_PRIV]) |
Dan Nicholson | 71e208b | 2008-11-24 11:01:57 -0800 | [diff] [blame] | 1225 | AC_SUBST([GLU_PC_LIB_PRIV]) |
| 1226 | AC_SUBST([GLU_PC_CFLAGS]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 1227 | |
| 1228 | dnl |
| 1229 | dnl GLw configuration |
| 1230 | dnl |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 1231 | AC_ARG_ENABLE([glw], |
Dan Nicholson | 79ad458 | 2007-12-07 19:11:01 -0800 | [diff] [blame] | 1232 | [AS_HELP_STRING([--disable-glw], |
| 1233 | [enable Xt/Motif widget library @<:@default=enabled@:>@])], |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 1234 | [enable_glw="$enableval"], |
| 1235 | [enable_glw=yes]) |
Dan Nicholson | 979ff51 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 1236 | dnl Don't build GLw on osmesa |
Chia-I Wu | be5f34a | 2010-10-27 16:14:27 +0800 | [diff] [blame] | 1237 | if test "x$enable_glw" = xyes; then |
| 1238 | case "$mesa_driver" in |
| 1239 | osmesa|no) |
| 1240 | AC_MSG_NOTICE([Disabling GLw since there is no OpenGL driver]) |
| 1241 | enable_glw=no |
| 1242 | ;; |
| 1243 | esac |
Dan Nicholson | 979ff51 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 1244 | fi |
Dan Nicholson | 776c60d | 2008-07-18 07:40:41 -0700 | [diff] [blame] | 1245 | AC_ARG_ENABLE([motif], |
| 1246 | [AS_HELP_STRING([--enable-motif], |
| 1247 | [use Motif widgets in GLw @<:@default=disabled@:>@])], |
| 1248 | [enable_motif="$enableval"], |
| 1249 | [enable_motif=no]) |
| 1250 | |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 1251 | if test "x$enable_glw" = xyes; then |
| 1252 | SRC_DIRS="$SRC_DIRS glw" |
| 1253 | if test "$x11_pkgconfig" = yes; then |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 1254 | PKG_CHECK_MODULES([GLW],[x11 xt]) |
Dan Nicholson | 71e208b | 2008-11-24 11:01:57 -0800 | [diff] [blame] | 1255 | GLW_PC_REQ_PRIV="x11 xt" |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 1256 | GLW_LIB_DEPS="$GLW_LIBS" |
| 1257 | else |
| 1258 | # should check these... |
Dan Nicholson | 776c60d | 2008-07-18 07:40:41 -0700 | [diff] [blame] | 1259 | GLW_LIB_DEPS="$X_LIBS -lXt -lX11" |
Dan Nicholson | 71e208b | 2008-11-24 11:01:57 -0800 | [diff] [blame] | 1260 | GLW_PC_LIB_PRIV="$GLW_LIB_DEPS" |
| 1261 | GLW_PC_CFLAGS="$X11_INCLUDES" |
Dan Nicholson | 776c60d | 2008-07-18 07:40:41 -0700 | [diff] [blame] | 1262 | fi |
| 1263 | |
| 1264 | GLW_SOURCES="GLwDrawA.c" |
| 1265 | MOTIF_CFLAGS= |
| 1266 | if test "x$enable_motif" = xyes; then |
| 1267 | GLW_SOURCES="$GLW_SOURCES GLwMDrawA.c" |
| 1268 | AC_PATH_PROG([MOTIF_CONFIG], [motif-config], [no]) |
| 1269 | if test "x$MOTIF_CONFIG" != xno; then |
| 1270 | MOTIF_CFLAGS=`$MOTIF_CONFIG --cflags` |
| 1271 | MOTIF_LIBS=`$MOTIF_CONFIG --libs` |
| 1272 | else |
| 1273 | AC_CHECK_HEADER([Xm/PrimitiveP.h], [], |
| 1274 | [AC_MSG_ERROR([Can't locate Motif headers])]) |
| 1275 | AC_CHECK_LIB([Xm], [XmGetPixmap], [MOTIF_LIBS="-lXm"], |
| 1276 | [AC_MSG_ERROR([Can't locate Motif Xm library])]) |
| 1277 | fi |
| 1278 | # MOTIF_LIBS is prepended to GLW_LIB_DEPS since Xm needs Xt/X11 |
| 1279 | GLW_LIB_DEPS="$MOTIF_LIBS $GLW_LIB_DEPS" |
Dan Nicholson | 71e208b | 2008-11-24 11:01:57 -0800 | [diff] [blame] | 1280 | GLW_PC_LIB_PRIV="$MOTIF_LIBS $GLW_PC_LIB_PRIV" |
| 1281 | GLW_PC_CFLAGS="$MOTIF_CFLAGS $GLW_PC_CFLAGS" |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 1282 | fi |
| 1283 | |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 1284 | # If static, empty GLW_LIB_DEPS and add libs for programs to link |
Alan Coopersmith | 3cf6e62 | 2009-03-23 16:51:54 -0700 | [diff] [blame] | 1285 | GLW_PC_LIB_PRIV="$GLW_PC_LIB_PRIV" |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 1286 | if test "$enable_static" = no; then |
| 1287 | GLW_MESA_DEPS='-l$(GL_LIB)' |
Alan Coopersmith | 3cf6e62 | 2009-03-23 16:51:54 -0700 | [diff] [blame] | 1288 | GLW_LIB_DEPS="$GLW_LIB_DEPS" |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 1289 | else |
| 1290 | APP_LIB_DEPS="$APP_LIB_DEPS $GLW_LIB_DEPS" |
| 1291 | GLW_LIB_DEPS="" |
| 1292 | GLW_MESA_DEPS="" |
| 1293 | fi |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 1294 | fi |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 1295 | AC_SUBST([GLW_LIB_DEPS]) |
| 1296 | AC_SUBST([GLW_MESA_DEPS]) |
Dan Nicholson | 776c60d | 2008-07-18 07:40:41 -0700 | [diff] [blame] | 1297 | AC_SUBST([GLW_SOURCES]) |
| 1298 | AC_SUBST([MOTIF_CFLAGS]) |
Dan Nicholson | 71e208b | 2008-11-24 11:01:57 -0800 | [diff] [blame] | 1299 | AC_SUBST([GLW_PC_REQ_PRIV]) |
| 1300 | AC_SUBST([GLW_PC_LIB_PRIV]) |
| 1301 | AC_SUBST([GLW_PC_CFLAGS]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 1302 | |
| 1303 | dnl |
| 1304 | dnl GLUT configuration |
| 1305 | dnl |
| 1306 | if test -f "$srcdir/include/GL/glut.h"; then |
| 1307 | default_glut=yes |
| 1308 | else |
| 1309 | default_glut=no |
| 1310 | fi |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 1311 | AC_ARG_ENABLE([glut], |
Dan Nicholson | 79ad458 | 2007-12-07 19:11:01 -0800 | [diff] [blame] | 1312 | [AS_HELP_STRING([--disable-glut], |
| 1313 | [enable GLUT library @<:@default=enabled if source available@:>@])], |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 1314 | [enable_glut="$enableval"], |
| 1315 | [enable_glut="$default_glut"]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 1316 | |
Chia-I Wu | be5f34a | 2010-10-27 16:14:27 +0800 | [diff] [blame] | 1317 | dnl Don't build glut on osmesa |
| 1318 | if test "x$enable_glut" = xyes; then |
| 1319 | case "$mesa_driver" in |
| 1320 | osmesa|no) |
| 1321 | AC_MSG_NOTICE([Disabling glut since there is no OpenGL driver]) |
| 1322 | enable_glut=no |
| 1323 | ;; |
| 1324 | esac |
| 1325 | fi |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 1326 | dnl Can't build glut if GLU not available |
| 1327 | if test "x$enable_glu$enable_glut" = xnoyes; then |
| 1328 | AC_MSG_WARN([Disabling glut since GLU is disabled]) |
| 1329 | enable_glut=no |
| 1330 | fi |
Dan Nicholson | 979ff51 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 1331 | |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 1332 | if test "x$enable_glut" = xyes; then |
| 1333 | SRC_DIRS="$SRC_DIRS glut/glx" |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 1334 | if test "$x11_pkgconfig" = yes; then |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 1335 | PKG_CHECK_MODULES([GLUT],[x11 xmu xi]) |
Dan Nicholson | 71e208b | 2008-11-24 11:01:57 -0800 | [diff] [blame] | 1336 | GLUT_PC_REQ_PRIV="x11 xmu xi" |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 1337 | GLUT_LIB_DEPS="$GLUT_LIBS" |
| 1338 | else |
| 1339 | # should check these... |
Dan Nicholson | 70d0c83 | 2007-12-07 11:12:20 -0800 | [diff] [blame] | 1340 | GLUT_LIB_DEPS="$X_LIBS -lX11 -lXmu -lXi" |
Dan Nicholson | 71e208b | 2008-11-24 11:01:57 -0800 | [diff] [blame] | 1341 | GLUT_PC_LIB_PRIV="$GLUT_LIB_DEPS" |
| 1342 | GLUT_PC_CFLAGS="$X11_INCLUDES" |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 1343 | fi |
John Hein | 9617254 | 2010-07-01 12:53:28 -0700 | [diff] [blame] | 1344 | if test "x$GCC" = xyes; then |
| 1345 | GLUT_CFLAGS="$GLUT_CFLAGS -fexceptions" |
| 1346 | fi |
Alan Coopersmith | 3cf6e62 | 2009-03-23 16:51:54 -0700 | [diff] [blame] | 1347 | GLUT_LIB_DEPS="$GLUT_LIB_DEPS -lm" |
| 1348 | GLUT_PC_LIB_PRIV="$GLUT_PC_LIB_PRIV -lm" |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 1349 | |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 1350 | # If static, empty GLUT_LIB_DEPS and add libs for programs to link |
| 1351 | if test "$enable_static" = no; then |
| 1352 | GLUT_MESA_DEPS='-l$(GLU_LIB) -l$(GL_LIB)' |
| 1353 | else |
| 1354 | APP_LIB_DEPS="$APP_LIB_DEPS $GLUT_LIB_DEPS" |
| 1355 | GLUT_LIB_DEPS="" |
| 1356 | GLUT_MESA_DEPS="" |
| 1357 | fi |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 1358 | fi |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 1359 | AC_SUBST([GLUT_LIB_DEPS]) |
| 1360 | AC_SUBST([GLUT_MESA_DEPS]) |
| 1361 | AC_SUBST([GLUT_CFLAGS]) |
Dan Nicholson | 71e208b | 2008-11-24 11:01:57 -0800 | [diff] [blame] | 1362 | AC_SUBST([GLUT_PC_REQ_PRIV]) |
| 1363 | AC_SUBST([GLUT_PC_LIB_PRIV]) |
| 1364 | AC_SUBST([GLUT_PC_CFLAGS]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 1365 | |
| 1366 | dnl |
| 1367 | dnl Program library dependencies |
| 1368 | dnl Only libm is added here if necessary as the libraries should |
| 1369 | dnl be pulled in by the linker |
| 1370 | dnl |
| 1371 | if test "x$APP_LIB_DEPS" = x; then |
Alan Coopersmith | e1f9adc | 2008-06-20 17:58:53 -0700 | [diff] [blame] | 1372 | case "$host_os" in |
| 1373 | solaris*) |
| 1374 | APP_LIB_DEPS="-lX11 -lsocket -lnsl -lm" |
| 1375 | ;; |
Jon TURNEY | 7eed6ab | 2009-06-08 16:02:18 +0100 | [diff] [blame] | 1376 | cygwin*) |
| 1377 | APP_LIB_DEPS="-lX11" |
| 1378 | ;; |
Alan Coopersmith | e1f9adc | 2008-06-20 17:58:53 -0700 | [diff] [blame] | 1379 | *) |
| 1380 | APP_LIB_DEPS="-lm" |
| 1381 | ;; |
| 1382 | esac |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 1383 | fi |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 1384 | AC_SUBST([APP_LIB_DEPS]) |
| 1385 | AC_SUBST([PROGRAM_DIRS]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 1386 | |
Jakob Bornecrantz | 7e54d7d | 2009-02-11 02:38:21 +0100 | [diff] [blame] | 1387 | dnl |
| 1388 | dnl Gallium configuration |
| 1389 | dnl |
| 1390 | AC_ARG_ENABLE([gallium], |
| 1391 | [AS_HELP_STRING([--disable-gallium], |
| 1392 | [build gallium @<:@default=enabled@:>@])], |
| 1393 | [enable_gallium="$enableval"], |
| 1394 | [enable_gallium=yes]) |
Chia-I Wu | be5f34a | 2010-10-27 16:14:27 +0800 | [diff] [blame] | 1395 | if test "x$enable_gallium" = xno -a "x$enable_openvg" = xyes; then |
| 1396 | AC_MSG_ERROR([cannot enable OpenVG without Gallium]) |
| 1397 | fi |
Jakob Bornecrantz | 7e54d7d | 2009-02-11 02:38:21 +0100 | [diff] [blame] | 1398 | if test "x$enable_gallium" = xyes; then |
Jakob Bornecrantz | be38b32 | 2010-03-23 13:23:26 +0000 | [diff] [blame] | 1399 | SRC_DIRS="$SRC_DIRS gallium gallium/winsys gallium/targets" |
Dave Airlie | 81fe198 | 2010-04-22 14:59:29 +1000 | [diff] [blame] | 1400 | AC_CHECK_HEADER([udis86.h], [HAS_UDIS86="yes"], |
| 1401 | [HAS_UDIS86="no"]) |
| 1402 | AC_PATH_PROG([LLVM_CONFIG], [llvm-config], [no]) |
Jakob Bornecrantz | 7e54d7d | 2009-02-11 02:38:21 +0100 | [diff] [blame] | 1403 | fi |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 1404 | |
Dave Airlie | 81fe198 | 2010-04-22 14:59:29 +1000 | [diff] [blame] | 1405 | AC_SUBST([LLVM_CFLAGS]) |
| 1406 | AC_SUBST([LLVM_LIBS]) |
| 1407 | AC_SUBST([LLVM_LDFLAGS]) |
| 1408 | AC_SUBST([LLVM_VERSION]) |
| 1409 | |
Jakob Bornecrantz | 3ede377 | 2009-02-13 00:57:47 +0100 | [diff] [blame] | 1410 | dnl |
| 1411 | dnl Gallium state trackers configuration |
| 1412 | dnl |
Chia-I Wu | dbacbb8 | 2010-11-02 02:00:36 +0800 | [diff] [blame] | 1413 | |
| 1414 | AC_ARG_ENABLE([gallium-egl], |
| 1415 | [AS_HELP_STRING([--enable-gallium-egl], |
| 1416 | [enable gallium EGL state tracker @<:@default=auto@:>@])], |
| 1417 | [enable_gallium_egl="$enableval"], |
| 1418 | [enable_gallium_egl=auto]) |
| 1419 | if test "x$enable_gallium_egl" = xauto; then |
| 1420 | case "$mesa_driver" in |
| 1421 | dri|no) |
| 1422 | enable_gallium_egl=$enable_egl |
| 1423 | ;; |
| 1424 | *) |
Chia-I Wu | ada9c78 | 2011-01-04 01:05:22 +0800 | [diff] [blame] | 1425 | enable_gallium_egl=$enable_openvg |
Chia-I Wu | dbacbb8 | 2010-11-02 02:00:36 +0800 | [diff] [blame] | 1426 | ;; |
| 1427 | esac |
| 1428 | fi |
| 1429 | case "x$enable_egl$enable_gallium_egl" in |
| 1430 | xnoyes) |
| 1431 | AC_MSG_ERROR([cannot build Gallium EGL state tracker without EGL]) |
| 1432 | esac |
| 1433 | |
Jakob Bornecrantz | 3ede377 | 2009-02-13 00:57:47 +0100 | [diff] [blame] | 1434 | AC_ARG_WITH([state-trackers], |
| 1435 | [AS_HELP_STRING([--with-state-trackers@<:@=DIRS...@:>@], |
| 1436 | [comma delimited state_trackers list, e.g. |
| 1437 | "egl,glx" @<:@default=auto@:>@])], |
| 1438 | [with_state_trackers="$withval"], |
| 1439 | [with_state_trackers=yes]) |
| 1440 | |
| 1441 | case "$with_state_trackers" in |
| 1442 | no) |
| 1443 | GALLIUM_STATE_TRACKERS_DIRS="" |
| 1444 | ;; |
| 1445 | yes) |
| 1446 | # look at what else is built |
| 1447 | case "$mesa_driver" in |
Jakob Bornecrantz | 373e671 | 2009-04-18 23:13:56 +0100 | [diff] [blame] | 1448 | xlib) |
| 1449 | GALLIUM_STATE_TRACKERS_DIRS=glx |
| 1450 | ;; |
Jakob Bornecrantz | 3ede377 | 2009-02-13 00:57:47 +0100 | [diff] [blame] | 1451 | dri) |
Jakob Bornecrantz | 5b1fc14 | 2010-03-25 18:29:51 +0100 | [diff] [blame] | 1452 | GALLIUM_STATE_TRACKERS_DIRS="dri" |
Jakob Bornecrantz | a82e37b | 2010-03-25 22:21:39 +0100 | [diff] [blame] | 1453 | HAVE_ST_DRI="yes" |
Jakob Bornecrantz | bc0532b | 2009-12-04 18:50:29 +0000 | [diff] [blame] | 1454 | # Have only tested st/xorg on 1.6.0 servers |
Jakob Bornecrantz | 683a099 | 2010-03-11 19:23:15 +0000 | [diff] [blame] | 1455 | PKG_CHECK_MODULES(XORG, [xorg-server >= 1.6.0 libdrm >= $LIBDRM_XORG_REQUIRED libkms >= $LIBKMS_XORG_REQUIRED], |
Jakob Bornecrantz | a82e37b | 2010-03-25 22:21:39 +0100 | [diff] [blame] | 1456 | HAVE_ST_XORG="yes"; GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS xorg", |
| 1457 | HAVE_ST_XORG="no") |
Jakob Bornecrantz | 3ede377 | 2009-02-13 00:57:47 +0100 | [diff] [blame] | 1458 | ;; |
| 1459 | esac |
Chia-I Wu | be5f34a | 2010-10-27 16:14:27 +0800 | [diff] [blame] | 1460 | |
| 1461 | if test "x$enable_egl" = xyes; then |
| 1462 | if test "$enable_openvg" = yes; then |
| 1463 | GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS vega" |
| 1464 | st_egl="yes" |
| 1465 | fi |
| 1466 | |
Chia-I Wu | dbacbb8 | 2010-11-02 02:00:36 +0800 | [diff] [blame] | 1467 | if test "$enable_gallium_egl" = yes; then |
Chia-I Wu | be5f34a | 2010-10-27 16:14:27 +0800 | [diff] [blame] | 1468 | GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS egl" |
| 1469 | HAVE_ST_EGL="yes" |
| 1470 | fi |
| 1471 | fi |
Jakob Bornecrantz | 3ede377 | 2009-02-13 00:57:47 +0100 | [diff] [blame] | 1472 | ;; |
| 1473 | *) |
| 1474 | # verify the requested state tracker exist |
Chia-I Wu | 63ab250 | 2010-05-05 15:38:02 +0800 | [diff] [blame] | 1475 | state_trackers="" |
| 1476 | _state_trackers=`IFS=', '; echo $with_state_trackers` |
| 1477 | for tracker in $_state_trackers; do |
Chia-I Wu | e5d351d | 2009-12-23 11:18:00 +0800 | [diff] [blame] | 1478 | case "$tracker" in |
Jakob Bornecrantz | a82e37b | 2010-03-25 22:21:39 +0100 | [diff] [blame] | 1479 | dri) |
| 1480 | if test "x$mesa_driver" != xdri; then |
| 1481 | AC_MSG_ERROR([cannot build dri state tracker without mesa driver set to dri]) |
| 1482 | fi |
| 1483 | HAVE_ST_DRI="yes" |
| 1484 | ;; |
Chia-I Wu | 3c967a9 | 2010-01-22 16:31:43 +0800 | [diff] [blame] | 1485 | egl) |
Chia-I Wu | e5d351d | 2009-12-23 11:18:00 +0800 | [diff] [blame] | 1486 | if test "x$enable_egl" != xyes; then |
Chia-I Wu | 3c967a9 | 2010-01-22 16:31:43 +0800 | [diff] [blame] | 1487 | AC_MSG_ERROR([cannot build egl state tracker without EGL library]) |
Chia-I Wu | e5d351d | 2009-12-23 11:18:00 +0800 | [diff] [blame] | 1488 | fi |
Jakob Bornecrantz | a82e37b | 2010-03-25 22:21:39 +0100 | [diff] [blame] | 1489 | HAVE_ST_EGL="yes" |
Chia-I Wu | e5d351d | 2009-12-23 11:18:00 +0800 | [diff] [blame] | 1490 | ;; |
| 1491 | xorg) |
Jakob Bornecrantz | 4f95688 | 2010-07-13 07:40:47 -0700 | [diff] [blame] | 1492 | PKG_CHECK_MODULES([XORG], [xorg-server >= 1.6.0]) |
Jakob Bornecrantz | 683a099 | 2010-03-11 19:23:15 +0000 | [diff] [blame] | 1493 | PKG_CHECK_MODULES([LIBDRM_XORG], [libdrm >= $LIBDRM_XORG_REQUIRED]) |
| 1494 | PKG_CHECK_MODULES([LIBKMS_XORG], [libkms >= $LIBKMS_XORG_REQUIRED]) |
Jakob Bornecrantz | a82e37b | 2010-03-25 22:21:39 +0100 | [diff] [blame] | 1495 | HAVE_ST_XORG="yes" |
Chia-I Wu | e5d351d | 2009-12-23 11:18:00 +0800 | [diff] [blame] | 1496 | ;; |
Chia-I Wu | 156e955 | 2010-10-30 14:26:01 +0800 | [diff] [blame] | 1497 | vega) |
| 1498 | if test "x$enable_openvg" != xyes; then |
| 1499 | AC_MSG_ERROR([cannot build vega state tracker without --enable-openvg]) |
| 1500 | fi |
Chia-I Wu | c116a0e | 2011-01-20 14:19:13 +0800 | [diff] [blame] | 1501 | have_st_vega="yes" |
Chia-I Wu | 156e955 | 2010-10-30 14:26:01 +0800 | [diff] [blame] | 1502 | ;; |
Chia-I Wu | e5d351d | 2009-12-23 11:18:00 +0800 | [diff] [blame] | 1503 | esac |
Chia-I Wu | 63ab250 | 2010-05-05 15:38:02 +0800 | [diff] [blame] | 1504 | |
| 1505 | if test -n "$tracker"; then |
| 1506 | test -d "$srcdir/src/gallium/state_trackers/$tracker" || \ |
| 1507 | AC_MSG_ERROR([state tracker '$tracker' doesn't exist]) |
| 1508 | if test -n "$state_trackers"; then |
| 1509 | state_trackers="$state_trackers $tracker" |
| 1510 | else |
| 1511 | state_trackers="$tracker" |
| 1512 | fi |
| 1513 | fi |
Jakob Bornecrantz | 3ede377 | 2009-02-13 00:57:47 +0100 | [diff] [blame] | 1514 | done |
| 1515 | GALLIUM_STATE_TRACKERS_DIRS="$state_trackers" |
Chia-I Wu | c116a0e | 2011-01-20 14:19:13 +0800 | [diff] [blame] | 1516 | |
| 1517 | # append --enable-openvg/--enable-gallium-egl to --with-state-trackers |
| 1518 | if test "x$have_st_vega" != xyes -a "x$enable_openvg" = xyes; then |
| 1519 | AC_MSG_ERROR([--with-state-trackers specified but vega is missing]) |
| 1520 | fi |
| 1521 | if test "x$HAVE_ST_EGL" != xyes -a "x$enable_gallium_egl" = xyes; then |
| 1522 | AC_MSG_ERROR([--with-state-trackers specified but egl is missing]) |
| 1523 | fi |
Jakob Bornecrantz | 3ede377 | 2009-02-13 00:57:47 +0100 | [diff] [blame] | 1524 | ;; |
| 1525 | esac |
| 1526 | |
Chia-I Wu | be5f34a | 2010-10-27 16:14:27 +0800 | [diff] [blame] | 1527 | |
| 1528 | EGL_CLIENT_APIS="" |
| 1529 | VG_LIB_DEPS="" |
| 1530 | |
| 1531 | case "x$enable_opengl$enable_gles1$enable_gles2" in |
| 1532 | x*yes*) |
| 1533 | EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(GL_LIB)' |
| 1534 | ;; |
| 1535 | esac |
Chia-I Wu | be5f34a | 2010-10-27 16:14:27 +0800 | [diff] [blame] | 1536 | if test "x$enable_openvg" = xyes; then |
| 1537 | EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(VG_LIB)' |
| 1538 | VG_LIB_DEPS="$VG_LIB_DEPS -lpthread" |
| 1539 | fi |
| 1540 | |
Chia-I Wu | 874ccd5 | 2010-05-04 22:43:05 +0800 | [diff] [blame] | 1541 | AC_SUBST([VG_LIB_DEPS]) |
Chia-I Wu | 63ab250 | 2010-05-05 15:38:02 +0800 | [diff] [blame] | 1542 | AC_SUBST([EGL_CLIENT_APIS]) |
| 1543 | |
| 1544 | if test "x$HAVE_ST_EGL" = xyes; then |
Chia-I Wu | d8e0e11 | 2010-06-29 14:04:27 +0800 | [diff] [blame] | 1545 | GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS egl" |
Chia-I Wu | 63ab250 | 2010-05-05 15:38:02 +0800 | [diff] [blame] | 1546 | fi |
Chia-I Wu | 874ccd5 | 2010-05-04 22:43:05 +0800 | [diff] [blame] | 1547 | |
Jakob Bornecrantz | a82e37b | 2010-03-25 22:21:39 +0100 | [diff] [blame] | 1548 | if test "x$HAVE_ST_XORG" = xyes; then |
Jakob Bornecrantz | 683a099 | 2010-03-11 19:23:15 +0000 | [diff] [blame] | 1549 | PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1], |
| 1550 | HAVE_XEXTPROTO_71="yes"; DEFINES="$DEFINES -DHAVE_XEXTPROTO_71", |
| 1551 | HAVE_XEXTPROTO_71="no") |
| 1552 | fi |
| 1553 | |
Chia-I Wu | da39d5d | 2010-06-17 16:07:46 +0800 | [diff] [blame] | 1554 | AC_ARG_WITH([egl-platforms], |
| 1555 | [AS_HELP_STRING([--with-egl-platforms@<:@=DIRS...@:>@], |
| 1556 | [comma delimited native platforms libEGL supports, e.g. |
Chia-I Wu | e7424d7 | 2010-09-19 16:54:39 +0800 | [diff] [blame] | 1557 | "x11,drm" @<:@default=auto@:>@])], |
Chia-I Wu | da39d5d | 2010-06-17 16:07:46 +0800 | [diff] [blame] | 1558 | [with_egl_platforms="$withval"], |
| 1559 | [with_egl_platforms=yes]) |
Chia-I Wu | 49381d6 | 2010-01-11 01:23:01 +0800 | [diff] [blame] | 1560 | AC_ARG_WITH([egl-displays], |
| 1561 | [AS_HELP_STRING([--with-egl-displays@<:@=DIRS...@:>@], |
Chia-I Wu | da39d5d | 2010-06-17 16:07:46 +0800 | [diff] [blame] | 1562 | [DEPRECATED. Use --with-egl-platforms instead])], |
| 1563 | [with_egl_platforms="$withval"]) |
Chia-I Wu | 49381d6 | 2010-01-11 01:23:01 +0800 | [diff] [blame] | 1564 | |
Chia-I Wu | da39d5d | 2010-06-17 16:07:46 +0800 | [diff] [blame] | 1565 | EGL_PLATFORMS="" |
Benjamin Franzke | 214fc6e | 2011-02-04 12:24:08 +0100 | [diff] [blame] | 1566 | WAYLAND_EGL_LIB_DEPS="" |
| 1567 | |
Chia-I Wu | da39d5d | 2010-06-17 16:07:46 +0800 | [diff] [blame] | 1568 | case "$with_egl_platforms" in |
Chia-I Wu | 49381d6 | 2010-01-11 01:23:01 +0800 | [diff] [blame] | 1569 | yes) |
| 1570 | if test "x$enable_egl" = xyes && test "x$mesa_driver" != xosmesa; then |
Chia-I Wu | da39d5d | 2010-06-17 16:07:46 +0800 | [diff] [blame] | 1571 | EGL_PLATFORMS="x11" |
Chia-I Wu | 2a910b3 | 2010-09-19 17:31:34 +0800 | [diff] [blame] | 1572 | if test "$mesa_driver" = dri; then |
| 1573 | EGL_PLATFORMS="$EGL_PLATFORMS drm" |
| 1574 | fi |
Chia-I Wu | 49381d6 | 2010-01-11 01:23:01 +0800 | [diff] [blame] | 1575 | fi |
| 1576 | ;; |
| 1577 | *) |
| 1578 | if test "x$enable_egl" != xyes; then |
| 1579 | AC_MSG_ERROR([cannot build egl state tracker without EGL library]) |
| 1580 | fi |
| 1581 | # verify the requested driver directories exist |
Chia-I Wu | da39d5d | 2010-06-17 16:07:46 +0800 | [diff] [blame] | 1582 | egl_platforms=`IFS=', '; echo $with_egl_platforms` |
| 1583 | for plat in $egl_platforms; do |
| 1584 | test -d "$srcdir/src/gallium/state_trackers/egl/$plat" || \ |
Kristian Høgsberg | 1a8899d | 2011-02-10 10:45:06 -0500 | [diff] [blame] | 1585 | AC_MSG_ERROR([EGL platform '$plat' doesn't exist]) |
Chia-I Wu | da39d5d | 2010-06-17 16:07:46 +0800 | [diff] [blame] | 1586 | if test "$plat" = "fbdev"; then |
Chia-I Wu | 8f3e48e | 2010-06-17 14:10:53 +0800 | [diff] [blame] | 1587 | GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/fbdev" |
| 1588 | fi |
Benjamin Franzke | e586c4b | 2011-02-04 12:22:58 +0100 | [diff] [blame] | 1589 | if test "$plat" = "wayland"; then |
Benjamin Franzke | 6b369c4 | 2011-02-21 16:22:34 +0100 | [diff] [blame] | 1590 | PKG_CHECK_MODULES([WAYLAND], [wayland-client wayland-server],, \ |
Benjamin Franzke | e586c4b | 2011-02-04 12:22:58 +0100 | [diff] [blame] | 1591 | [AC_MSG_ERROR([cannot find libwayland-client])]) |
Benjamin Franzke | 214fc6e | 2011-02-04 12:24:08 +0100 | [diff] [blame] | 1592 | WAYLAND_EGL_LIB_DEPS="$WAYLAND_LIBS $LIBDRM_LIBS" |
Benjamin Franzke | e586c4b | 2011-02-04 12:22:58 +0100 | [diff] [blame] | 1593 | fi |
Chia-I Wu | 49381d6 | 2010-01-11 01:23:01 +0800 | [diff] [blame] | 1594 | done |
Chia-I Wu | da39d5d | 2010-06-17 16:07:46 +0800 | [diff] [blame] | 1595 | EGL_PLATFORMS="$egl_platforms" |
Chia-I Wu | 49381d6 | 2010-01-11 01:23:01 +0800 | [diff] [blame] | 1596 | ;; |
| 1597 | esac |
Chia-I Wu | da39d5d | 2010-06-17 16:07:46 +0800 | [diff] [blame] | 1598 | AC_SUBST([EGL_PLATFORMS]) |
Chia-I Wu | 49381d6 | 2010-01-11 01:23:01 +0800 | [diff] [blame] | 1599 | |
Benjamin Franzke | 214fc6e | 2011-02-04 12:24:08 +0100 | [diff] [blame] | 1600 | AC_SUBST([WAYLAND_EGL_LIB_DEPS]) |
| 1601 | WAYLAND_EGL_PC_REQ_PRIV="wayland-client libdrm" |
| 1602 | WAYLAND_EGL_PC_LIB_PRIV= |
| 1603 | WAYLAND_EGL_PC_CFLAGS= |
| 1604 | |
| 1605 | AC_SUBST([WAYLAND_EGL_PC_REQ_PRIV]) |
| 1606 | AC_SUBST([WAYLAND_EGL_PC_LIB_PRIV]) |
| 1607 | AC_SUBST([WAYLAND_EGL_PC_CFLAGS]) |
| 1608 | |
| 1609 | |
Chia-I Wu | 28c3e57 | 2010-01-23 20:18:43 +0800 | [diff] [blame] | 1610 | AC_ARG_WITH([egl-driver-dir], |
| 1611 | [AS_HELP_STRING([--with-egl-driver-dir=DIR], |
| 1612 | [directory for EGL drivers [[default=${libdir}/egl]]])], |
| 1613 | [EGL_DRIVER_INSTALL_DIR="$withval"], |
| 1614 | [EGL_DRIVER_INSTALL_DIR='${libdir}/egl']) |
| 1615 | AC_SUBST([EGL_DRIVER_INSTALL_DIR]) |
| 1616 | |
Joel Bosveld | 8acca48 | 2009-03-06 08:46:08 +0900 | [diff] [blame] | 1617 | AC_ARG_WITH([xorg-driver-dir], |
| 1618 | [AS_HELP_STRING([--with-xorg-driver-dir=DIR], |
| 1619 | [Default xorg driver directory[[default=${libdir}/xorg/modules/drivers]]])], |
| 1620 | [XORG_DRIVER_INSTALL_DIR="$withval"], |
| 1621 | [XORG_DRIVER_INSTALL_DIR="${libdir}/xorg/modules/drivers"]) |
| 1622 | AC_SUBST([XORG_DRIVER_INSTALL_DIR]) |
| 1623 | |
Tom Fogal | 7085dce | 2009-08-13 19:40:30 -0600 | [diff] [blame] | 1624 | AC_ARG_WITH([max-width], |
| 1625 | [AS_HELP_STRING([--with-max-width=N], |
| 1626 | [Maximum framebuffer width (4096)])], |
| 1627 | [DEFINES="${DEFINES} -DMAX_WIDTH=${withval}"; |
| 1628 | AS_IF([test "${withval}" -gt "4096"], |
| 1629 | [AC_MSG_WARN([Large framebuffer: see s_tritemp.h comments.])])] |
| 1630 | ) |
| 1631 | AC_ARG_WITH([max-height], |
| 1632 | [AS_HELP_STRING([--with-max-height=N], |
| 1633 | [Maximum framebuffer height (4096)])], |
| 1634 | [DEFINES="${DEFINES} -DMAX_HEIGHT=${withval}"; |
| 1635 | AS_IF([test "${withval}" -gt "4096"], |
| 1636 | [AC_MSG_WARN([Large framebuffer: see s_tritemp.h comments.])])] |
| 1637 | ) |
| 1638 | |
Jakob Bornecrantz | 3ede377 | 2009-02-13 00:57:47 +0100 | [diff] [blame] | 1639 | dnl |
Dave Airlie | 81fe198 | 2010-04-22 14:59:29 +1000 | [diff] [blame] | 1640 | dnl Gallium LLVM |
| 1641 | dnl |
| 1642 | AC_ARG_ENABLE([gallium-llvm], |
| 1643 | [AS_HELP_STRING([--enable-gallium-llvm], |
| 1644 | [build gallium LLVM support @<:@default=disabled@:>@])], |
| 1645 | [enable_gallium_llvm="$enableval"], |
| 1646 | [enable_gallium_llvm=auto]) |
| 1647 | if test "x$enable_gallium_llvm" = xyes; then |
Dave Airlie | 22e8ddc | 2010-04-25 07:48:48 +1000 | [diff] [blame] | 1648 | if test "x$LLVM_CONFIG" != xno; then |
| 1649 | LLVM_VERSION=`$LLVM_CONFIG --version` |
Brian Paul | 7da704e | 2010-12-08 06:44:42 -0700 | [diff] [blame] | 1650 | LLVM_CFLAGS=`$LLVM_CONFIG --cppflags` |
Dave Airlie | 22e8ddc | 2010-04-25 07:48:48 +1000 | [diff] [blame] | 1651 | LLVM_LIBS="`$LLVM_CONFIG --libs jit interpreter nativecodegen bitwriter` -lstdc++" |
| 1652 | |
| 1653 | if test "x$HAS_UDIS86" != xno; then |
| 1654 | LLVM_LIBS="$LLVM_LIBS -ludis86" |
| 1655 | DEFINES="$DEFINES -DHAVE_UDIS86" |
Dave Airlie | 81fe198 | 2010-04-22 14:59:29 +1000 | [diff] [blame] | 1656 | fi |
Dave Airlie | 22e8ddc | 2010-04-25 07:48:48 +1000 | [diff] [blame] | 1657 | LLVM_LDFLAGS=`$LLVM_CONFIG --ldflags` |
| 1658 | GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS llvmpipe" |
Chia-I Wu | 3ecb8c2 | 2010-05-11 12:36:49 +0800 | [diff] [blame] | 1659 | DEFINES="$DEFINES -DGALLIUM_LLVMPIPE -D__STDC_CONSTANT_MACROS" |
Dave Airlie | 22e8ddc | 2010-04-25 07:48:48 +1000 | [diff] [blame] | 1660 | MESA_LLVM=1 |
| 1661 | else |
Dave Airlie | 81fe198 | 2010-04-22 14:59:29 +1000 | [diff] [blame] | 1662 | MESA_LLVM=0 |
Dave Airlie | 22e8ddc | 2010-04-25 07:48:48 +1000 | [diff] [blame] | 1663 | fi |
| 1664 | else |
| 1665 | MESA_LLVM=0 |
Dave Airlie | 81fe198 | 2010-04-22 14:59:29 +1000 | [diff] [blame] | 1666 | fi |
| 1667 | |
| 1668 | dnl |
Jakob Bornecrantz | a82e37b | 2010-03-25 22:21:39 +0100 | [diff] [blame] | 1669 | dnl Gallium helper functions |
| 1670 | dnl |
| 1671 | gallium_check_st() { |
Chia-I Wu | d8e0e11 | 2010-06-29 14:04:27 +0800 | [diff] [blame] | 1672 | if test "x$HAVE_ST_DRI" = xyes || test "x$HAVE_ST_XORG" = xyes; then |
Jakob Bornecrantz | a82e37b | 2010-03-25 22:21:39 +0100 | [diff] [blame] | 1673 | GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS $1" |
| 1674 | fi |
| 1675 | if test "x$HAVE_ST_DRI" = xyes && test "x$2" != x; then |
| 1676 | GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $2" |
| 1677 | fi |
Chia-I Wu | d8e0e11 | 2010-06-29 14:04:27 +0800 | [diff] [blame] | 1678 | if test "x$HAVE_ST_XORG" = xyes && test "x$3" != x; then |
Jakob Bornecrantz | a82e37b | 2010-03-25 22:21:39 +0100 | [diff] [blame] | 1679 | GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $3" |
| 1680 | fi |
Jakob Bornecrantz | a82e37b | 2010-03-25 22:21:39 +0100 | [diff] [blame] | 1681 | } |
| 1682 | |
| 1683 | |
| 1684 | dnl |
Jakob Bornecrantz | 60769b2 | 2009-11-12 01:28:26 +0100 | [diff] [blame] | 1685 | dnl Gallium SVGA configuration |
| 1686 | dnl |
| 1687 | AC_ARG_ENABLE([gallium-svga], |
Jakob Bornecrantz | 5e6fff7 | 2009-07-19 09:22:31 +0200 | [diff] [blame] | 1688 | [AS_HELP_STRING([--enable-gallium-svga], |
| 1689 | [build gallium SVGA @<:@default=disabled@:>@])], |
Jakob Bornecrantz | 60769b2 | 2009-11-12 01:28:26 +0100 | [diff] [blame] | 1690 | [enable_gallium_svga="$enableval"], |
Jakob Bornecrantz | 5e6fff7 | 2009-07-19 09:22:31 +0200 | [diff] [blame] | 1691 | [enable_gallium_svga=auto]) |
Jakob Bornecrantz | 60769b2 | 2009-11-12 01:28:26 +0100 | [diff] [blame] | 1692 | if test "x$enable_gallium_svga" = xyes; then |
Xavier Chantry | ff0987a | 2010-03-26 11:02:03 +0100 | [diff] [blame] | 1693 | GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS svga" |
Chia-I Wu | d8e0e11 | 2010-06-29 14:04:27 +0800 | [diff] [blame] | 1694 | gallium_check_st "svga/drm" "dri-vmwgfx" "xorg-vmwgfx" |
Jakob Bornecrantz | 5e6fff7 | 2009-07-19 09:22:31 +0200 | [diff] [blame] | 1695 | elif test "x$enable_gallium_svga" = xauto; then |
| 1696 | GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS svga" |
Jakob Bornecrantz | 60769b2 | 2009-11-12 01:28:26 +0100 | [diff] [blame] | 1697 | fi |
| 1698 | |
| 1699 | dnl |
Jakob Bornecrantz | 7dce4f3 | 2010-06-11 13:00:16 +0200 | [diff] [blame] | 1700 | dnl Gallium i915 configuration |
Jakob Bornecrantz | 3ede377 | 2009-02-13 00:57:47 +0100 | [diff] [blame] | 1701 | dnl |
Jakob Bornecrantz | 7dce4f3 | 2010-06-11 13:00:16 +0200 | [diff] [blame] | 1702 | AC_ARG_ENABLE([gallium-i915], |
| 1703 | [AS_HELP_STRING([--enable-gallium-i915], |
| 1704 | [build gallium i915 @<:@default=disabled@:>@])], |
| 1705 | [enable_gallium_i915="$enableval"], |
| 1706 | [enable_gallium_i915=auto]) |
| 1707 | if test "x$enable_gallium_i915" = xyes; then |
Jakob Bornecrantz | 44bafca | 2010-04-17 15:17:33 +0100 | [diff] [blame] | 1708 | GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS i915/sw" |
Jakob Bornecrantz | 7dce4f3 | 2010-06-11 13:00:16 +0200 | [diff] [blame] | 1709 | GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915" |
Chia-I Wu | d8e0e11 | 2010-06-29 14:04:27 +0800 | [diff] [blame] | 1710 | gallium_check_st "i915/drm" "dri-i915" "xorg-i915" |
Jakob Bornecrantz | 7dce4f3 | 2010-06-11 13:00:16 +0200 | [diff] [blame] | 1711 | elif test "x$enable_gallium_i915" = xauto; then |
Jakob Bornecrantz | 44bafca | 2010-04-17 15:17:33 +0100 | [diff] [blame] | 1712 | GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS i915/sw" |
Jakob Bornecrantz | 7dce4f3 | 2010-06-11 13:00:16 +0200 | [diff] [blame] | 1713 | GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915" |
| 1714 | fi |
| 1715 | |
| 1716 | dnl |
| 1717 | dnl Gallium i965 configuration |
| 1718 | dnl |
| 1719 | AC_ARG_ENABLE([gallium-i965], |
| 1720 | [AS_HELP_STRING([--enable-gallium-i965], |
| 1721 | [build gallium i965 @<:@default=disabled@:>@])], |
| 1722 | [enable_gallium_i965="$enableval"], |
| 1723 | [enable_gallium_i965=auto]) |
| 1724 | if test "x$enable_gallium_i965" = xyes; then |
| 1725 | GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i965" |
Chia-I Wu | d8e0e11 | 2010-06-29 14:04:27 +0800 | [diff] [blame] | 1726 | gallium_check_st "i965/drm" "dri-i965" "xorg-i965" |
Jakob Bornecrantz | 7dce4f3 | 2010-06-11 13:00:16 +0200 | [diff] [blame] | 1727 | elif test "x$enable_gallium_i965" = xauto; then |
| 1728 | GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i965" |
Jakob Bornecrantz | 3ede377 | 2009-02-13 00:57:47 +0100 | [diff] [blame] | 1729 | fi |
| 1730 | |
| 1731 | dnl |
Marek Olšák | 85a45dc | 2010-09-23 21:50:43 +0200 | [diff] [blame] | 1732 | dnl Gallium Radeon r300g configuration |
Jakob Bornecrantz | 3ede377 | 2009-02-13 00:57:47 +0100 | [diff] [blame] | 1733 | dnl |
| 1734 | AC_ARG_ENABLE([gallium-radeon], |
| 1735 | [AS_HELP_STRING([--enable-gallium-radeon], |
| 1736 | [build gallium radeon @<:@default=disabled@:>@])], |
| 1737 | [enable_gallium_radeon="$enableval"], |
Jakob Bornecrantz | 877cadb | 2010-01-14 22:51:25 +0000 | [diff] [blame] | 1738 | [enable_gallium_radeon=auto]) |
Marek Olšák | 11eb422 | 2010-09-28 19:32:32 +0200 | [diff] [blame] | 1739 | if test "x$enable_gallium_radeon" = xauto; then |
Marek Olšák | 7da5105 | 2011-02-11 01:16:06 +0100 | [diff] [blame] | 1740 | GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300" |
| 1741 | gallium_check_st "radeon/drm" "dri-r300" |
Marek Olšák | 11eb422 | 2010-09-28 19:32:32 +0200 | [diff] [blame] | 1742 | fi |
| 1743 | if test "x$enable_gallium_radeon" = xyes; then |
Marek Olšák | 7da5105 | 2011-02-11 01:16:06 +0100 | [diff] [blame] | 1744 | GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300" |
| 1745 | gallium_check_st "radeon/drm" "dri-r300" "xorg-radeon" |
Jakob Bornecrantz | 3ede377 | 2009-02-13 00:57:47 +0100 | [diff] [blame] | 1746 | fi |
| 1747 | |
| 1748 | dnl |
Jakob Bornecrantz | aeee526 | 2010-05-13 20:29:18 +0100 | [diff] [blame] | 1749 | dnl Gallium Radeon r600g configuration |
| 1750 | dnl |
| 1751 | AC_ARG_ENABLE([gallium-r600], |
| 1752 | [AS_HELP_STRING([--enable-gallium-r600], |
| 1753 | [build gallium radeon @<:@default=disabled@:>@])], |
| 1754 | [enable_gallium_r600="$enableval"], |
| 1755 | [enable_gallium_r600=auto]) |
| 1756 | if test "x$enable_gallium_r600" = xyes; then |
Marek Olšák | 7da5105 | 2011-02-11 01:16:06 +0100 | [diff] [blame] | 1757 | GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r600" |
| 1758 | gallium_check_st "r600/drm" "dri-r600" |
Jakob Bornecrantz | aeee526 | 2010-05-13 20:29:18 +0100 | [diff] [blame] | 1759 | fi |
| 1760 | |
| 1761 | dnl |
Thierry Vignaud | 1402ea8 | 2009-09-14 11:48:51 -0600 | [diff] [blame] | 1762 | dnl Gallium Nouveau configuration |
Jakob Bornecrantz | 3ede377 | 2009-02-13 00:57:47 +0100 | [diff] [blame] | 1763 | dnl |
| 1764 | AC_ARG_ENABLE([gallium-nouveau], |
| 1765 | [AS_HELP_STRING([--enable-gallium-nouveau], |
| 1766 | [build gallium nouveau @<:@default=disabled@:>@])], |
| 1767 | [enable_gallium_nouveau="$enableval"], |
| 1768 | [enable_gallium_nouveau=no]) |
| 1769 | if test "x$enable_gallium_nouveau" = xyes; then |
Christoph Bumiller | 4c22475 | 2010-11-12 15:17:40 +0100 | [diff] [blame] | 1770 | GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS nouveau nvfx nv50 nvc0" |
Chia-I Wu | d8e0e11 | 2010-06-29 14:04:27 +0800 | [diff] [blame] | 1771 | gallium_check_st "nouveau/drm" "dri-nouveau" "xorg-nouveau" |
Jakob Bornecrantz | 3ede377 | 2009-02-13 00:57:47 +0100 | [diff] [blame] | 1772 | fi |
| 1773 | |
Chia-I Wu | a1306f4 | 2010-01-22 15:51:51 +0800 | [diff] [blame] | 1774 | dnl |
| 1775 | dnl Gallium swrast configuration |
| 1776 | dnl |
| 1777 | AC_ARG_ENABLE([gallium-swrast], |
| 1778 | [AS_HELP_STRING([--enable-gallium-swrast], |
Jakob Bornecrantz | f5ba2cd | 2010-03-24 10:58:45 +0100 | [diff] [blame] | 1779 | [build gallium swrast @<:@default=auto@:>@])], |
Chia-I Wu | a1306f4 | 2010-01-22 15:51:51 +0800 | [diff] [blame] | 1780 | [enable_gallium_swrast="$enableval"], |
| 1781 | [enable_gallium_swrast=auto]) |
George Sapountzis | 7b33329 | 2010-03-25 17:01:54 +0200 | [diff] [blame] | 1782 | if test "x$enable_gallium_swrast" = xyes || test "x$enable_gallium_swrast" = xauto; then |
Jakob Bornecrantz | 5b1fc14 | 2010-03-25 18:29:51 +0100 | [diff] [blame] | 1783 | if test "x$HAVE_ST_DRI" = xyes; then |
George Sapountzis | 7b33329 | 2010-03-25 17:01:54 +0200 | [diff] [blame] | 1784 | GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS dri-swrast" |
Jakob Bornecrantz | f5ba2cd | 2010-03-24 10:58:45 +0100 | [diff] [blame] | 1785 | fi |
Chia-I Wu | a1306f4 | 2010-01-22 15:51:51 +0800 | [diff] [blame] | 1786 | fi |
| 1787 | |
Chia-I Wu | 99a37ed | 2010-01-05 17:39:05 +0800 | [diff] [blame] | 1788 | dnl prepend CORE_DIRS to SRC_DIRS |
| 1789 | SRC_DIRS="$CORE_DIRS $SRC_DIRS" |
Jakob Bornecrantz | 3ede377 | 2009-02-13 00:57:47 +0100 | [diff] [blame] | 1790 | |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 1791 | dnl Restore LDFLAGS and CPPFLAGS |
| 1792 | LDFLAGS="$_SAVE_LDFLAGS" |
| 1793 | CPPFLAGS="$_SAVE_CPPFLAGS" |
| 1794 | |
| 1795 | dnl Substitute the config |
Dan Nicholson | f64d6fe | 2007-12-12 17:57:45 -0800 | [diff] [blame] | 1796 | AC_CONFIG_FILES([configs/autoconf]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 1797 | |
Dan Nicholson | aab38cf | 2007-12-11 08:21:51 -0800 | [diff] [blame] | 1798 | dnl Replace the configs/current symlink |
Dan Nicholson | e14ebbc | 2008-05-06 11:28:43 -0700 | [diff] [blame] | 1799 | AC_CONFIG_COMMANDS([configs],[ |
Dan Nicholson | aab38cf | 2007-12-11 08:21:51 -0800 | [diff] [blame] | 1800 | if test -f configs/current || test -L configs/current; then |
| 1801 | rm -f configs/current |
| 1802 | fi |
| 1803 | ln -s autoconf configs/current |
Dan Nicholson | e14ebbc | 2008-05-06 11:28:43 -0700 | [diff] [blame] | 1804 | ]) |
| 1805 | |
| 1806 | AC_OUTPUT |
Dan Nicholson | aab38cf | 2007-12-11 08:21:51 -0800 | [diff] [blame] | 1807 | |
Dan Nicholson | 9cad8e3 | 2007-11-30 08:49:57 -0800 | [diff] [blame] | 1808 | dnl |
| 1809 | dnl Output some configuration info for the user |
| 1810 | dnl |
| 1811 | echo "" |
| 1812 | echo " prefix: $prefix" |
| 1813 | echo " exec_prefix: $exec_prefix" |
| 1814 | echo " libdir: $libdir" |
Dan Nicholson | 11ac5b2 | 2008-07-03 09:17:44 -0700 | [diff] [blame] | 1815 | echo " includedir: $includedir" |
Dan Nicholson | 9cad8e3 | 2007-11-30 08:49:57 -0800 | [diff] [blame] | 1816 | |
Chia-I Wu | 815faa4 | 2010-10-29 12:34:44 +0800 | [diff] [blame] | 1817 | dnl API info |
| 1818 | echo "" |
| 1819 | echo " OpenGL: $enable_opengl (ES1: $enable_gles1 ES2: $enable_gles2)" |
Chia-I Wu | 815faa4 | 2010-10-29 12:34:44 +0800 | [diff] [blame] | 1820 | echo " OpenVG: $enable_openvg" |
| 1821 | |
Dan Nicholson | 9cad8e3 | 2007-11-30 08:49:57 -0800 | [diff] [blame] | 1822 | dnl Driver info |
| 1823 | echo "" |
| 1824 | echo " Driver: $mesa_driver" |
Chia-I Wu | 815faa4 | 2010-10-29 12:34:44 +0800 | [diff] [blame] | 1825 | if test "$mesa_driver" != no; then |
| 1826 | if echo "$DRIVER_DIRS" | grep 'osmesa' >/dev/null 2>&1; then |
| 1827 | echo " OSMesa: lib$OSMESA_LIB" |
| 1828 | else |
| 1829 | echo " OSMesa: no" |
| 1830 | fi |
| 1831 | if test "$mesa_driver" = dri; then |
| 1832 | # cleanup the drivers var |
| 1833 | dri_dirs=`echo $DRI_DIRS | $SED 's/^ *//;s/ */ /;s/ *$//'` |
| 1834 | if test "x$DRI_DIRS" = x; then |
| 1835 | echo " DRI drivers: no" |
| 1836 | else |
| 1837 | echo " DRI drivers: $dri_dirs" |
| 1838 | fi |
| 1839 | echo " DRI driver dir: $DRI_DRIVER_INSTALL_DIR" |
| 1840 | echo " Use XCB: $enable_xcb" |
Christopher James Halse Rogers | d1e28b2 | 2011-02-03 11:19:32 +1100 | [diff] [blame] | 1841 | echo " Shared dricore: $enable_dricore" |
Chia-I Wu | 815faa4 | 2010-10-29 12:34:44 +0800 | [diff] [blame] | 1842 | fi |
Dan Nicholson | 544ab20 | 2007-12-30 08:41:53 -0800 | [diff] [blame] | 1843 | fi |
Chia-I Wu | 815faa4 | 2010-10-29 12:34:44 +0800 | [diff] [blame] | 1844 | echo "" |
| 1845 | echo " GLU: $enable_glu" |
| 1846 | echo " GLw: $enable_glw (Motif: $enable_motif)" |
| 1847 | echo " glut: $enable_glut" |
| 1848 | |
| 1849 | dnl EGL |
| 1850 | echo "" |
| 1851 | echo " EGL: $enable_egl" |
| 1852 | if test "$enable_egl" = yes; then |
| 1853 | echo " EGL platforms: $EGL_PLATFORMS" |
Chia-I Wu | 1230050 | 2010-10-31 21:01:54 +0800 | [diff] [blame] | 1854 | |
| 1855 | egl_drivers="" |
| 1856 | for d in $EGL_DRIVERS_DIRS; do |
Chia-I Wu | c98ea26 | 2011-01-07 16:30:08 +0800 | [diff] [blame] | 1857 | egl_drivers="$egl_drivers builtin:egl_$d" |
Chia-I Wu | 1230050 | 2010-10-31 21:01:54 +0800 | [diff] [blame] | 1858 | done |
| 1859 | |
Chia-I Wu | 815faa4 | 2010-10-29 12:34:44 +0800 | [diff] [blame] | 1860 | if test "$enable_gallium" = yes -a "$HAVE_ST_EGL" = yes; then |
Chia-I Wu | 1230050 | 2010-10-31 21:01:54 +0800 | [diff] [blame] | 1861 | echo " EGL drivers: ${egl_drivers} egl_gallium" |
| 1862 | echo " EGL Gallium STs:$EGL_CLIENT_APIS" |
Chia-I Wu | 815faa4 | 2010-10-29 12:34:44 +0800 | [diff] [blame] | 1863 | else |
Chia-I Wu | 1230050 | 2010-10-31 21:01:54 +0800 | [diff] [blame] | 1864 | echo " EGL drivers: $egl_drivers" |
Chia-I Wu | 815faa4 | 2010-10-29 12:34:44 +0800 | [diff] [blame] | 1865 | fi |
Florent Thoumie | b5095ab | 2008-07-28 14:44:43 +0100 | [diff] [blame] | 1866 | fi |
Dan Nicholson | 9cad8e3 | 2007-11-30 08:49:57 -0800 | [diff] [blame] | 1867 | |
Jakob Bornecrantz | 7e54d7d | 2009-02-11 02:38:21 +0100 | [diff] [blame] | 1868 | echo "" |
Eric Anholt | 1a8b127 | 2010-05-21 12:17:24 -0700 | [diff] [blame] | 1869 | if test "x$MESA_LLVM" = x1; then |
Jakob Bornecrantz | fe0fe67 | 2010-04-28 13:38:58 +0100 | [diff] [blame] | 1870 | echo " llvm: yes" |
| 1871 | echo " llvm-config: $LLVM_CONFIG" |
| 1872 | echo " llvm-version: $LLVM_VERSION" |
| 1873 | else |
| 1874 | echo " llvm: no" |
| 1875 | fi |
| 1876 | |
| 1877 | echo "" |
Jakob Bornecrantz | 7e54d7d | 2009-02-11 02:38:21 +0100 | [diff] [blame] | 1878 | if echo "$SRC_DIRS" | grep 'gallium' >/dev/null 2>&1; then |
| 1879 | echo " Gallium: yes" |
| 1880 | echo " Gallium dirs: $GALLIUM_DIRS" |
Keith Whitwell | 51bff09 | 2010-03-11 14:43:00 +0000 | [diff] [blame] | 1881 | echo " Target dirs: $GALLIUM_TARGET_DIRS" |
Jakob Bornecrantz | 7e54d7d | 2009-02-11 02:38:21 +0100 | [diff] [blame] | 1882 | echo " Winsys dirs: $GALLIUM_WINSYS_DIRS" |
Jakob Bornecrantz | d67bd60 | 2009-02-20 11:03:18 +0000 | [diff] [blame] | 1883 | echo " Driver dirs: $GALLIUM_DRIVERS_DIRS" |
Jakob Bornecrantz | 7e54d7d | 2009-02-11 02:38:21 +0100 | [diff] [blame] | 1884 | echo " Trackers dirs: $GALLIUM_STATE_TRACKERS_DIRS" |
| 1885 | else |
| 1886 | echo " Gallium: no" |
| 1887 | fi |
| 1888 | |
Dan Nicholson | 9cad8e3 | 2007-11-30 08:49:57 -0800 | [diff] [blame] | 1889 | dnl Libraries |
| 1890 | echo "" |
| 1891 | echo " Shared libs: $enable_shared" |
| 1892 | echo " Static libs: $enable_static" |
Dan Nicholson | 9cad8e3 | 2007-11-30 08:49:57 -0800 | [diff] [blame] | 1893 | |
Dan Nicholson | 16a07fb | 2007-12-12 09:12:15 -0800 | [diff] [blame] | 1894 | dnl Compiler options |
| 1895 | # cleanup the CFLAGS/CXXFLAGS/DEFINES vars |
| 1896 | cflags=`echo $CFLAGS $OPT_FLAGS $PIC_FLAGS $ARCH_FLAGS | \ |
| 1897 | $SED 's/^ *//;s/ */ /;s/ *$//'` |
| 1898 | cxxflags=`echo $CXXFLAGS $OPT_FLAGS $PIC_FLAGS $ARCH_FLAGS | \ |
| 1899 | $SED 's/^ *//;s/ */ /;s/ *$//'` |
| 1900 | defines=`echo $DEFINES $ASM_FLAGS | $SED 's/^ *//;s/ */ /;s/ *$//'` |
| 1901 | echo "" |
| 1902 | echo " CFLAGS: $cflags" |
| 1903 | echo " CXXFLAGS: $cxxflags" |
| 1904 | echo " Macros: $defines" |
Kenneth Graunke | 3acc826 | 2010-10-25 13:52:58 -0700 | [diff] [blame] | 1905 | echo "" |
| 1906 | echo " PYTHON2: $PYTHON2" |
Dan Nicholson | 16a07fb | 2007-12-12 09:12:15 -0800 | [diff] [blame] | 1907 | |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 1908 | echo "" |
Dan Nicholson | b645942 | 2008-03-24 10:01:50 -0700 | [diff] [blame] | 1909 | echo " Run '${MAKE-make}' to build Mesa" |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 1910 | echo "" |