[xmltooling] 02/19: Use pkg-config for log4shib/log4cpp

Ferenc Wágner wferi-guest at moszumanska.debian.org
Thu Jul 21 18:18:58 UTC 2016


This is an automated email from the git hooks/post-receive script.

wferi-guest pushed a commit to branch patch-queue/debian/experimental
in repository xmltooling.

commit c6b8435181fd11525addd76da6de8f137eefa75f
Author: Ferenc Wágner <wferi at niif.hu>
Date:   Mon Jun 20 11:11:46 2016 +0200

    Use pkg-config for log4shib/log4cpp
---
 configure.ac           | 53 ++++----------------------------------------------
 xmltooling/Makefile.am |  4 ++++
 2 files changed, 8 insertions(+), 49 deletions(-)

diff --git a/configure.ac b/configure.ac
index f1cfa29..227b3b9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -117,55 +117,10 @@ AC_COMPILE_IFELSE(
     [AC_LANG_PROGRAM([[#include <cstddef>]],[[const char* ptr = nullptr;]])],
     [AC_DEFINE([HAVE_NULLPTR],[1],[Define to 1 if C++ compiler supports nullptr keyword.])])
 
-# log4shib settings (favor this version over the log4cpp code)
-AC_PATH_PROG(LOG4SHIB_CONFIG,log4shib-config)
-AC_ARG_WITH(log4shib,
-    AS_HELP_STRING([--with-log4shib=PATH],[where log4shib-config is installed]),
-    [
-    LOG4SHIB_CONFIG="${with_log4shib}"
-    if ! test -f "${LOG4SHIB_CONFIG}" ; then
-    	LOG4SHIB_CONFIG="${with_log4shib}/bin/log4shib-config"
-    fi
-    ])
-if test -f "${LOG4SHIB_CONFIG}" ; then
-    LIBS="`${LOG4SHIB_CONFIG} --libs` $LIBS"
-    CPPFLAGS="`${LOG4SHIB_CONFIG} --cflags` $CPPFLAGS"
-    AC_CHECK_HEADER([log4shib/CategoryStream.hh],,AC_MSG_ERROR([unable to find log4shib header files]))
-    AC_LINK_IFELSE(
-        [AC_LANG_PROGRAM([[#include <log4shib/Category.hh>
-#include <log4shib/CategoryStream.hh>]],
-            [[log4shib::Category::getInstance("foo").errorStream() << log4shib::eol]])],
-        [AC_DEFINE([XMLTOOLING_LOG4SHIB],[1],[Define to 1 if log4shib library is used.])],
-        [AC_MSG_ERROR([unable to link with log4shib])])
-else
-    AC_MSG_WARN([log4shib-config not found, may need to use --with-log4shib option])
-    AC_MSG_WARN([will look for original log4cpp library])
-    
-    # log4cpp settings
-    AC_PATH_PROG(LOG4CPP_CONFIG,log4cpp-config)
-    AC_ARG_WITH(log4cpp,
-        AS_HELP_STRING([--with-log4cpp=PATH],[where log4cpp-config is installed]),
-        [
-        LOG4CPP_CONFIG="${with_log4cpp}"
-        if ! test -f "${LOG4CPP_CONFIG}" ; then
-        	LOG4CPP_CONFIG="${with_log4cpp}/bin/log4cpp-config"
-        fi
-        ])
-    if test -f "${LOG4CPP_CONFIG}"; then
-        AC_MSG_WARN([will try to use log4cpp, note that most non-Internet2 supplied versions are not thread-safe])
-        LIBS="`${LOG4CPP_CONFIG} --libs` $LIBS"
-        CPPFLAGS="`${LOG4CPP_CONFIG} --cflags` $CPPFLAGS"
-        AC_CHECK_HEADER([log4cpp/CategoryStream.hh],,AC_MSG_ERROR([unable to find log4cpp header files]))
-        AC_LINK_IFELSE(
-            [AC_LANG_PROGRAM([[#include <log4cpp/Category.hh>
-#include <log4cpp/CategoryStream.hh>]],
-                [[log4cpp::Category::getInstance("foo").errorStream() << log4cpp::eol]])],
-            [AC_DEFINE([XMLTOOLING_LOG4CPP],[1],[Define to 1 if log4cpp library is used.])],
-            [AC_MSG_ERROR([unable to link with log4cpp, need version 1.0 or later])])
-	else
-	    AC_MSG_ERROR([log4cpp-config not found, may need to use --with-log4cpp option])
-	fi
-fi
+PKG_CHECK_MODULES([log4shib], [log4shib],
+    [AC_DEFINE([XMLTOOLING_LOG4SHIB],[1],[Define to 1 if log4shib library is used.])],
+    [PKG_CHECK_MODULES([log4cpp], [log4cpp],
+        [AC_DEFINE([XMLTOOLING_LOG4CPP],[1],[Define to 1 if log4cpp library is used.])])])
 
 # Xerces settings
 AC_ARG_WITH(xerces,
diff --git a/xmltooling/Makefile.am b/xmltooling/Makefile.am
index f265007..701c8fd 100644
--- a/xmltooling/Makefile.am
+++ b/xmltooling/Makefile.am
@@ -207,12 +207,16 @@ libxmltooling_lite_la_SOURCES = \
 	${common_sources}
 libxmltooling_lite_la_CPPFLAGS = -DXMLTOOLING_LITE
 libxmltooling_lite_la_LDFLAGS = -version-info 7:0:0
+libxmltooling_lite_la_CPPFLAGS += $(log4shib_CFLAGS) $(log4cpp_CFLAGS)
+libxmltooling_lite_la_LDFLAGS += $(log4shib_LIBS) $(log4cpp_LIBS)
 
 if BUILD_XMLSEC
 libxmltooling_la_SOURCES = \
 	${common_sources} \
 	${xmlsec_sources}
 libxmltooling_la_LDFLAGS = $(XMLSEC_LIBS) -version-info 7:0:0
+libxmltooling_la_CFLAGS = $(log4shib_CFLAGS) $(log4cpp_CFLAGS)
+libxmltooling_la_LDFLAGS += $(log4shib_LIBS) $(log4cpp_LIBS)
 endif
 
 install-exec-hook:

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-shibboleth/xmltooling.git



More information about the Pkg-shibboleth-devel mailing list