On 2015-01-31 02:23, Bill Spitzak wrote:
On older expat versions there is no pkg-config file, so fall back to
the previous test for the header file and library if it fails.
I agree this a good practice to fallback in this case.
This paritally reverts commit a4afd90f9f0c27ed5f3f313b915c260673f8be34.
---
Makefile.am | 1 -
configure.ac | 7 ++++++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 0fccf86..43b741a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -65,7 +65,6 @@ if ENABLE_SCANNER
wayland_scanner = $(top_builddir)/wayland-scanner
bin_PROGRAMS = wayland-scanner
wayland_scanner_SOURCES = src/scanner.c
-wayland_scanner_CFLAGS = $(EXPAT_CFLAGS) $(AM_CFLAGS)
This hunk is bad. If the pkg-config file provide CFLAGS, they must be
used. And there is no harm at all to use an undefined variable here.
(And I think we should just define it empty in the fallback.)
wayland_scanner_LDADD = $(EXPAT_LIBS) libwayland-util.la
$(BUILT_SOURCES) : wayland-scanner
pkgconfig_DATA += src/wayland-scanner.pc
diff --git a/configure.ac b/configure.ac
index 97222f0..f7610e0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -85,7 +85,12 @@ AC_ARG_WITH(icondir, [ --with-icondir=<dir> Look for
cursor icons here],
AC_SUBST([ICONDIR])
if test "x$enable_scanner" = "xyes"; then
- PKG_CHECK_MODULES(EXPAT, [expat])
+ PKG_CHECK_MODULES(EXPAT, [expat],,
+ [AC_CHECK_HEADERS(expat.h, [AC_DEFINE(HAVE_EXPAT_H)],
HAVE_EXPAT_H is defined by AC_CHECK_HEADERS itself so please remove the
AC_DEFINE.
+ [AC_MSG_ERROR([Can't find expat.h. Please install expat.])])
+ AC_CHECK_LIB(expat, XML_ParserCreate, [EXPAT_LIBS="-lexpat"],
If we re-introduce such check, we should use AC_SEARCH_LIBS (as advised
by the Autoconf manual[1]).
Here is the code I would use :
EXPAT_CFLAGS=""
EXPAT_LIBS="-lexpat"
AC_SEARCH_LIBS([XML_ParserCreate], [expat],
[
AC_SUBST(EXPAT_CFLAGS)
AC_SUBST(EXPAT_LIBS)
],
[
AC_MSG_ERROR([Can't find expat library. Please install expat.])
])
+ [AC_MSG_ERROR([Can't find expat library. Please install
expat.])])
+ AC_SUBST(EXPAT_LIBS)])
fi
AC_PATH_PROG(XSLTPROC, xsltproc)
[1]
<http://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf.html#Libraries>
--
Quentin “Sardem FF7” Glidic
_______________________________________________
wayland-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/wayland-devel