aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/extras/expat/conftools/expat.m4
diff options
context:
space:
mode:
authorReinhard Tartler <siretart@tauware.de>2011-10-10 17:43:39 +0200
committerReinhard Tartler <siretart@tauware.de>2011-10-10 17:43:39 +0200
commitf4092abdf94af6a99aff944d6264bc1284e8bdd4 (patch)
tree2ac1c9cc16ceb93edb2c4382c088dac5aeafdf0f /nx-X11/extras/expat/conftools/expat.m4
parenta840692edc9c6d19cd7c057f68e39c7d95eb767d (diff)
downloadnx-libs-f4092abdf94af6a99aff944d6264bc1284e8bdd4.tar.gz
nx-libs-f4092abdf94af6a99aff944d6264bc1284e8bdd4.tar.bz2
nx-libs-f4092abdf94af6a99aff944d6264bc1284e8bdd4.zip
Imported nx-X11-3.1.0-1.tar.gznx-X11/3.1.0-1
Summary: Imported nx-X11-3.1.0-1.tar.gz Keywords: Imported nx-X11-3.1.0-1.tar.gz into Git repository
Diffstat (limited to 'nx-X11/extras/expat/conftools/expat.m4')
-rw-r--r--nx-X11/extras/expat/conftools/expat.m443
1 files changed, 43 insertions, 0 deletions
diff --git a/nx-X11/extras/expat/conftools/expat.m4 b/nx-X11/extras/expat/conftools/expat.m4
new file mode 100644
index 000000000..e5d4871c9
--- /dev/null
+++ b/nx-X11/extras/expat/conftools/expat.m4
@@ -0,0 +1,43 @@
+dnl Check if --with-expat[=PREFIX] is specified and
+dnl Expat >= 1.95.0 is installed in the system.
+dnl If yes, substitute EXPAT_CFLAGS, EXPAT_LIBS with regard to
+dnl the specified PREFIX and set with_expat to PREFIX, or 'yes' if PREFIX
+dnl has not been specified. Also HAVE_LIBEXPAT, HAVE_EXPAT_H are defined.
+dnl If --with-expat has not been specified, set with_expat to 'no'.
+dnl In addition, an Automake conditional EXPAT_INSTALLED is set accordingly.
+dnl This is necessary to adapt a whole lot of packages that have expat
+dnl bundled as a static library.
+AC_DEFUN(AM_WITH_EXPAT,
+[ AC_ARG_WITH(expat,
+ [ --with-expat=PREFIX Use system Expat library],
+ , with_expat=no)
+
+ AM_CONDITIONAL(EXPAT_INSTALLED, test $with_expat != no)
+
+ EXPAT_CFLAGS=
+ EXPAT_LIBS=
+ if test $with_expat != no; then
+ if test $with_expat != yes; then
+ EXPAT_CFLAGS="-I$with_expat/include"
+ EXPAT_LIBS="-L$with_expat/lib"
+ fi
+ AC_CHECK_LIB(expat, XML_ParserCreate,
+ [ EXPAT_LIBS="$EXPAT_LIBS -lexpat"
+ expat_found=yes ],
+ [ expat_found=no ],
+ "$EXPAT_LIBS")
+ if test $expat_found = no; then
+ AC_MSG_ERROR([Could not find the Expat library])
+ fi
+ expat_save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $EXPAT_CFLAGS"
+ AC_CHECK_HEADERS(expat.h, , expat_found=no)
+ if test $expat_found = no; then
+ AC_MSG_ERROR([Could not find expat.h])
+ fi
+ CFLAGS="$expat_save_CFLAGS"
+ fi
+
+ AC_SUBST(EXPAT_CFLAGS)
+ AC_SUBST(EXPAT_LIBS)
+])