1
dnl Check if --with-expat[=PREFIX] is specified and
2
dnl Expat >= 1.95.0 is installed in the system.
3
dnl If yes, substitute EXPAT_CFLAGS, EXPAT_LIBS with regard to
4
dnl the specified PREFIX and set with_expat to PREFIX, or 'yes' if PREFIX
5
dnl has not been specified. Also HAVE_LIBEXPAT, HAVE_EXPAT_H are defined.
6
dnl If --with-expat has not been specified, set with_expat to 'no'.
7
dnl In addition, an Automake conditional EXPAT_INSTALLED is set accordingly.
8
dnl This is necessary to adapt a whole lot of packages that have expat
9
dnl bundled as a static library.
10
AC_DEFUN(AM_WITH_EXPAT,
12
[ --with-expat=PREFIX Use system Expat library],
15
AM_CONDITIONAL(EXPAT_INSTALLED, test $with_expat != no)
19
if test $with_expat != no; then
20
if test $with_expat != yes; then
21
EXPAT_CFLAGS="-I$with_expat/include"
22
EXPAT_LIBS="-L$with_expat/lib"
24
AC_CHECK_LIB(expat, XML_ParserCreate,
25
[ EXPAT_LIBS="$EXPAT_LIBS -lexpat"
29
if test $expat_found = no; then
30
AC_MSG_ERROR([Could not find the Expat library])
32
expat_save_CFLAGS="$CFLAGS"
33
CFLAGS="$CFLAGS $EXPAT_CFLAGS"
34
AC_CHECK_HEADERS(expat.h, , expat_found=no)
35
if test $expat_found = no; then
36
AC_MSG_ERROR([Could not find expat.h])
38
CFLAGS="$expat_save_CFLAGS"
41
AC_SUBST(EXPAT_CFLAGS)