Omit result about xml2-config
[m4-moved-to-github.git] / yaz_libxml2.m4
index 699adc1..5f3641d 100644 (file)
@@ -1,5 +1,6 @@
 AC_DEFUN([YAZ_LIBXML2],[
 AC_PATH_PROG(pkgconfigpath, pkg-config, NONE)
+pkgmodule=""
 xml2dir=default
 XML2_VER=""
 AC_ARG_WITH(xml2,[[  --with-xml2[=PREFIX]    use libxml2 in PREFIX]],xml2dir=$withval)
@@ -27,16 +28,15 @@ if test "$xml2dir" != "no"; then
        XML2_CFLAGS=`$pkgconfigpath --cflags $pkgmodule`
        XML2_VER=`$pkgconfigpath --modversion $pkgmodule`
        AC_MSG_RESULT($XML2_VER)
-       AC_DEFINE(HAVE_XML2)
+       m4_default([$1],[AC_DEFINE(HAVE_XML2)])
     elif test -x $xml2dir/bin/xml2-config; then
        XML2_LIBS=`$xml2dir/bin/xml2-config --libs`
        XML2_CFLAGS=`$xml2dir/bin/xml2-config --cflags`
        XML2_VER=`$xml2dir/bin/xml2-config --version`
        AC_MSG_RESULT($XML2_VER)
-       AC_DEFINE(HAVE_XML2)
+       m4_default([$1],[AC_DEFINE(HAVE_XML2)])
     else
        AC_MSG_RESULT(Not found)
-       
        if test "$xml2dir" = "default"; then
            AC_MSG_WARN([libxml2 development libraries not found.])
            AC_MSG_WARN([There will be no support for SRU.])
@@ -48,8 +48,9 @@ fi
 ])
 
 AC_DEFUN([YAZ_LIBXSLT],[
-       xsltdir=default
 pkgmodule=""
+xsltdir=default
+yaz_xslt_pkgconfig=no
 XSLT_VER=""
 AC_ARG_WITH(xslt,[[  --with-xslt[=PREFIX]    use libXSLT in PREFIX]],xsltdir=$withval)
 
@@ -79,13 +80,14 @@ if test "$xsltdir" != "no"; then
        XML2_CFLAGS=`$pkgconfigpath --cflags $pkgmodule`
        XSLT_VER=`$pkgconfigpath --modversion $pkgmodule`
        AC_MSG_RESULT($XSLT_VER)
-       AC_DEFINE(HAVE_XSLT)
+       m4_default([$1],[AC_DEFINE(HAVE_XSLT)])
+       yaz_xslt_pkgconfig=yes
     elif test -x $xsltdir/bin/xslt-config; then
        XML2_LIBS=`$xsltdir/bin/xslt-config --libs`
        XML2_CFLAGS=`$xsltdir/bin/xslt-config --cflags`
        XSLT_VER=`$xsltdir/bin/xslt-config --version`
        AC_MSG_RESULT($XSLT_VER)
-       AC_DEFINE(HAVE_XSLT)
+       m4_default([$1],[AC_DEFINE(HAVE_XSLT)])
     else
        AC_MSG_RESULT(Not found)
        
@@ -114,11 +116,15 @@ fi
 if test "$exsltdir" != "no"; then
     AC_MSG_CHECKING(for libEXSLT)
     if test "$pkgmodule"; then
-       XML2_LIBS=`$pkgconfigpath --libs $pkgmodule`
-       XML2_CFLAGS=`$pkgconfigpath --cflags $pkgmodule`
-       EXSLT_VER=`$pkgconfigpath --modversion $pkgmodule`
-       AC_MSG_RESULT($EXSLT_VER)
-       AC_DEFINE(HAVE_EXSLT)
+       if test "$yaz_xslt_pkgconfig" != "yes"; then
+           AC_MSG_RESULT([Disabled. Libxslt is not pkg-config configured])
+       else
+           XML2_LIBS=`$pkgconfigpath --libs $pkgmodule`
+           XML2_CFLAGS=`$pkgconfigpath --cflags $pkgmodule`
+           EXSLT_VER=`$pkgconfigpath --modversion $pkgmodule`
+           AC_MSG_RESULT($EXSLT_VER)
+           m4_default([$1],[AC_DEFINE(HAVE_EXSLT)])
+       fi
     else
        AC_MSG_RESULT(Not found)