From 520317863ffb365eca17c96b4d545adb554bbbd6 Mon Sep 17 00:00:00 2001 From: Kevin E Martin Date: Thu, 14 Jul 2005 19:35:48 +0000 Subject: Make compiling with DRI support configurable/autodetecable. Autodetect DRI sdk headers. Expand help string for xorg-module-dir option. --- configure.ac | 51 +++++++++++++++++++++++++++++++++++++++++---------- src/Makefile.am | 18 +++++++++++------- 2 files changed, 52 insertions(+), 17 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 diff --git a/src/Makefile.am b/src/Makefile.am index 6659408d..6b44742e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -26,7 +26,11 @@ # _ladir passes a dummy rpath to libtool so the thing will actually link # TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc. -AM_CFLAGS = -DXF86DRI -DXF86DRI_DEVEL +if DRI +ATIMISC_DRI_SRCS = atidri.c +R128_DRI_SRCS = r128_dri.c +RADEON_DRI_SRCS = radeon_dri.c +endif ati_drv_la_LTLIBRARIES = ati_drv.la ati_drv_la_LDFLAGS = -module -avoid-version @@ -34,26 +38,26 @@ ati_drv_ladir = @moduledir@/drivers ati_drv_la_SOURCES = \ ati.c atiadapter.c atibus.c atichip.c atiident.c atioption.c \ atiprobe.c atividmem.c ativgaio.c atimodule.c \ - radeon_probe.c r128_probe.c + radeon_probe.c r128_probe.c atimisc_drv_la_LTLIBRARIES = atimisc_drv.la atimisc_drv_la_LDFLAGS = -module -avoid-version atimisc_drv_ladir = @moduledir@/drivers atimisc_drv_la_SOURCES = \ atiaccel.c atiadjust.c atiaudio.c aticlock.c aticonfig.c aticonsole.c \ - aticursor.c atidac.c atidecoder.c atidsp.c atifillin.c atii2c.c \ + aticursor.c atidac.c atidecoder.c atidsp.c atifillin.c atii2c.c \ atilock.c atimach64.c atimach64accel.c atimach64cursor.c \ atimach64i2c.c atimach64io.c atimach64xv.c atimode.c atipreinit.c \ atiprint.c atirgb514.c atiscreen.c atituner.c atiutil.c ativalid.c \ - atixv.c atidri.c atibank.c ativga.c atiwonder.c atiwonderio.c \ - atidga.c atiload.c atimisc.c + atixv.c atibank.c ativga.c atiwonder.c atiwonderio.c atidga.c \ + atiload.c atimisc.c $(ATIMISC_DRI_SRCS) r128_drv_la_LTLIBRARIES = r128_drv.la r128_drv_la_LDFLAGS = -module -avoid-version r128_drv_ladir = @moduledir@/drivers r128_drv_la_SOURCES = \ r128_accel.c r128_cursor.c r128_dga.c r128_driver.c \ - r128_video.c r128_dri.c r128_misc.c + r128_video.c r128_misc.c $(R128_DRI_SRCS) radeon_drv_la_LTLIBRARIES = radeon_drv.la radeon_drv_la_LDFLAGS = -module -avoid-version @@ -61,7 +65,7 @@ radeon_drv_ladir = @moduledir@/drivers radeon_drv_la_SOURCES = \ radeon_accel.c radeon_mergedfb.c radeon_cursor.c radeon_dga.c \ radeon_driver.c radeon_video.c radeon_bios.c radeon_mm_i2c.c \ - radeon_vip.c radeon_dri.c radeon_misc.c + radeon_vip.c radeon_misc.c $(RADEON_DRI_SRCS) theatre_detect_drv_la_LTLIBRARIES = theatre_detect_drv.la theatre_detect_drv_la_LDFLAGS = -module -avoid-version -- cgit v1.2.3