]> git.street.me.uk Git - andy/viking.git/blame - m4/expat.m4
Replace remaining gettext calls with '_'
[andy/viking.git] / m4 / expat.m4
CommitLineData
fa1b5a5f
GB
1dnl Expat macro retrived on the Expat CVS
2
3dnl Check if --with-expat[=PREFIX] is specified and
4dnl Expat >= 1.95.0 is installed in the system.
5dnl If yes, substitute EXPAT_CFLAGS, EXPAT_LIBS with regard to
6dnl the specified PREFIX and set with_expat to PREFIX, or 'yes' if PREFIX
7dnl has not been specified. Also HAVE_LIBEXPAT, HAVE_EXPAT_H are defined.
8dnl If --with-expat has not been specified, set with_expat to 'no'.
9dnl In addition, an Automake conditional EXPAT_INSTALLED is set accordingly.
10dnl This is necessary to adapt a whole lot of packages that have expat
11dnl bundled as a static library.
7a43153e 12AC_DEFUN([AM_WITH_EXPAT],
fa1b5a5f
GB
13[ AC_ARG_WITH(expat,
14 [ --with-expat=PREFIX Use system Expat library],
15 , with_expat=yes)
16
17 AM_CONDITIONAL(EXPAT_INSTALLED, test $with_expat != no)
18
19 EXPAT_CFLAGS=
20 EXPAT_LIBS=
21 if test $with_expat != no; then
22 if test $with_expat != yes; then
23 EXPAT_CFLAGS="-I$with_expat/include"
24 EXPAT_LIBS="-L$with_expat/lib"
25 fi
26 AC_CHECK_LIB(expat, XML_ParserCreate,
27 [ EXPAT_LIBS="$EXPAT_LIBS -lexpat"
28 expat_found=yes ],
29 [ expat_found=no ],
30 "$EXPAT_LIBS")
31 if test $expat_found = no; then
32 AC_MSG_ERROR([Could not find the Expat library])
33 fi
34 expat_save_CFLAGS="$CFLAGS"
35 CFLAGS="$CFLAGS $EXPAT_CFLAGS"
36 AC_CHECK_HEADERS(expat.h, , expat_found=no)
37 if test $expat_found = no; then
38 AC_MSG_ERROR([Could not find expat.h])
39 fi
40 CFLAGS="$expat_save_CFLAGS"
41 fi
42
43 AC_SUBST(EXPAT_CFLAGS)
44 AC_SUBST(EXPAT_LIBS)
45])