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