configure.ac: check for libexpat when no pkg-config is available
authorAndres Gomez <agomez@igalia.com>
Tue, 7 Oct 2014 14:32:17 +0000 (17:32 +0300)
committerIago Toral Quiroga <itoral@igalia.com>
Wed, 15 Oct 2014 06:59:12 +0000 (08:59 +0200)
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@gmail.com>
configure.ac

index 59b90e6cbfc8b7488cbd8babdf6d66e3e39c1b17..0ed9325449051b800b11000399e72669a4458217 100644 (file)
@@ -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.