diff options
author | Kevin E Martin <kem@kem.org> | 2005-07-14 19:35:48 +0000 |
---|---|---|
committer | Kevin E Martin <kem@kem.org> | 2005-07-14 19:35:48 +0000 |
commit | 520317863ffb365eca17c96b4d545adb554bbbd6 (patch) | |
tree | 09e80d2c244aff8cc6011b01fb1eef3ec89dde89 /configure.ac | |
parent | ab5264838ae34bb29791bc08d5a4f853a995faf1 (diff) |
Make compiling with DRI support configurable/autodetecable. Autodetect DRI
sdk headers. Expand help string for xorg-module-dir option.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 51 |
1 files changed, 41 insertions, 10 deletions
diff --git a/configure.ac b/configure.ac index 37210d66..ab16e69f 100644 --- a/configure.ac +++ b/configure.ac @@ -40,25 +40,56 @@ AC_PROG_CC AH_TOP([#include "xorg-server.h"]) -AC_ARG_WITH(xorg-module-dir, [ --with-xorg-module-dir=DIR ], - [ moduledir="$withval" ], - [ moduledir="$libdir/xorg/modules" ]) -AC_SUBST(moduledir) +AC_ARG_WITH(xorg-module-dir, + AC_HELP_STRING([--with-xorg-module-dir=DIR], + [Default xorg module directory [[default=$libdir/xorg/modules]]]), + [moduledir="$withval"], + [moduledir="$libdir/xorg/modules"]) + +AC_ARG_ENABLE(dri, AC_HELP_STRING([--disable-dri], + [Disable DRI support [[default=auto]]]), + [DRI="$enableval"], + [DRI=auto]) # Checks for pkg-config packages -PKG_CHECK_MODULES(XORG, xorg-server xproto libdrm) +PKG_CHECK_MODULES(XORG, [xorg-server xproto]) sdkdir=$(pkg-config --variable=sdkdir xorg-server) -CFLAGS="$XORG_CFLAGS "' -I$(top_srcdir)/src' -INCLUDES="$XORG_INCS -I${sdkdir} "'-I$(top_srcdir)/src -I$(prefix)/include' -AC_SUBST([CFLAGS]) -AC_SUBST([INCLUDES]) - # Checks for libraries. # Checks for header files. AC_HEADER_STDC +if test "$DRI" != no; then + CFLAGS="-I${sdkdir}" + AC_CHECK_HEADERS([dri.h sarea.h dristruct.h]) +fi + +AC_MSG_CHECKING([whether to include DRI support]) +if test x$DRI = xauto; then + if test "$ac_cv_header_dri_h" = yes -a \ + "$ac_cv_header_sarea_h" = yes -a \ + "$ac_cv_header_dristruct_h" = yes; then + DRI="yes" + else + DRI="no" + fi +fi +AC_MSG_RESULT([$DRI]) + +AM_CONDITIONAL(DRI, test x$DRI = xyes) +if test "$DRI" = yes; then + PKG_CHECK_MODULES(DRI, [libdrm]) + AC_DEFINE(XF86DRI,1,[Enable DRI driver support]) + AC_DEFINE(XF86DRI_DEVEL,1,[Enable developmental DRI driver support]) +fi + +CFLAGS="$XORG_CFLAGS $DRI_CFLAGS"' -I$(top_srcdir)/src' + +AC_SUBST([CFLAGS]) +AC_SUBST(DRI) +AC_SUBST(moduledir) + AC_OUTPUT([ Makefile src/Makefile |