[xmltooling] 41/65: New patch Use-pkg-config-for-log4shib-log4cpp.patch
Ferenc Wágner
wferi-guest at moszumanska.debian.org
Thu Jun 30 13:07:40 UTC 2016
This is an automated email from the git hooks/post-receive script.
wferi-guest pushed a commit to branch debian/master
in repository xmltooling.
commit 87fa233a918bf7358f3e3abf0e3b0113bc48b82e
Author: Ferenc Wágner <wferi at niif.hu>
Date: Mon Jun 20 11:14:06 2016 +0200
New patch Use-pkg-config-for-log4shib-log4cpp.patch
Use pkg-config for log4shib/log4cpp
---
.../Use-pkg-config-for-log4shib-log4cpp.patch | 96 ++++++++++++++++++++++
debian/patches/series | 1 +
2 files changed, 97 insertions(+)
diff --git a/debian/patches/Use-pkg-config-for-log4shib-log4cpp.patch b/debian/patches/Use-pkg-config-for-log4shib-log4cpp.patch
new file mode 100644
index 0000000..b844e08
--- /dev/null
+++ b/debian/patches/Use-pkg-config-for-log4shib-log4cpp.patch
@@ -0,0 +1,96 @@
+From: =?utf-8?q?Ferenc_W=C3=A1gner?= <wferi at niif.hu>
+Date: Mon, 20 Jun 2016 11:11:46 +0200
+Subject: Use pkg-config for log4shib/log4cpp
+
+---
+ configure.ac | 53 ++++----------------------------------------------
+ xmltooling/Makefile.am | 7 ++++---
+ 2 files changed, 8 insertions(+), 52 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index ed4b044..8fece15 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -117,55 +117,10 @@ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[]],[[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 39cfa0d..f834221 100644
+--- a/xmltooling/Makefile.am
++++ b/xmltooling/Makefile.am
+@@ -203,14 +203,15 @@ common_sources = \
+
+ libxmltooling_lite_la_SOURCES = \
+ ${common_sources}
+-libxmltooling_lite_la_CPPFLAGS = -DXMLTOOLING_LITE
+-libxmltooling_lite_la_LDFLAGS = -version-info 6:6:0
++libxmltooling_lite_la_CPPFLAGS = -DXMLTOOLING_LITE $(log4shib_CFLAGS) $(log4cpp_CFLAGS)
++libxmltooling_lite_la_LDFLAGS = -version-info 6:6:0 $(log4shib_LIBS) $(log4cpp_LIBS)
+
+ if BUILD_XMLSEC
+ libxmltooling_la_SOURCES = \
+ ${common_sources} \
+ ${xmlsec_sources}
+-libxmltooling_la_LDFLAGS = $(XMLSEC_LIBS) -version-info 6:6:0
++libxmltooling_la_CFLAGS = $(log4shib_CFLAGS) $(log4cpp_CFLAGS)
++libxmltooling_la_LDFLAGS = $(XMLSEC_LIBS) -version-info 6:6:0 $(log4shib_LIBS) $(log4cpp_LIBS)
+ endif
+
+ install-exec-hook:
diff --git a/debian/patches/series b/debian/patches/series
index 71c45d7..a62baff 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
Disable-forcing-of-libtool-silent.patch
Avoid-forward-incompatibility-warnings-from-Automake.patch
+Use-pkg-config-for-log4shib-log4cpp.patch
--
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