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], |
| 7 | [m4_esyscmd([${MAKE-make} -s -f bin/version.mk version | tr -d '\n'])]) |
| 8 | m4_ifval(mesa_version,[],[ |
| 9 | m4_errprint([Error: Failed to get the Mesa version from the output of |
| 10 | running `make -f bin/version.mk version' |
| 11 | ]) |
| 12 | m4_exit([1]) |
| 13 | ]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 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 |
| 21 | LIBDRM_REQUIRED=2.3.1 |
| 22 | DRI2PROTO_REQUIRED=1.1 |
| 23 | |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 24 | dnl Check for progs |
| 25 | AC_PROG_CPP |
| 26 | AC_PROG_CC |
| 27 | AC_PROG_CXX |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 28 | AC_CHECK_PROGS([MAKE], [gmake make]) |
| 29 | AC_PATH_PROG([MKDEP], [makedepend]) |
| 30 | AC_PATH_PROG([SED], [sed]) |
Dan Nicholson | 41b0070 | 2007-12-12 08:48:30 -0800 | [diff] [blame] | 31 | |
Dan Nicholson | db7fc63 | 2008-03-07 11:48:09 -0800 | [diff] [blame] | 32 | MKDEP_OPTIONS=-fdepend |
Kristian Høgsberg | bcecea6 | 2008-02-25 18:50:26 -0500 | [diff] [blame] | 33 | dnl Ask gcc where it's keeping its secret headers |
| 34 | if test "x$GCC" = xyes; then |
Dan Nicholson | db7fc63 | 2008-03-07 11:48:09 -0800 | [diff] [blame] | 35 | GCC_INCLUDES=`$CC -print-file-name=include` |
| 36 | if test "x$GCC_INCLUDES" != x; then |
| 37 | MKDEP_OPTIONS="$MKDEP_OPTIONS -I$GCC_INCLUDES" |
| 38 | fi |
Kristian Høgsberg | bcecea6 | 2008-02-25 18:50:26 -0500 | [diff] [blame] | 39 | fi |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 40 | AC_SUBST([MKDEP_OPTIONS]) |
Kristian Høgsberg | bcecea6 | 2008-02-25 18:50:26 -0500 | [diff] [blame] | 41 | |
Dan Nicholson | 41b0070 | 2007-12-12 08:48:30 -0800 | [diff] [blame] | 42 | dnl Make sure the pkg-config macros are defined |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 43 | m4_ifdef([PKG_PROG_PKG_CONFIG],[],[ |
Dan Nicholson | 7154d66 | 2008-04-30 13:53:37 -0700 | [diff] [blame] | 44 | m4_errprint([Error: Could not locate the pkg-config autoconf macros. |
| 45 | These are usually located in /usr/share/aclocal/pkg.m4. If your |
| 46 | macros are in a different location, try setting the environment |
| 47 | variable ACLOCAL="aclocal -I/other/macro/dir" before running |
| 48 | autoreconf. |
| 49 | ]) |
| 50 | m4_exit([1]) |
| 51 | ]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 52 | PKG_PROG_PKG_CONFIG() |
| 53 | |
| 54 | dnl LIB_DIR - library basename |
| 55 | LIB_DIR=`echo $libdir | $SED 's%.*/%%'` |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 56 | AC_SUBST([LIB_DIR]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 57 | |
| 58 | dnl Cache LDFLAGS so we can add EXTRA_LIB_PATH and restore it later |
| 59 | _SAVE_LDFLAGS="$LDFLAGS" |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 60 | AC_ARG_VAR([EXTRA_LIB_PATH],[Extra -L paths for the linker]) |
| 61 | AC_SUBST([EXTRA_LIB_PATH]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 62 | |
| 63 | dnl Cache CPPFLAGS so we can add *_INCLUDES and restore it later |
| 64 | _SAVE_CPPFLAGS="$CPPFLAGS" |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 65 | AC_ARG_VAR([X11_INCLUDES],[Extra -I paths for X11 headers]) |
| 66 | AC_SUBST([X11_INCLUDES]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 67 | |
| 68 | dnl Compiler macros |
| 69 | DEFINES="" |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 70 | AC_SUBST([DEFINES]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 71 | case "$host_os" in |
| 72 | linux*) |
Eric Anholt | 5ad0615 | 2008-03-20 17:14:20 -0700 | [diff] [blame] | 73 | if test "x$GCC" = xyes; then |
| 74 | DEFINES="$DEFINES -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_BSD_SOURCE" |
| 75 | fi |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 76 | DEFINES="$DEFINES -D_SVID_SOURCE -D_GNU_SOURCE -DPTHREADS -DHAVE_POSIX_MEMALIGN" |
| 77 | ;; |
| 78 | esac |
| 79 | |
| 80 | dnl Add flags for gcc and g++ |
| 81 | if test "x$GCC" = xyes; then |
| 82 | CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -std=c99 -ffast-math" |
Dan Nicholson | 0c275b6 | 2008-01-15 22:52:25 -0800 | [diff] [blame] | 83 | |
| 84 | # Work around aliasing bugs - developers should comment this out |
| 85 | CFLAGS="$CFLAGS -fno-strict-aliasing" |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 86 | fi |
| 87 | if test "x$GXX" = xyes; then |
| 88 | CXXFLAGS="$CXXFLAGS -Wall" |
Dan Nicholson | 0c275b6 | 2008-01-15 22:52:25 -0800 | [diff] [blame] | 89 | |
| 90 | # Work around aliasing bugs - developers should comment this out |
| 91 | CXXFLAGS="$CXXFLAGS -fno-strict-aliasing" |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 92 | fi |
| 93 | |
| 94 | 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] | 95 | AC_ARG_VAR([OPT_FLAGS], [Additional optimization flags for the compiler. |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 96 | Default is to use CFLAGS.]) |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 97 | AC_ARG_VAR([ARCH_FLAGS], [Additional architecture specific flags for the |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 98 | compiler. Default is to use CFLAGS.]) |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 99 | AC_SUBST([OPT_FLAGS]) |
| 100 | AC_SUBST([ARCH_FLAGS]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 101 | |
| 102 | dnl |
Dan Nicholson | ab57cba | 2007-12-26 11:12:29 -0600 | [diff] [blame] | 103 | dnl Hacks to enable 32 or 64 bit build |
| 104 | dnl |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 105 | AC_ARG_ENABLE([32-bit], |
Dan Nicholson | ab57cba | 2007-12-26 11:12:29 -0600 | [diff] [blame] | 106 | [AS_HELP_STRING([--enable-32-bit], |
| 107 | [build 32-bit libraries @<:@default=auto@:>@])], |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 108 | [enable_32bit="$enableval"], |
| 109 | [enable_32bit=auto] |
Dan Nicholson | ab57cba | 2007-12-26 11:12:29 -0600 | [diff] [blame] | 110 | ) |
| 111 | if test "x$enable_32bit" = xyes; then |
| 112 | if test "x$GCC" = xyes; then |
| 113 | CFLAGS="$CFLAGS -m32" |
| 114 | fi |
| 115 | if test "x$GXX" = xyes; then |
| 116 | CXXFLAGS="$CXXFLAGS -m32" |
| 117 | fi |
| 118 | fi |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 119 | AC_ARG_ENABLE([64-bit], |
Dan Nicholson | ab57cba | 2007-12-26 11:12:29 -0600 | [diff] [blame] | 120 | [AS_HELP_STRING([--enable-64-bit], |
| 121 | [build 64-bit libraries @<:@default=auto@:>@])], |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 122 | [enable_64bit="$enableval"], |
| 123 | [enable_64bit=auto] |
Dan Nicholson | ab57cba | 2007-12-26 11:12:29 -0600 | [diff] [blame] | 124 | ) |
| 125 | if test "x$enable_64bit" = xyes; then |
| 126 | if test "x$GCC" = xyes; then |
| 127 | CFLAGS="$CFLAGS -m64" |
| 128 | fi |
| 129 | if test "x$GXX" = xyes; then |
| 130 | CXXFLAGS="$CXXFLAGS -m64" |
| 131 | fi |
| 132 | fi |
| 133 | |
| 134 | dnl |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 135 | dnl shared/static libraries, mimic libtool options |
| 136 | dnl |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 137 | AC_ARG_ENABLE([static], |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 138 | [AS_HELP_STRING([--enable-static], |
Dan Nicholson | 79ad458 | 2007-12-07 19:11:01 -0800 | [diff] [blame] | 139 | [build static libraries @<:@default=disabled@:>@])], |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 140 | [enable_static="$enableval"], |
| 141 | [enable_static=no] |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 142 | ) |
| 143 | case "x$enable_static" in |
| 144 | xyes|xno ) ;; |
| 145 | x ) enable_static=no ;; |
| 146 | * ) |
| 147 | AC_MSG_ERROR([Static library option '$enable_static' is not a valid]) |
| 148 | ;; |
| 149 | esac |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 150 | AC_ARG_ENABLE([shared], |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 151 | [AS_HELP_STRING([--disable-shared], |
Dan Nicholson | 79ad458 | 2007-12-07 19:11:01 -0800 | [diff] [blame] | 152 | [build shared libraries @<:@default=enabled@:>@])], |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 153 | [enable_shared="$enableval"], |
| 154 | [enable_shared=yes] |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 155 | ) |
| 156 | case "x$enable_shared" in |
| 157 | xyes|xno ) ;; |
| 158 | x ) enable_shared=yes ;; |
| 159 | * ) |
| 160 | AC_MSG_ERROR([Shared library option '$enable_shared' is not a valid]) |
| 161 | ;; |
| 162 | esac |
| 163 | |
| 164 | dnl Can't have static and shared libraries, default to static if user |
| 165 | dnl explicitly requested. If both disabled, set to static since shared |
| 166 | dnl was explicitly requirested. |
| 167 | case "x$enable_static$enable_shared" in |
| 168 | xyesyes ) |
| 169 | AC_MSG_WARN([Can't build static and shared libraries, disabling shared]) |
| 170 | enable_shared=no |
| 171 | ;; |
| 172 | xnono ) |
| 173 | AC_MSG_WARN([Can't disable both static and shared libraries, enabling static]) |
| 174 | enable_static=yes |
| 175 | ;; |
| 176 | esac |
| 177 | |
| 178 | dnl |
| 179 | dnl mklib options |
| 180 | dnl |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 181 | AC_ARG_VAR([MKLIB_OPTIONS],[Options for the Mesa library script, mklib]) |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 182 | if test "$enable_static" = yes; then |
| 183 | MKLIB_OPTIONS="$MKLIB_OPTIONS -static" |
| 184 | fi |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 185 | AC_SUBST([MKLIB_OPTIONS]) |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 186 | |
Dan Nicholson | 23656c4 | 2007-12-12 09:02:31 -0800 | [diff] [blame] | 187 | dnl |
| 188 | dnl other compiler options |
| 189 | dnl |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 190 | AC_ARG_ENABLE([debug], |
Dan Nicholson | 23656c4 | 2007-12-12 09:02:31 -0800 | [diff] [blame] | 191 | [AS_HELP_STRING([--enable-debug], |
| 192 | [use debug compiler flags and macros @<:@default=disabled@:>@])], |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 193 | [enable_debug="$enableval"], |
| 194 | [enable_debug=no] |
Dan Nicholson | 23656c4 | 2007-12-12 09:02:31 -0800 | [diff] [blame] | 195 | ) |
| 196 | if test "x$enable_debug" = xyes; then |
| 197 | DEFINES="$DEFINES -DDEBUG" |
| 198 | if test "x$GCC" = xyes; then |
| 199 | CFLAGS="$CFLAGS -g" |
| 200 | fi |
| 201 | if test "x$GXX" = xyes; then |
| 202 | CXXFLAGS="$CXXFLAGS -g" |
| 203 | fi |
| 204 | fi |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 205 | |
| 206 | dnl |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 207 | dnl library names |
| 208 | dnl |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 209 | if test "$enable_static" = yes; then |
| 210 | GL_LIB_NAME='lib$(GL_LIB).a' |
| 211 | GLU_LIB_NAME='lib$(GLU_LIB).a' |
| 212 | GLUT_LIB_NAME='lib$(GLUT_LIB).a' |
| 213 | GLW_LIB_NAME='lib$(GLW_LIB).a' |
| 214 | OSMESA_LIB_NAME='lib$(OSMESA_LIB).a' |
| 215 | else |
| 216 | GL_LIB_NAME='lib$(GL_LIB).so' |
| 217 | GLU_LIB_NAME='lib$(GLU_LIB).so' |
| 218 | GLUT_LIB_NAME='lib$(GLUT_LIB).so' |
| 219 | GLW_LIB_NAME='lib$(GLW_LIB).so' |
| 220 | OSMESA_LIB_NAME='lib$(OSMESA_LIB).so' |
| 221 | fi |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 222 | AC_SUBST([GL_LIB_NAME]) |
| 223 | AC_SUBST([GLU_LIB_NAME]) |
| 224 | AC_SUBST([GLUT_LIB_NAME]) |
| 225 | AC_SUBST([GLW_LIB_NAME]) |
| 226 | AC_SUBST([OSMESA_LIB_NAME]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 227 | |
| 228 | dnl |
Dan Nicholson | 871125a | 2008-06-04 13:00:35 -0700 | [diff] [blame] | 229 | dnl Arch/platform-specific settings |
| 230 | dnl |
| 231 | AC_ARG_ENABLE([asm], |
| 232 | [AS_HELP_STRING([--disable-asm], |
| 233 | [disable assembly usage @<:@default=enabled on supported plaforms@:>@])], |
| 234 | [enable_asm="$enableval"], |
| 235 | [enable_asm=yes] |
| 236 | ) |
| 237 | asm_arch="" |
| 238 | ASM_FLAGS="" |
| 239 | ASM_SOURCES="" |
| 240 | ASM_API="" |
| 241 | AC_MSG_CHECKING([whether to enable assembly]) |
| 242 | test "x$enable_asm" = xno && AC_MSG_RESULT([no]) |
| 243 | # disable if cross compiling on x86/x86_64 since we must run gen_matypes |
| 244 | if test "x$enable_asm" = xyes && test "x$cross_compiling" = xyes; then |
| 245 | case "$host_cpu" in |
| 246 | i?86 | x86_64) |
| 247 | enable_asm=no |
| 248 | AC_MSG_RESULT([no, cross compiling]) |
| 249 | ;; |
| 250 | esac |
| 251 | fi |
| 252 | # check for supported arches |
| 253 | if test "x$enable_asm" = xyes; then |
| 254 | case "$host_cpu" in |
| 255 | i?86) |
| 256 | case "$host_os" in |
| 257 | linux* | freebsd* | dragonfly*) |
| 258 | test "x$enable_64bit" = xyes && asm_arch=x86_64 || asm_arch=x86 |
| 259 | ;; |
| 260 | esac |
| 261 | ;; |
| 262 | x86_64) |
| 263 | case "$host_os" in |
| 264 | linux* | freebsd* | dragonfly*) |
| 265 | test "x$enable_32bit" = xyes && asm_arch=x86 || asm_arch=x86_64 |
| 266 | ;; |
| 267 | esac |
| 268 | ;; |
| 269 | powerpc) |
| 270 | case "$host_os" in |
| 271 | linux*) |
| 272 | asm_arch=ppc |
| 273 | ;; |
| 274 | esac |
| 275 | ;; |
| 276 | esac |
| 277 | |
| 278 | case "$asm_arch" in |
| 279 | x86) |
| 280 | ASM_FLAGS="-DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM" |
| 281 | ASM_SOURCES='$(X86_SOURCES)' |
| 282 | ASM_API='$(X86_API)' |
| 283 | AC_MSG_RESULT([yes, x86]) |
| 284 | ;; |
| 285 | x86_64) |
| 286 | ASM_FLAGS="-DUSE_X86_64_ASM" |
| 287 | ASM_SOURCES='$(X86-64_SOURCES)' |
| 288 | ASM_API='$(X86-64_API)' |
| 289 | AC_MSG_RESULT([yes, x86_64]) |
| 290 | ;; |
| 291 | ppc) |
| 292 | ASM_FLAGS="-DUSE_PPC_ASM -DUSE_VMX_ASM" |
| 293 | ASM_SOURCES='$(PPC_SOURCES)' |
| 294 | AC_MSG_RESULT([yes, ppc]) |
| 295 | ;; |
| 296 | *) |
| 297 | AC_MSG_RESULT([no, platform not supported]) |
| 298 | ;; |
| 299 | esac |
| 300 | fi |
| 301 | AC_SUBST([ASM_FLAGS]) |
| 302 | AC_SUBST([ASM_SOURCES]) |
| 303 | AC_SUBST([ASM_API]) |
| 304 | |
| 305 | dnl PIC code macro |
| 306 | MESA_PIC_FLAGS |
| 307 | |
| 308 | dnl Check to see if dlopen is in default libraries (like Solaris, which |
| 309 | dnl has it in libc), or if libdl is needed to get it. |
| 310 | AC_CHECK_FUNC([dlopen], [], |
| 311 | [AC_CHECK_LIB([dl], [dlopen], [DLOPEN_LIBS="-ldl"])]) |
| 312 | |
| 313 | dnl SELinux awareness. |
| 314 | AC_ARG_ENABLE([selinux], |
| 315 | [AS_HELP_STRING([--enable-selinux], |
| 316 | [Build SELinux-aware Mesa @<:@default=disabled@:>@])], |
| 317 | [MESA_SELINUX="$enableval"], |
| 318 | [MESA_SELINUX=no]) |
| 319 | if test "x$enable_selinux" = "xyes"; then |
| 320 | AC_CHECK_HEADER([selinux/selinux.h],[], |
| 321 | [AC_MSG_ERROR([SELinux headers not found])]) |
| 322 | AC_CHECK_LIB([selinux],[is_selinux_enabled],[], |
| 323 | [AC_MSG_ERROR([SELinux library not found])]) |
| 324 | SELINUX_LIBS="-lselinux" |
| 325 | DEFINES="$DEFINES -DMESA_SELINUX" |
| 326 | fi |
| 327 | |
| 328 | |
| 329 | dnl |
Dan Nicholson | a130718 | 2007-12-12 17:49:49 -0800 | [diff] [blame] | 330 | dnl Driver configuration. Options are xlib, dri and osmesa right now. |
Dan Nicholson | 979ff51 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 331 | dnl More later: directfb, fbdev, ... |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 332 | dnl |
Eric Anholt | 711222b | 2008-04-18 15:03:01 -0700 | [diff] [blame] | 333 | default_driver="xlib" |
| 334 | |
| 335 | case "$host_os" in |
| 336 | linux*) |
| 337 | case "$host_cpu" in |
| 338 | i*86|x86_64|powerpc*) default_driver="dri";; |
| 339 | esac |
| 340 | ;; |
| 341 | freebsd* | dragonfly*) |
| 342 | case "$host_cpu" in |
| 343 | i*86|x86_64) default_driver="dri";; |
| 344 | esac |
| 345 | ;; |
| 346 | esac |
| 347 | |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 348 | AC_ARG_WITH([driver], |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 349 | [AS_HELP_STRING([--with-driver=DRIVER], |
Eric Anholt | 711222b | 2008-04-18 15:03:01 -0700 | [diff] [blame] | 350 | [driver for Mesa: xlib,dri,osmesa @<:@default=dri when available, or xlib@:>@])], |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 351 | [mesa_driver="$withval"], |
| 352 | [mesa_driver="$default_driver"]) |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 353 | dnl Check for valid option |
| 354 | case "x$mesa_driver" in |
Dan Nicholson | a130718 | 2007-12-12 17:49:49 -0800 | [diff] [blame] | 355 | xxlib|xdri|xosmesa) |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 356 | ;; |
| 357 | *) |
| 358 | AC_MSG_ERROR([Driver '$mesa_driver' is not a valid option]) |
| 359 | ;; |
| 360 | esac |
| 361 | |
| 362 | dnl |
| 363 | dnl Driver specific build directories |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 364 | dnl |
| 365 | SRC_DIRS="mesa" |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 366 | GLU_DIRS="sgi" |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 367 | WINDOW_SYSTEM="" |
| 368 | case "$mesa_driver" in |
Dan Nicholson | a130718 | 2007-12-12 17:49:49 -0800 | [diff] [blame] | 369 | xlib) |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 370 | DRIVER_DIRS="x11" |
| 371 | ;; |
| 372 | dri) |
| 373 | SRC_DIRS="glx/x11 $SRC_DIRS" |
| 374 | DRIVER_DIRS="dri" |
| 375 | WINDOW_SYSTEM="dri" |
| 376 | ;; |
Dan Nicholson | 979ff51 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 377 | osmesa) |
| 378 | DRIVER_DIRS="osmesa" |
| 379 | ;; |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 380 | esac |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 381 | AC_SUBST([SRC_DIRS]) |
| 382 | AC_SUBST([GLU_DIRS]) |
| 383 | AC_SUBST([DRIVER_DIRS]) |
| 384 | AC_SUBST([WINDOW_SYSTEM]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 385 | |
| 386 | dnl |
Dan Nicholson | 8e4d147 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 387 | dnl User supplied program configuration |
| 388 | dnl |
| 389 | if test -d "$srcdir/progs/demos"; then |
| 390 | default_demos=yes |
| 391 | else |
| 392 | default_demos=no |
| 393 | fi |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 394 | AC_ARG_WITH([demos], |
Dan Nicholson | 8e4d147 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 395 | [AS_HELP_STRING([--with-demos@<:@=DIRS...@:>@], |
| 396 | [optional comma delimited demo directories to build |
Dan Nicholson | c79c93c | 2007-12-12 18:13:04 -0800 | [diff] [blame] | 397 | @<:@default=auto if source available@:>@])], |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 398 | [with_demos="$withval"], |
| 399 | [with_demos="$default_demos"]) |
Dan Nicholson | 8e4d147 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 400 | if test "x$with_demos" = x; then |
| 401 | with_demos=no |
| 402 | fi |
| 403 | |
| 404 | dnl If $with_demos is yes, directories will be added as libs available |
| 405 | PROGRAM_DIRS="" |
| 406 | case "$with_demos" in |
Dan Nicholson | b957655 | 2008-03-10 14:05:46 -0700 | [diff] [blame] | 407 | no) ;; |
| 408 | yes) |
| 409 | # If the driver isn't osmesa, we have libGL and can build xdemos |
| 410 | if test "$mesa_driver" != osmesa; then |
| 411 | PROGRAM_DIRS="xdemos" |
| 412 | fi |
| 413 | ;; |
Dan Nicholson | 8e4d147 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 414 | *) |
| 415 | # verify the requested demos directories exist |
| 416 | demos=`IFS=,; echo $with_demos` |
| 417 | for demo in $demos; do |
| 418 | test -d "$srcdir/progs/$demo" || \ |
| 419 | AC_MSG_ERROR([Program directory '$demo' doesn't exist]) |
| 420 | done |
| 421 | PROGRAM_DIRS="$demos" |
| 422 | ;; |
| 423 | esac |
| 424 | |
| 425 | dnl |
Dan Nicholson | e6a0609 | 2008-05-05 15:16:22 -0700 | [diff] [blame] | 426 | dnl Find out if X is available. The variable have_x is set if libX11 is |
| 427 | dnl to mimic AC_PATH_XTRA. |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 428 | dnl |
| 429 | if test -n "$PKG_CONFIG"; then |
| 430 | AC_MSG_CHECKING([pkg-config files for X11 are available]) |
Dan Nicholson | e6a0609 | 2008-05-05 15:16:22 -0700 | [diff] [blame] | 431 | PKG_CHECK_EXISTS([x11],[ |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 432 | x11_pkgconfig=yes |
| 433 | have_x=yes |
Dan Nicholson | e6a0609 | 2008-05-05 15:16:22 -0700 | [diff] [blame] | 434 | ],[ |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 435 | x11_pkgconfig=no |
Dan Nicholson | e6a0609 | 2008-05-05 15:16:22 -0700 | [diff] [blame] | 436 | ]) |
| 437 | AC_MSG_RESULT([$x11_pkgconfig]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 438 | else |
| 439 | x11_pkgconfig=no |
| 440 | fi |
| 441 | dnl Use the autoconf macro if no pkg-config files |
| 442 | if test "$x11_pkgconfig" = no; then |
| 443 | AC_PATH_XTRA |
| 444 | fi |
| 445 | |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 446 | dnl We need X for xlib and dri, so bomb now if it's not found |
| 447 | case "$mesa_driver" in |
Dan Nicholson | a130718 | 2007-12-12 17:49:49 -0800 | [diff] [blame] | 448 | xlib|dri) |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 449 | if test "$no_x" = yes; then |
| 450 | AC_MSG_ERROR([X11 development libraries needed for $mesa_driver driver]) |
| 451 | fi |
| 452 | ;; |
| 453 | esac |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 454 | |
Dan Nicholson | 2d709fe | 2008-05-06 10:51:49 -0700 | [diff] [blame] | 455 | dnl XCB - this is only used for GLX right now |
| 456 | AC_ARG_ENABLE([xcb], |
| 457 | [AS_HELP_STRING([--enable-xcb], |
| 458 | [use XCB for GLX @<:@default=disabled@:>@])], |
| 459 | [enable_xcb="$enableval"], |
| 460 | [enable_xcb=no]) |
| 461 | if test "x$enable_xcb" = xyes; then |
| 462 | DEFINES="$DEFINES -DUSE_XCB" |
| 463 | else |
| 464 | enable_xcb=no |
| 465 | fi |
| 466 | |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 467 | dnl |
| 468 | dnl libGL configuration per driver |
| 469 | dnl |
| 470 | case "$mesa_driver" in |
Dan Nicholson | a130718 | 2007-12-12 17:49:49 -0800 | [diff] [blame] | 471 | xlib) |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 472 | if test "$x11_pkgconfig" = yes; then |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 473 | PKG_CHECK_MODULES([XLIBGL], [x11 xext]) |
Dan Nicholson | a130718 | 2007-12-12 17:49:49 -0800 | [diff] [blame] | 474 | X11_INCLUDES="$X11_INCLUDES $XLIBGL_CFLAGS" |
| 475 | GL_LIB_DEPS="$XLIBGL_LIBS" |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 476 | else |
| 477 | # should check these... |
| 478 | X11_INCLUDES="$X11_INCLUDES $X_CFLAGS" |
| 479 | GL_LIB_DEPS="$X_LIBS -lX11 -lXext" |
| 480 | fi |
Adam Jackson | 66611f2 | 2008-02-15 13:49:12 -0500 | [diff] [blame] | 481 | GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm -lpthread" |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 482 | |
| 483 | # if static, move the external libraries to the programs |
| 484 | # and empty the libraries for libGL |
| 485 | if test "$enable_static" = yes; then |
| 486 | APP_LIB_DEPS="$APP_LIB_DEPS $GL_LIB_DEPS" |
| 487 | GL_LIB_DEPS="" |
| 488 | fi |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 489 | ;; |
| 490 | dri) |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 491 | # DRI must be shared, I think |
| 492 | if test "$enable_static" = yes; then |
| 493 | AC_MSG_ERROR([Can't use static libraries for DRI drivers]) |
| 494 | fi |
| 495 | |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 496 | # Check for libdrm |
Dan Nicholson | cc77e8f | 2008-05-05 14:38:22 -0700 | [diff] [blame] | 497 | PKG_CHECK_MODULES([LIBDRM], [libdrm >= $LIBDRM_REQUIRED]) |
| 498 | PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= $DRI2PROTO_REQUIRED]) |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 499 | |
| 500 | # find the DRI deps for libGL |
| 501 | if test "$x11_pkgconfig" = yes; then |
Dan Nicholson | 2d709fe | 2008-05-06 10:51:49 -0700 | [diff] [blame] | 502 | # add xcb modules if necessary |
| 503 | dri_modules="x11 xext xxf86vm xdamage xfixes" |
| 504 | if test "$enable_xcb" = yes; then |
| 505 | dri_modules="$dri_modules x11-xcb xcb-glx" |
| 506 | fi |
| 507 | |
| 508 | PKG_CHECK_MODULES([DRIGL], [$dri_modules]) |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 509 | X11_INCLUDES="$X11_INCLUDES $DRIGL_CFLAGS" |
| 510 | GL_LIB_DEPS="$DRIGL_LIBS" |
| 511 | else |
| 512 | # should check these... |
| 513 | X11_INCLUDES="$X11_INCLUDES $X_CFLAGS" |
| 514 | GL_LIB_DEPS="$X_LIBS -lX11 -lXext -lXxf86vm -lXdamage -lXfixes" |
Dan Nicholson | 2d709fe | 2008-05-06 10:51:49 -0700 | [diff] [blame] | 515 | |
| 516 | # XCB can only be used from pkg-config |
| 517 | if test "$enable_xcb" = yes; then |
| 518 | PKG_CHECK_MODULES([XCB],[x11-xcb xcb-glx]) |
| 519 | X11_INCLUDES="$X11_INCLUDES $XCB_CFLAGS" |
| 520 | GL_LIB_DEPS="$GL_LIB_DEPS $XCB_LIBS" |
| 521 | fi |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 522 | fi |
| 523 | |
| 524 | # need DRM libs, -lpthread, etc. |
Eric Anholt | 050c533 | 2008-03-20 17:28:58 -0700 | [diff] [blame] | 525 | GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS" |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 526 | ;; |
Dan Nicholson | 979ff51 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 527 | osmesa) |
| 528 | # No libGL for osmesa |
| 529 | GL_LIB_DEPS="" |
| 530 | ;; |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 531 | esac |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 532 | AC_SUBST([GL_LIB_DEPS]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 533 | |
| 534 | dnl |
| 535 | dnl More X11 setup |
| 536 | dnl |
Dan Nicholson | a130718 | 2007-12-12 17:49:49 -0800 | [diff] [blame] | 537 | if test "$mesa_driver" = xlib; then |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 538 | DEFINES="$DEFINES -DUSE_XSHM" |
| 539 | fi |
| 540 | |
| 541 | dnl |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 542 | dnl More DRI setup |
| 543 | dnl |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 544 | AC_ARG_ENABLE([glx-tls], |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 545 | [AS_HELP_STRING([--enable-glx-tls], |
Dan Nicholson | 79ad458 | 2007-12-07 19:11:01 -0800 | [diff] [blame] | 546 | [enable TLS support in GLX @<:@default=disabled@:>@])], |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 547 | [GLX_USE_TLS="$enableval"], |
| 548 | [GLX_USE_TLS=no]) |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 549 | dnl Directory for DRI drivers |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 550 | AC_ARG_WITH([dri-driverdir], |
Dan Nicholson | af3d2f2 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 551 | [AS_HELP_STRING([--with-dri-driverdir=DIR], |
Dan Nicholson | 5dbbde5 | 2008-05-06 06:21:41 -0700 | [diff] [blame] | 552 | [directory for the DRI drivers @<:@${libdir}/dri@:>@])], |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 553 | [DRI_DRIVER_INSTALL_DIR="$withval"], |
Dan Nicholson | 5dbbde5 | 2008-05-06 06:21:41 -0700 | [diff] [blame] | 554 | [DRI_DRIVER_INSTALL_DIR='${libdir}/dri']) |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 555 | AC_SUBST([DRI_DRIVER_INSTALL_DIR]) |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 556 | dnl Direct rendering or just indirect rendering |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 557 | AC_ARG_ENABLE([driglx-direct], |
Dan Nicholson | 79ad458 | 2007-12-07 19:11:01 -0800 | [diff] [blame] | 558 | [AS_HELP_STRING([--disable-driglx-direct], |
| 559 | [enable direct rendering in GLX for DRI @<:@default=enabled@:>@])], |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 560 | [driglx_direct="$enableval"], |
| 561 | [driglx_direct="yes"]) |
Dave Airlie | 0b734bd | 2008-05-28 15:55:44 +1000 | [diff] [blame] | 562 | dnl ttm support |
| 563 | AC_ARG_ENABLE([ttm-api], |
| 564 | [AS_HELP_STRING([--enable-ttm-api], |
Dan Nicholson | 871125a | 2008-06-04 13:00:35 -0700 | [diff] [blame] | 565 | [enable TTM API users @<:@default=disabled@:>@])], |
Dave Airlie | 0b734bd | 2008-05-28 15:55:44 +1000 | [diff] [blame] | 566 | [ttmapi="$enableval"], |
| 567 | [ttmapi="no"]) |
| 568 | |
| 569 | if test "x$ttmapi" = "xyes"; then |
| 570 | save_CFLAGS=$CFLAGS |
| 571 | CFLAGS=$LIBDRM_CFLAGS |
| 572 | AC_CHECK_HEADERS([xf86mm.h],[],[AC_MSG_ERROR([xf86mm.h required for TTM.])],[#include "stdint.h"\n#include "drm.h"]) |
| 573 | CFLAGS=$save_CFLAGS |
| 574 | fi |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 575 | |
Dan Nicholson | af3d2f2 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 576 | dnl Which drivers to build - default is chosen by platform |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 577 | AC_ARG_WITH([dri-drivers], |
Dan Nicholson | af3d2f2 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 578 | [AS_HELP_STRING([--with-dri-drivers@<:@=DIRS...@:>@], |
Dan Nicholson | c79c93c | 2007-12-12 18:13:04 -0800 | [diff] [blame] | 579 | [comma delimited DRI drivers, e.g. "i965,radeon,nouveau" @<:@default=auto@:>@])], |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 580 | [with_dri_drivers="$withval"], |
| 581 | [with_dri_drivers=yes]) |
Dan Nicholson | af3d2f2 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 582 | if test "x$with_dri_drivers" = x; then |
| 583 | with_dri_drivers=no |
| 584 | fi |
| 585 | |
| 586 | dnl If $with_dri_drivers is yes, directories will be added through |
| 587 | dnl platform checks |
| 588 | DRI_DIRS="" |
| 589 | case "$with_dri_drivers" in |
| 590 | no|yes) ;; |
| 591 | *) |
| 592 | # verify the requested driver directories exist |
| 593 | dri_drivers=`IFS=,; echo $with_dri_drivers` |
| 594 | for driver in $dri_drivers; do |
| 595 | test -d "$srcdir/src/mesa/drivers/dri/$driver" || \ |
| 596 | AC_MSG_ERROR([DRI driver directory '$driver' doesn't exist]) |
| 597 | done |
| 598 | DRI_DIRS="$dri_drivers" |
| 599 | ;; |
| 600 | esac |
| 601 | |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 602 | dnl Just default to no EGL for now |
| 603 | USING_EGL=0 |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 604 | AC_SUBST([USING_EGL]) |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 605 | |
| 606 | dnl Set DRI_DIRS, DEFINES and LIB_DEPS |
| 607 | if test "$mesa_driver" = dri; then |
| 608 | # Use TLS in GLX? |
| 609 | if test "x$GLX_USE_TLS" = xyes; then |
| 610 | DEFINES="$DEFINES -DGLX_USE_TLS -DPTHREADS" |
| 611 | fi |
| 612 | |
Dave Airlie | 0b734bd | 2008-05-28 15:55:44 +1000 | [diff] [blame] | 613 | if test "x$ttmapi" = xyes; then |
| 614 | DEFINES="$DEFINES -DTTM_API" |
| 615 | fi |
| 616 | |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 617 | if test "x$USING_EGL" = x1; then |
| 618 | PROGRAM_DIRS="egl" |
| 619 | fi |
| 620 | |
| 621 | # Platform specific settings and drivers to build |
| 622 | case "$host_os" in |
| 623 | linux*) |
| 624 | DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER" |
| 625 | DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS" |
| 626 | if test "x$driglx_direct" = xyes; then |
| 627 | DEFINES="$DEFINES -DGLX_DIRECT_RENDERING" |
| 628 | fi |
| 629 | |
| 630 | case "$host_cpu" in |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 631 | x86_64) |
Dan Nicholson | a76e245 | 2007-12-07 11:25:08 -0800 | [diff] [blame] | 632 | # ffb, gamma, and sis are missing because they have not be |
| 633 | # converted to use the new interface. i810 are missing |
| 634 | # because there is no x86-64 system where they could *ever* |
| 635 | # be used. |
Dan Nicholson | af3d2f2 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 636 | if test "x$DRI_DIRS" = x; then |
Dan Nicholson | a76e245 | 2007-12-07 11:25:08 -0800 | [diff] [blame] | 637 | DRI_DIRS="i915 i965 mach64 mga r128 r200 r300 radeon \ |
George Sapountzis | 280bf89 | 2008-05-11 14:43:40 +0300 | [diff] [blame] | 638 | savage tdfx unichrome swrast" |
Dan Nicholson | af3d2f2 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 639 | fi |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 640 | ;; |
| 641 | powerpc*) |
Dan Nicholson | a76e245 | 2007-12-07 11:25:08 -0800 | [diff] [blame] | 642 | # Build only the drivers for cards that exist on PowerPC. |
| 643 | # At some point MGA will be added, but not yet. |
Dan Nicholson | af3d2f2 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 644 | if test "x$DRI_DIRS" = x; then |
George Sapountzis | 280bf89 | 2008-05-11 14:43:40 +0300 | [diff] [blame] | 645 | DRI_DIRS="mach64 r128 r200 r300 radeon tdfx swrast" |
Dan Nicholson | af3d2f2 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 646 | fi |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 647 | ;; |
Dave Airlie | 2b0e75e | 2008-06-12 12:06:50 +1000 | [diff] [blame^] | 648 | sparc*) |
| 649 | # Build only the drivers for cards that exist on sparc` |
| 650 | if test "x$DRI_DIRS" = x; then |
| 651 | DRI_DIRS="mach64 r128 r200 r300 radeon ffb" |
| 652 | fi |
| 653 | ;; |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 654 | esac |
| 655 | ;; |
Hasso Tepper | 9f8df2d | 2008-04-09 10:51:21 -0700 | [diff] [blame] | 656 | freebsd* | dragonfly*) |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 657 | DEFINES="$DEFINES -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1" |
| 658 | DEFINES="$DEFINES -DIN_DRI_DRIVER -DHAVE_ALIAS" |
| 659 | DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING" |
| 660 | if test "x$driglx_direct" = xyes; then |
| 661 | DEFINES="$DEFINES -DGLX_DIRECT_RENDERING" |
| 662 | fi |
| 663 | if test "x$GXX" = xyes; then |
| 664 | CXXFLAGS="$CXXFLAGS -ansi -pedantic" |
| 665 | fi |
| 666 | |
Dan Nicholson | a76e245 | 2007-12-07 11:25:08 -0800 | [diff] [blame] | 667 | # ffb and gamma are missing because they have not been converted |
| 668 | # to use the new interface. |
Dan Nicholson | af3d2f2 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 669 | if test "x$DRI_DIRS" = x; then |
| 670 | DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 radeon tdfx \ |
George Sapountzis | 280bf89 | 2008-05-11 14:43:40 +0300 | [diff] [blame] | 671 | unichrome savage sis swrast" |
Dan Nicholson | af3d2f2 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 672 | fi |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 673 | ;; |
| 674 | esac |
Dan Nicholson | 112a40e | 2008-02-21 10:17:19 -0800 | [diff] [blame] | 675 | |
| 676 | # default drivers |
| 677 | if test "x$DRI_DIRS" = x; then |
| 678 | DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 radeon s3v \ |
George Sapountzis | 280bf89 | 2008-05-11 14:43:40 +0300 | [diff] [blame] | 679 | savage sis tdfx trident unichrome ffb swrast" |
Dan Nicholson | 112a40e | 2008-02-21 10:17:19 -0800 | [diff] [blame] | 680 | fi |
| 681 | |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 682 | DRI_DIRS=`echo "$DRI_DIRS" | $SED 's/ */ /g'` |
| 683 | |
| 684 | # Check for expat |
| 685 | EXPAT_INCLUDES="" |
| 686 | EXPAT_LIB=-lexpat |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 687 | AC_ARG_WITH([expat], |
| 688 | [AS_HELP_STRING([--with-expat=DIR], |
| 689 | [expat install directory])],[ |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 690 | EXPAT_INCLUDES="-I$withval/include" |
| 691 | CPPFLAGS="$CPPFLAGS $EXPAT_INCLUDES" |
| 692 | LDFLAGS="$LDFLAGS -L$withval/$LIB_DIR" |
| 693 | EXPAT_LIB="-L$withval/$LIB_DIR -lexpat" |
| 694 | ]) |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 695 | AC_CHECK_HEADER([expat.h],[],[AC_MSG_ERROR([Expat required for DRI.])]) |
| 696 | AC_CHECK_LIB([expat],[XML_ParserCreate],[], |
| 697 | [AC_MSG_ERROR([Expat required for DRI.])]) |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 698 | |
| 699 | # put all the necessary libs together |
Eric Anholt | 050c533 | 2008-03-20 17:28:58 -0700 | [diff] [blame] | 700 | 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] | 701 | fi |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 702 | AC_SUBST([DRI_DIRS]) |
| 703 | AC_SUBST([EXPAT_INCLUDES]) |
| 704 | AC_SUBST([DRI_LIB_DEPS]) |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 705 | |
| 706 | dnl |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 707 | dnl OSMesa configuration |
| 708 | dnl |
Dan Nicholson | a130718 | 2007-12-12 17:49:49 -0800 | [diff] [blame] | 709 | if test "$mesa_driver" = xlib; then |
Dan Nicholson | 544ab20 | 2007-12-30 08:41:53 -0800 | [diff] [blame] | 710 | default_gl_osmesa=yes |
Dan Nicholson | 979ff51 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 711 | else |
Dan Nicholson | 544ab20 | 2007-12-30 08:41:53 -0800 | [diff] [blame] | 712 | default_gl_osmesa=no |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 713 | fi |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 714 | AC_ARG_ENABLE([gl-osmesa], |
Dan Nicholson | 544ab20 | 2007-12-30 08:41:53 -0800 | [diff] [blame] | 715 | [AS_HELP_STRING([--enable-gl-osmesa], |
| 716 | [enable OSMesa on libGL @<:@default=enabled for xlib driver@:>@])], |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 717 | [gl_osmesa="$enableval"], |
| 718 | [gl_osmesa="$default_gl_osmesa"]) |
Dan Nicholson | 544ab20 | 2007-12-30 08:41:53 -0800 | [diff] [blame] | 719 | if test "x$gl_osmesa" = xyes; then |
| 720 | if test "$mesa_driver" = osmesa; then |
| 721 | AC_MSG_ERROR([libGL is not available for OSMesa driver]) |
Dan Nicholson | 979ff51 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 722 | else |
Dan Nicholson | 544ab20 | 2007-12-30 08:41:53 -0800 | [diff] [blame] | 723 | DRIVER_DIRS="$DRIVER_DIRS osmesa" |
Dan Nicholson | 979ff51 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 724 | fi |
| 725 | fi |
| 726 | |
Dan Nicholson | 6689f9e | 2007-12-05 21:04:15 -0800 | [diff] [blame] | 727 | dnl Configure the channel bits for OSMesa (libOSMesa, libOSMesa16, ...) |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 728 | AC_ARG_WITH([osmesa-bits], |
Dan Nicholson | 6689f9e | 2007-12-05 21:04:15 -0800 | [diff] [blame] | 729 | [AS_HELP_STRING([--with-osmesa-bits=BITS], |
| 730 | [OSMesa channel bits and library name: 8, 16, 32 @<:@default=8@:>@])], |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 731 | [osmesa_bits="$withval"], |
| 732 | [osmesa_bits=8]) |
Dan Nicholson | 6689f9e | 2007-12-05 21:04:15 -0800 | [diff] [blame] | 733 | if test "$mesa_driver" != osmesa && test "x$osmesa_bits" != x8; then |
| 734 | AC_MSG_WARN([Ignoring OSMesa channel bits for non-OSMesa driver]) |
| 735 | osmesa_bits=8 |
| 736 | fi |
| 737 | case "x$osmesa_bits" in |
| 738 | x8) |
| 739 | OSMESA_LIB=OSMesa |
| 740 | ;; |
| 741 | x16|x32) |
| 742 | OSMESA_LIB="OSMesa$osmesa_bits" |
| 743 | DEFINES="$DEFINES -DCHAN_BITS=$osmesa_bits -DDEFAULT_SOFTWARE_DEPTH_BITS=31" |
| 744 | ;; |
| 745 | *) |
| 746 | AC_MSG_ERROR([OSMesa bits '$osmesa_bits' is not a valid option]) |
| 747 | ;; |
| 748 | esac |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 749 | AC_SUBST([OSMESA_LIB]) |
Dan Nicholson | 6689f9e | 2007-12-05 21:04:15 -0800 | [diff] [blame] | 750 | |
Dan Nicholson | 979ff51 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 751 | case "$mesa_driver" in |
| 752 | osmesa) |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 753 | # only link librararies with osmesa if shared |
| 754 | if test "$enable_static" = no; then |
Adam Jackson | 66611f2 | 2008-02-15 13:49:12 -0500 | [diff] [blame] | 755 | OSMESA_LIB_DEPS="-lm -lpthread $SELINUX_LIBS" |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 756 | else |
| 757 | OSMESA_LIB_DEPS="" |
| 758 | fi |
Dan Nicholson | 979ff51 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 759 | OSMESA_MESA_DEPS="" |
| 760 | ;; |
| 761 | *) |
| 762 | # Link OSMesa to libGL otherwise |
| 763 | OSMESA_LIB_DEPS="" |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 764 | # only link librararies with osmesa if shared |
| 765 | if test "$enable_static" = no; then |
| 766 | OSMESA_MESA_DEPS='-l$(GL_LIB)' |
| 767 | else |
| 768 | OSMESA_MESA_DEPS="" |
| 769 | fi |
Dan Nicholson | 979ff51 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 770 | ;; |
| 771 | esac |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 772 | AC_SUBST([OSMESA_LIB_DEPS]) |
| 773 | AC_SUBST([OSMESA_MESA_DEPS]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 774 | |
| 775 | dnl |
| 776 | dnl GLU configuration |
| 777 | dnl |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 778 | AC_ARG_ENABLE([glu], |
Dan Nicholson | 79ad458 | 2007-12-07 19:11:01 -0800 | [diff] [blame] | 779 | [AS_HELP_STRING([--disable-glu], |
| 780 | [enable OpenGL Utility library @<:@default=enabled@:>@])], |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 781 | [enable_glu="$enableval"], |
| 782 | [enable_glu=yes]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 783 | if test "x$enable_glu" = xyes; then |
| 784 | SRC_DIRS="$SRC_DIRS glu" |
| 785 | |
Dan Nicholson | 979ff51 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 786 | case "$mesa_driver" in |
| 787 | osmesa) |
Dan Nicholson | 6689f9e | 2007-12-05 21:04:15 -0800 | [diff] [blame] | 788 | # If GLU is available and we have libOSMesa (not 16 or 32), |
| 789 | # we can build the osdemos |
Dan Nicholson | 8e4d147 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 790 | if test "$with_demos" = yes && test "$osmesa_bits" = 8; then |
Dan Nicholson | 6689f9e | 2007-12-05 21:04:15 -0800 | [diff] [blame] | 791 | PROGRAM_DIRS="$PROGRAM_DIRS osdemos" |
| 792 | fi |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 793 | |
Dan Nicholson | 979ff51 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 794 | # Link libGLU to libOSMesa instead of libGL |
| 795 | GLU_LIB_DEPS="" |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 796 | if test "$enable_static" = no; then |
| 797 | GLU_MESA_DEPS='-l$(OSMESA_LIB)' |
| 798 | else |
| 799 | GLU_MESA_DEPS="" |
| 800 | fi |
Dan Nicholson | 979ff51 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 801 | ;; |
| 802 | *) |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 803 | # If static, empty GLU_LIB_DEPS and add libs for programs to link |
| 804 | if test "$enable_static" = no; then |
| 805 | GLU_LIB_DEPS="-lm" |
| 806 | GLU_MESA_DEPS='-l$(GL_LIB)' |
| 807 | else |
| 808 | GLU_LIB_DEPS="" |
| 809 | GLU_MESA_DEPS="" |
| 810 | APP_LIB_DEPS="$APP_LIB_DEPS -lstdc++" |
| 811 | fi |
Dan Nicholson | 979ff51 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 812 | ;; |
| 813 | esac |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 814 | fi |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 815 | AC_SUBST([GLU_LIB_DEPS]) |
| 816 | AC_SUBST([GLU_MESA_DEPS]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 817 | |
| 818 | dnl |
| 819 | dnl GLw configuration |
| 820 | dnl |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 821 | AC_ARG_ENABLE([glw], |
Dan Nicholson | 79ad458 | 2007-12-07 19:11:01 -0800 | [diff] [blame] | 822 | [AS_HELP_STRING([--disable-glw], |
| 823 | [enable Xt/Motif widget library @<:@default=enabled@:>@])], |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 824 | [enable_glw="$enableval"], |
| 825 | [enable_glw=yes]) |
Dan Nicholson | 979ff51 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 826 | dnl Don't build GLw on osmesa |
| 827 | if test "x$enable_glw" = xyes && test "$mesa_driver" = osmesa; then |
| 828 | AC_MSG_WARN([Disabling GLw since the driver is OSMesa]) |
| 829 | enable_glw=no |
| 830 | fi |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 831 | if test "x$enable_glw" = xyes; then |
| 832 | SRC_DIRS="$SRC_DIRS glw" |
| 833 | if test "$x11_pkgconfig" = yes; then |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 834 | PKG_CHECK_MODULES([GLW],[x11 xt]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 835 | GLW_LIB_DEPS="$GLW_LIBS" |
| 836 | else |
| 837 | # should check these... |
| 838 | GLW_LIB_DEPS="$X_LIBS -lX11 -lXt" |
| 839 | fi |
| 840 | |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 841 | # If static, empty GLW_LIB_DEPS and add libs for programs to link |
| 842 | if test "$enable_static" = no; then |
| 843 | GLW_MESA_DEPS='-l$(GL_LIB)' |
| 844 | else |
| 845 | APP_LIB_DEPS="$APP_LIB_DEPS $GLW_LIB_DEPS" |
| 846 | GLW_LIB_DEPS="" |
| 847 | GLW_MESA_DEPS="" |
| 848 | fi |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 849 | fi |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 850 | AC_SUBST([GLW_LIB_DEPS]) |
| 851 | AC_SUBST([GLW_MESA_DEPS]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 852 | |
| 853 | dnl |
| 854 | dnl GLUT configuration |
| 855 | dnl |
| 856 | if test -f "$srcdir/include/GL/glut.h"; then |
| 857 | default_glut=yes |
| 858 | else |
| 859 | default_glut=no |
| 860 | fi |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 861 | AC_ARG_ENABLE([glut], |
Dan Nicholson | 79ad458 | 2007-12-07 19:11:01 -0800 | [diff] [blame] | 862 | [AS_HELP_STRING([--disable-glut], |
| 863 | [enable GLUT library @<:@default=enabled if source available@:>@])], |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 864 | [enable_glut="$enableval"], |
| 865 | [enable_glut="$default_glut"]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 866 | |
| 867 | dnl Can't build glut if GLU not available |
| 868 | if test "x$enable_glu$enable_glut" = xnoyes; then |
| 869 | AC_MSG_WARN([Disabling glut since GLU is disabled]) |
| 870 | enable_glut=no |
| 871 | fi |
Dan Nicholson | 979ff51 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 872 | dnl Don't build glut on osmesa |
| 873 | if test "x$enable_glut" = xyes && test "$mesa_driver" = osmesa; then |
| 874 | AC_MSG_WARN([Disabling glut since the driver is OSMesa]) |
| 875 | enable_glut=no |
| 876 | fi |
| 877 | |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 878 | if test "x$enable_glut" = xyes; then |
| 879 | SRC_DIRS="$SRC_DIRS glut/glx" |
| 880 | GLUT_CFLAGS="" |
| 881 | if test "x$GCC" = xyes; then |
| 882 | GLUT_CFLAGS="-fexceptions" |
| 883 | fi |
| 884 | if test "$x11_pkgconfig" = yes; then |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 885 | PKG_CHECK_MODULES([GLUT],[x11 xmu xi]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 886 | GLUT_LIB_DEPS="$GLUT_LIBS" |
| 887 | else |
| 888 | # should check these... |
Dan Nicholson | 70d0c83 | 2007-12-07 11:12:20 -0800 | [diff] [blame] | 889 | GLUT_LIB_DEPS="$X_LIBS -lX11 -lXmu -lXi" |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 890 | fi |
| 891 | GLUT_LIB_DEPS="$GLUT_LIB_DEPS -lm" |
| 892 | |
| 893 | # If glut is available, we can build most programs |
Dan Nicholson | 8e4d147 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 894 | if test "$with_demos" = yes; then |
| 895 | PROGRAM_DIRS="$PROGRAM_DIRS demos redbook samples glsl" |
| 896 | fi |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 897 | |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 898 | # If static, empty GLUT_LIB_DEPS and add libs for programs to link |
| 899 | if test "$enable_static" = no; then |
| 900 | GLUT_MESA_DEPS='-l$(GLU_LIB) -l$(GL_LIB)' |
| 901 | else |
| 902 | APP_LIB_DEPS="$APP_LIB_DEPS $GLUT_LIB_DEPS" |
| 903 | GLUT_LIB_DEPS="" |
| 904 | GLUT_MESA_DEPS="" |
| 905 | fi |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 906 | fi |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 907 | AC_SUBST([GLUT_LIB_DEPS]) |
| 908 | AC_SUBST([GLUT_MESA_DEPS]) |
| 909 | AC_SUBST([GLUT_CFLAGS]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 910 | |
| 911 | dnl |
| 912 | dnl Program library dependencies |
| 913 | dnl Only libm is added here if necessary as the libraries should |
| 914 | dnl be pulled in by the linker |
| 915 | dnl |
| 916 | if test "x$APP_LIB_DEPS" = x; then |
| 917 | APP_LIB_DEPS="-lm" |
| 918 | fi |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 919 | AC_SUBST([APP_LIB_DEPS]) |
| 920 | AC_SUBST([PROGRAM_DIRS]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 921 | |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 922 | |
| 923 | dnl Restore LDFLAGS and CPPFLAGS |
| 924 | LDFLAGS="$_SAVE_LDFLAGS" |
| 925 | CPPFLAGS="$_SAVE_CPPFLAGS" |
| 926 | |
| 927 | dnl Substitute the config |
Dan Nicholson | f64d6fe | 2007-12-12 17:57:45 -0800 | [diff] [blame] | 928 | AC_CONFIG_FILES([configs/autoconf]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 929 | |
Dan Nicholson | aab38cf | 2007-12-11 08:21:51 -0800 | [diff] [blame] | 930 | dnl Replace the configs/current symlink |
Dan Nicholson | e14ebbc | 2008-05-06 11:28:43 -0700 | [diff] [blame] | 931 | AC_CONFIG_COMMANDS([configs],[ |
Dan Nicholson | aab38cf | 2007-12-11 08:21:51 -0800 | [diff] [blame] | 932 | if test -f configs/current || test -L configs/current; then |
| 933 | rm -f configs/current |
| 934 | fi |
| 935 | ln -s autoconf configs/current |
Dan Nicholson | e14ebbc | 2008-05-06 11:28:43 -0700 | [diff] [blame] | 936 | ]) |
| 937 | |
| 938 | AC_OUTPUT |
Dan Nicholson | aab38cf | 2007-12-11 08:21:51 -0800 | [diff] [blame] | 939 | |
Dan Nicholson | 9cad8e3 | 2007-11-30 08:49:57 -0800 | [diff] [blame] | 940 | dnl |
| 941 | dnl Output some configuration info for the user |
| 942 | dnl |
| 943 | echo "" |
| 944 | echo " prefix: $prefix" |
| 945 | echo " exec_prefix: $exec_prefix" |
| 946 | echo " libdir: $libdir" |
| 947 | |
| 948 | dnl Driver info |
| 949 | echo "" |
| 950 | echo " Driver: $mesa_driver" |
Dan Nicholson | 544ab20 | 2007-12-30 08:41:53 -0800 | [diff] [blame] | 951 | if echo "$DRIVER_DIRS" | grep 'osmesa' >/dev/null 2>&1; then |
| 952 | echo " OSMesa: lib$OSMESA_LIB" |
| 953 | else |
| 954 | echo " OSMesa: no" |
| 955 | fi |
| 956 | if test "$mesa_driver" = dri; then |
Dan Nicholson | 9cad8e3 | 2007-11-30 08:49:57 -0800 | [diff] [blame] | 957 | # cleanup the drivers var |
| 958 | dri_dirs=`echo $DRI_DIRS | $SED 's/^ *//;s/ */ /;s/ *$//'` |
| 959 | echo " DRI drivers: $dri_dirs" |
| 960 | echo " DRI driver dir: $DRI_DRIVER_INSTALL_DIR" |
Dave Airlie | 0b734bd | 2008-05-28 15:55:44 +1000 | [diff] [blame] | 961 | echo " TTM API support: $ttmapi" |
Dan Nicholson | 544ab20 | 2007-12-30 08:41:53 -0800 | [diff] [blame] | 962 | fi |
Dan Nicholson | 9cad8e3 | 2007-11-30 08:49:57 -0800 | [diff] [blame] | 963 | |
| 964 | dnl Libraries |
| 965 | echo "" |
| 966 | echo " Shared libs: $enable_shared" |
| 967 | echo " Static libs: $enable_static" |
| 968 | echo " GLU: $enable_glu" |
| 969 | echo " GLw: $enable_glw" |
| 970 | echo " glut: $enable_glut" |
| 971 | |
| 972 | dnl Programs |
| 973 | # cleanup the programs var for display |
| 974 | program_dirs=`echo $PROGRAM_DIRS | $SED 's/^ *//;s/ */ /;s/ *$//'` |
| 975 | if test "x$program_dirs" = x; then |
| 976 | echo " Demos: no" |
| 977 | else |
| 978 | echo " Demos: $program_dirs" |
| 979 | fi |
| 980 | |
Dan Nicholson | 16a07fb | 2007-12-12 09:12:15 -0800 | [diff] [blame] | 981 | dnl Compiler options |
| 982 | # cleanup the CFLAGS/CXXFLAGS/DEFINES vars |
| 983 | cflags=`echo $CFLAGS $OPT_FLAGS $PIC_FLAGS $ARCH_FLAGS | \ |
| 984 | $SED 's/^ *//;s/ */ /;s/ *$//'` |
| 985 | cxxflags=`echo $CXXFLAGS $OPT_FLAGS $PIC_FLAGS $ARCH_FLAGS | \ |
| 986 | $SED 's/^ *//;s/ */ /;s/ *$//'` |
| 987 | defines=`echo $DEFINES $ASM_FLAGS | $SED 's/^ *//;s/ */ /;s/ *$//'` |
| 988 | echo "" |
| 989 | echo " CFLAGS: $cflags" |
| 990 | echo " CXXFLAGS: $cxxflags" |
| 991 | echo " Macros: $defines" |
| 992 | |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 993 | echo "" |
Dan Nicholson | b645942 | 2008-03-24 10:01:50 -0700 | [diff] [blame] | 994 | echo " Run '${MAKE-make}' to build Mesa" |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 995 | echo "" |