diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-11-29 21:24:28 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-01-19 22:27:17 +0300 |
commit | a0366810ba246c5a84dd5e32af4a23dc799cc7f3 (patch) | |
tree | 51e76d12db31477b62e3ed82368ceee6c4ec5796 /configure.ac | |
parent | 858d471f921c75d3963acff3dd3022b47c96f5dd (diff) | |
download | mv-a0366810ba246c5a84dd5e32af4a23dc799cc7f3.tar.gz mv-a0366810ba246c5a84dd5e32af4a23dc799cc7f3.tar.bz2 mv-a0366810ba246c5a84dd5e32af4a23dc799cc7f3.tar.xz mv-a0366810ba246c5a84dd5e32af4a23dc799cc7f3.zip |
Add configure flag --enable-libxml.
Supported values:
--enable-libxml=libxml
--enable-libxml=pugixml
default is libxml
Diffstat (limited to 'configure.ac')
-rwxr-xr-x | configure.ac | 50 |
1 files changed, 43 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac index 0f149680b..0cc55b569 100755 --- a/configure.ac +++ b/configure.ac @@ -201,14 +201,50 @@ AC_MSG_ERROR([ *** Unable to find CURL library (http://curl.haxx.se/)])) AC_CHECK_HEADERS([curl/curl.h], , AC_MSG_ERROR([ *** CURL library found but cannot find headers (http://curl.haxx.se/)])) -if test -n "$PKG_CONFIG"; then - LIBS="$LIBS `$PKG_CONFIG --libs libxml-2.0`" - CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags libxml-2.0`" + +# select xml lib +AC_ARG_ENABLE(libxml, + AC_HELP_STRING([--enable-libxml=ARG], + [xml libs: libxml (default), pugixml]), + [ + xmllib="${enableval}" + ], + [ + xmllib="libxml" + ] +) + +case $xmllib in + "libxml") + AM_CONDITIONAL(ENABLE_LIBXML, true) + AM_CONDITIONAL(ENABLE_PUGIXML, false) + ;; + "pugixml") + AM_CONDITIONAL(ENABLE_LIBXML, false) + AM_CONDITIONAL(ENABLE_PUGIXML, true) + ;; + *) + AC_MSG_ERROR([[Wrong xml lib name]]) + ;; +esac + +if test "$xmllib" == "libxml"; then + if test -n "$PKG_CONFIG"; then + LIBS="$LIBS `$PKG_CONFIG --libs libxml-2.0`" + CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags libxml-2.0`" + fi + AC_CHECK_LIB([xml2], [xmlInitParser], , + AC_MSG_ERROR([ *** Unable to find libxml2 library (http://xmlsoft.org/)])) + AC_CHECK_HEADERS([libxml/xmlreader.h], , + AC_MSG_ERROR([ *** libxml2 library found but cannot find headers (http://xmlsoft.org/)])) +fi + +if test "$xmllib" == "pugixml"; then + AC_CHECK_LIB([pugixml], [main], , + AC_MSG_ERROR([ *** Unable to find pugixml library (http://pugixml.org/)])) + AC_CHECK_HEADERS([pugixml.hpp], , + AC_MSG_ERROR([ *** pugixml library found but cannot find headers (http://pugixml.org/)])) fi -AC_CHECK_LIB([xml2], [xmlInitParser], , -AC_MSG_ERROR([ *** Unable to find libxml2 library (http://xmlsoft.org/)])) -AC_CHECK_HEADERS([libxml/xmlreader.h], , -AC_MSG_ERROR([ *** libxml2 library found but cannot find headers (http://xmlsoft.org/)])) AC_CHECK_LIB(png, png_write_info, , AC_MSG_ERROR([ *** Unable to find png library])) |