Mesa (master): configure.ac: check for libexpat when no pkg-config is available

Iago Toral Quiroga itoral at kemper.freedesktop.org
Wed Oct 15 07:00:47 UTC 2014


Module: Mesa
Branch: master
Commit: 657764c21c1339132b6ef381436b9200839dc227
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=657764c21c1339132b6ef381436b9200839dc227

Author: Andres Gomez <agomez at igalia.com>
Date:   Tue Oct  7 17:32:17 2014 +0300

configure.ac: check for libexpat when no pkg-config is available

Previously, when no pkg-config was available for
libexpat we would just add the needed linking
flags without any extra check.

Now, we check that the library and the headers are
also installed in the building environment.

Reviewed-by: Emil Velikov <emil.l.velikov at gmail.com>

---

 configure.ac |   15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/configure.ac b/configure.ac
index 59b90e6..0ed9325 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1126,14 +1126,13 @@ if test "x$enable_dri" = xyes; then
     fi
 
     # Check for expat
-    PKG_CHECK_EXISTS([expat], [have_expat=yes], [have_expat=no])
-    if test "x$have_expat" = "xyes"; then
-       PKG_CHECK_MODULES([EXPAT], [expat], [],
-                         AC_MSG_ERROR([Expat required for DRI.]))
-    else
-       # expat version 2.0 and earlier do not provide expat.pc
-       EXPAT_LIBS=-lexpat
-    fi
+    PKG_CHECK_MODULES([EXPAT], [expat], [],
+        # expat version 2.0 and earlier do not provide expat.pc
+        [AC_CHECK_HEADER([expat.h],[],
+                         [AC_MSG_ERROR([Expat headers required for DRI not found])])
+         AC_CHECK_LIB([expat],[XML_ParserCreate],[],
+                     [AC_MSG_ERROR([Expat library required for DRI not found])])
+         EXPAT_LIBS="-lexpat"])
 
     DRICOMMON_NEED_LIBDRM=no
     # If we are building any DRI driver other than swrast.




More information about the mesa-commit mailing list