autoconf: Fix build of dri symbols test to not manually link expat.
authorEric Anholt <eric@anholt.net>
Wed, 18 Jan 2012 19:27:24 +0000 (11:27 -0800)
committerEric Anholt <eric@anholt.net>
Mon, 23 Jan 2012 19:34:05 +0000 (11:34 -0800)
AC_CHECK_LIB has this nasty behavior, like the cflags tests, of
automatically putting the tested value into the global LIBS on
success.  This caused -lexpat to end up in LIBS, but without the
--with-expat dir, so my 32-bit build on a 64 system using expat from a
custom prefix could only find the system expat and fail to link on the
one current consumer of the LIBS variable: the dri driver test link.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
configure.ac

index c76af5b2401169724c5fda71374020e8f8f9d0d8..b15a4bc399473bb5c6b85279124435fb7d610d6a 100644 (file)
@@ -1231,8 +1231,10 @@ if test "x$enable_dri" = xyes; then
             EXPAT_LIB="-L$withval/$LIB_DIR -lexpat"
             ])
         AC_CHECK_HEADER([expat.h],[],[AC_MSG_ERROR([Expat required for DRI.])])
+       save_LIBS="$LIBS"
         AC_CHECK_LIB([expat],[XML_ParserCreate],[],
             [AC_MSG_ERROR([Expat required for DRI.])])
+       LIBS="$save_LIBS"
     fi
 
     # libdrm is required for all except swrast