From eea19ad17c5f0a57478dcc336c916cb5d03c7274 Mon Sep 17 00:00:00 2001 From: Tomek Mrugalski Date: Thu, 15 Aug 2019 20:41:24 +0200 Subject: [PATCH] [#625,!485] Fixed conditional intialization detection for log4cplus --- configure.ac | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/configure.ac b/configure.ac index 0a15f6c48f..aff9787ab7 100644 --- a/configure.ac +++ b/configure.ac @@ -1030,6 +1030,12 @@ AC_MSG_RESULT([$LOG4CPLUS_VERSION]) CPPFLAGS=$CPPFLAGS_SAVED LIBS=$LIBS_SAVED +# Older log4cplus versions (1.2.0) don't have the initializer.h header that +# would allow explicit initialization. Newer versions (2.0.4 for sure, possibly +# older as well) have it and it's recommended to use it. We detect whether +# it's present or not and do explicit initalization if possible. +LIBS_SAVED="$LIBS" +LIBS="$LOG4CPLUS_LIBS $LIBS" AC_MSG_CHECKING([log4cplus explicit initialization (log4cplus/initializer.h)]) AC_LINK_IFELSE( [AC_LANG_PROGRAM([#include ], @@ -1038,6 +1044,7 @@ AC_LINK_IFELSE( [AC_MSG_RESULT([yes]) AC_DEFINE(LOG4CPLUS_INITIALIZER_H, [1], [Explicit initialization of log4cplus possible])], [AC_MSG_RESULT(no)]) +LIBS="$LIBS_SAVED" # # Configure Boost header path -- 2.47.3