Mesa (master): automake: handle expat version pre 2.1

Emil Velikov evelikov at kemper.freedesktop.org
Wed Oct 30 22:06:25 UTC 2013


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

Author: Emil Velikov <emil.l.velikov at gmail.com>
Date:   Wed Oct 30 00:03:43 2013 +0000

automake: handle expat version pre 2.1

Commit aec20d66d9d13e0acd6a7199b63e1383e1e9900a
(automake: properly handle non-default expat installation),
assumed that up-to date distributions use a recent version
of expat that handles security vunerabilities CVE-2012-1147
and CVE-2012-1148. Seems like this is not always the case
and they prefer to backport only the fix, rather than use
the updated library.

This commit adds a default case -lexpat whenever expat is
not found, while properly handling expat.pc if present.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71022
Reported-By: Bryce Harrington <b.harrington at samsung.com>
Reported-By: Vinson Lee <vlee at freedesktop.org>
Tested-by: Bryce Harrington <b.harrington at samsung.com>
Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>

---

 configure.ac |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index 8ba4fee..f94c9b9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1005,9 +1005,14 @@ if test "x$enable_dri" = xyes; then
     DRI_DIRS=`echo "$DRI_DIRS" | $SED 's/  */ /g'`
 
     # Check for expat
-    PKG_CHECK_MODULES([EXPAT], [expat], [],
-                      AC_MSG_ERROR([Expat required for DRI.]))
-
+    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
 
     # If we are building any DRI driver other than swrast.
     if test -n "$DRI_DIRS"; then




More information about the mesa-commit mailing list