AC_PATH_PROG(MKDEP, makedepend)
AC_PATH_PROG(SED, sed)
+dnl Ask gcc where it's keeping its secret headers
+if test "x$GCC" = xyes; then
+ GCC_PATH=$(gcc -print-search-dirs | sed -ne 's/install: //p')
+ MKDEP_OPTIONS="-fdepend -I${GCC_PATH}include"
+else
+ MKDEP_OPTIONS=-fdepend
+fi
+AC_SUBST(MKDEP_OPTIONS)
+
dnl Make sure the pkg-config macros are defined
m4_ifdef([PKG_PROG_PKG_CONFIG],,[
AC_MSG_ERROR([The pkg-config autoconf macros are not defined.
dnl Add flags for gcc and g++
if test "x$GCC" = xyes; then
CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -std=c99 -ffast-math"
+
+ # Work around aliasing bugs - developers should comment this out
+ CFLAGS="$CFLAGS -fno-strict-aliasing"
fi
if test "x$GXX" = xyes; then
CXXFLAGS="$CXXFLAGS -Wall"
+
+ # Work around aliasing bugs - developers should comment this out
+ CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
fi
dnl These should be unnecessary, but let the user set them if they want
;;
esac
+# SELinux awareness.
+AC_ARG_ENABLE(selinux, AS_HELP_STRING([--enable-selinux], [Build SELinux-aware Mesa (default: disabled)]), [MESA_SELINUX=$enableval], [MESA_SELINUX=no])
+if test "x$enable_selinux" = "xyes"; then
+ AC_CHECK_HEADER(selinux/selinux.h,,
+ AC_MSG_ERROR([SELinux headers not found]))
+ AC_CHECK_LIB(selinux,is_selinux_enabled,,
+ AC_MSG_ERROR([SELinux library not found]))
+ SELINUX_LIBS="-lselinux"
+ DEFINES="$DEFINES -DMESA_SELINUX"
+fi
+
dnl
dnl libGL configuration per driver
dnl
X11_INCLUDES="$X11_INCLUDES $X_CFLAGS"
GL_LIB_DEPS="$X_LIBS -lX11 -lXext"
fi
- GL_LIB_DEPS="$GL_LIB_DEPS -lm -lpthread"
+ GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm -lpthread"
# if static, move the external libraries to the programs
# and empty the libraries for libGL
PROGRAM_DIRS="egl"
fi
- # default drivers
- if test "x$DRI_DIRS" = x; then
- DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 radeon s3v \
- savage sis tdfx trident unichrome ffb"
- fi
-
# Platform specific settings and drivers to build
case "$host_os" in
linux*)
fi
;;
esac
+
+ # default drivers
+ if test "x$DRI_DIRS" = x; then
+ DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 radeon s3v \
+ savage sis tdfx trident unichrome ffb"
+ fi
+
DRI_DIRS=`echo "$DRI_DIRS" | $SED 's/ */ /g'`
# Check for expat
AC_MSG_ERROR([Expat required for DRI.]))
# put all the necessary libs together
- DRI_LIB_DEPS="$LIBDRM_LIBS $EXPAT_LIB -lm -lpthread -ldl"
+ DRI_LIB_DEPS="$SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm -lpthread -ldl"
fi
AC_SUBST(DRI_DIRS)
AC_SUBST(EXPAT_INCLUDES)
dnl OSMesa configuration
dnl
if test "$mesa_driver" = xlib; then
- default_xlib_osmesa=yes
+ default_gl_osmesa=yes
else
- default_xlib_osmesa=no
-fi
-AC_ARG_ENABLE(xlib-osmesa,
- [AS_HELP_STRING([--disable-xlib-osmesa],
- [enable OSMesa on Xlib libGL @<:@default=enabled for xlib driver@:>@])],
- xlib_osmesa="$enableval",
- xlib_osmesa="$default_xlib_osmesa")
-if test "x$xlib_osmesa" = xyes; then
- if test "$mesa_driver" = xlib; then
- DRIVER_DIRS="$DRIVER_DIRS osmesa"
+ default_gl_osmesa=no
+fi
+AC_ARG_ENABLE(gl-osmesa,
+ [AS_HELP_STRING([--enable-gl-osmesa],
+ [enable OSMesa on libGL @<:@default=enabled for xlib driver@:>@])],
+ gl_osmesa="$enableval",
+ gl_osmesa="$default_gl_osmesa")
+if test "x$gl_osmesa" = xyes; then
+ if test "$mesa_driver" = osmesa; then
+ AC_MSG_ERROR([libGL is not available for OSMesa driver])
else
- AC_MSG_ERROR([Can only enable OSMesa on libGL for Xlib])
+ DRIVER_DIRS="$DRIVER_DIRS osmesa"
fi
fi
osmesa)
# only link librararies with osmesa if shared
if test "$enable_static" = no; then
- OSMESA_LIB_DEPS="-lm -lpthread"
+ OSMESA_LIB_DEPS="-lm -lpthread $SELINUX_LIBS"
else
OSMESA_LIB_DEPS=""
fi
;;
freebsd*)
PIC_FLAGS="-fPIC"
- case "$host_os" in
+ case "$host_cpu" in
i*86)
PIC_FLAGS=""
if test "x$enable_asm" = xyes; then
dnl Driver info
echo ""
echo " Driver: $mesa_driver"
-case "$mesa_driver" in
-xlib|osmesa)
- if echo "$DRIVER_DIRS" | grep 'osmesa' >/dev/null 2>&1; then
- echo " OSMesa: lib$OSMESA_LIB"
- else
- echo " OSMesa: no"
- fi
- ;;
-dri)
+if echo "$DRIVER_DIRS" | grep 'osmesa' >/dev/null 2>&1; then
+ echo " OSMesa: lib$OSMESA_LIB"
+else
+ echo " OSMesa: no"
+fi
+if test "$mesa_driver" = dri; then
# cleanup the drivers var
dri_dirs=`echo $DRI_DIRS | $SED 's/^ *//;s/ */ /;s/ *$//'`
echo " DRI drivers: $dri_dirs"
echo " DRI driver dir: $DRI_DRIVER_INSTALL_DIR"
- ;;
-esac
+fi
dnl Libraries
echo ""