<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.26.0">
</HEAD>
<BODY>
On Tue, 2011-01-04 at 16:15 +0100, Wolfram Sang wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
Similar to 97a4e747bfac14f34646c55ddf639e8fe22f2f55 in xf86-video-ati.
Signed-off-by: Wolfram Sang <<A HREF="mailto:w.sang@pengutronix.de">w.sang@pengutronix.de</A>>
---
configure.ac | 20 +++++++++++++-------
1 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/configure.ac b/configure.ac
index 0116265..7884b28 100644
--- a/configure.ac
+++ b/configure.ac
@@ -78,12 +78,19 @@ sdkdir=`$PKG_CONFIG --variable=sdkdir xorg-server`
# Checks for libraries.
if test "x$DRI" = xauto; then
- AC_CHECK_FILE([${sdkdir}/dri.h],
- [have_dri_h="yes"], [have_dri_h="no"])
- AC_CHECK_FILE([${sdkdir}/sarea.h],
- [have_sarea_h="yes"], [have_sarea_h="no"])
- AC_CHECK_FILE([${sdkdir}/dristruct.h],
- [have_dristruct_h="yes"], [have_dristruct_h="no"])
+        PKG_CHECK_MODULES(DRI, [libdrm >= 2.0 xf86driproto glproto])
</PRE>
</BLOCKQUOTE>
With this line, the configuration will always fail on a system where libdrm is not installed or at a version less than 2.0.<BR>
The current code is probably not correct either. It checks if headers are in the server and will fail if libdrm is not installed. <BR>
<BR>
You can use something similar to:
<PRE>
PKG_CHECK_MODULES(UDEV, $LIBUDEV, [HAVE_LIBUDEV=yes], [HAVE_LIBUDEV=no])
</PRE>
The macro will not abort if the required package is missing, it will just set the variables.<BR>
I did notice some drivers are not buildable with a server configured without mesa.<BR>
<BR>
<BLOCKQUOTE TYPE=CITE>
<PRE>
+        save_CPPFLAGS="$CPPFLAGS"
+        CPPFLAGS="$XORG_CFLAGS $DRI_CFLAGS"
+        AC_CHECK_HEADER([dri.h],
+ [have_dri_h="yes"], [have_dri_h="no"],[-])
+        AC_CHECK_HEADER([sarea.h],
+ [have_sarea_h="yes"], [have_sarea_h="no"],[-])
+        AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
+#include <xorg-server.h>
+#include <dristruct.h>
+ ]])],
+ [have_dristruct_h="yes"], [have_dristruct_h="no"],[-])
+        CPPFLAGS="$save_CPPFLAGS"
fi
AC_MSG_CHECKING([whether to include DRI support])
@@ -100,7 +107,6 @@ AC_MSG_RESULT([$DRI])
AM_CONDITIONAL(DRI, test "x$DRI" = xyes)
if test "x$DRI" = xyes; then
- PKG_CHECK_MODULES(DRI, [libdrm >= 2.0 xf86driproto glproto])
AC_DEFINE(XF86DRI,1,[Enable DRI driver support])
AC_DEFINE(XF86DRI_DEVEL,1,[Enable developmental DRI driver support])
fi
</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>