This is an automated email from the ASF dual-hosted git repository.
andor pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/zookeeper.git
The following commit(s) were added to refs/heads/master by this push:
new b357727 ZOOKEEPER-3034: Facing issues while building from source
b357727 is described below
commit b3577278ab23f142fdb104a07bd61fbc74a4f152
Author: Balazs Meszaros <[email protected]>
AuthorDate: Tue Feb 26 16:31:46 2019 +0100
ZOOKEEPER-3034: Facing issues while building from source
Added a new macro (CHECK_CPPUNIT) which tries to use AM_PATH_CPPUNIT or
PKG_CHECK_MODULES.
Author: Balazs Meszaros <[email protected]>
Reviewers: [email protected]
Closes #803 from meszibalu/my/autoconf
---
zookeeper-client/zookeeper-client-c/Makefile.am | 4 ++--
zookeeper-client/zookeeper-client-c/acinclude.m4 | 15 +++++++++++++++
zookeeper-client/zookeeper-client-c/configure.ac | 2 +-
3 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/zookeeper-client/zookeeper-client-c/Makefile.am
b/zookeeper-client/zookeeper-client-c/Makefile.am
index 0dcfca3..059b22e 100644
--- a/zookeeper-client/zookeeper-client-c/Makefile.am
+++ b/zookeeper-client/zookeeper-client-c/Makefile.am
@@ -120,14 +120,14 @@ check_PROGRAMS = zktest-st
TESTS_ENVIRONMENT = ZKROOT=${srcdir}/../.. \
CLASSPATH=$$CLASSPATH:$$CLOVER_HOME/lib/clover*.jar
nodist_zktest_st_SOURCES = $(TEST_SOURCES)
-zktest_st_LDADD = libzkst.la libhashtable.la $(CPPUNIT_LIBS)
+zktest_st_LDADD = libzkst.la libhashtable.la $(CPPUNIT_LIBS) -ldl
zktest_st_CXXFLAGS = -DUSE_STATIC_LIB $(CPPUNIT_CFLAGS) $(USEIPV6)
$(SOLARIS_CPPFLAGS)
zktest_st_LDFLAGS = -shared $(SYMBOL_WRAPPERS) $(SOLARIS_LIB_LDFLAGS)
if WANT_SYNCAPI
check_PROGRAMS += zktest-mt
nodist_zktest_mt_SOURCES = $(TEST_SOURCES) tests/PthreadMocks.cc
- zktest_mt_LDADD = libzkmt.la libhashtable.la -lpthread $(CPPUNIT_LIBS)
+ zktest_mt_LDADD = libzkmt.la libhashtable.la -lpthread $(CPPUNIT_LIBS) -ldl
zktest_mt_CXXFLAGS = -DUSE_STATIC_LIB -DTHREADED $(CPPUNIT_CFLAGS) $(USEIPV6)
if SOLARIS
SHELL_SYMBOL_WRAPPERS_MT = cat ${srcdir}/tests/wrappers-mt.opt
diff --git a/zookeeper-client/zookeeper-client-c/acinclude.m4
b/zookeeper-client/zookeeper-client-c/acinclude.m4
index a4d405a..9734f21 100644
--- a/zookeeper-client/zookeeper-client-c/acinclude.m4
+++ b/zookeeper-client/zookeeper-client-c/acinclude.m4
@@ -310,3 +310,18 @@ esac
#echo DX_FLAG_ps=$DX_FLAG_ps
#echo DX_ENV=$DX_ENV
])
+
+# CHECK_CPPUNIT
+# ------------------
+# Check for cppunit presence.
+AC_DEFUN([CHECK_CPPUNIT], [
+ ifdef(
+ [AM_PATH_CPPUNIT],
+ [AM_PATH_CPPUNIT($1)],
+ [ifdef(
+ [PKG_CHECK_MODULES],
+ [PKG_CHECK_MODULES([CPPUNIT], [cppunit >= $1])],
+ [m4_fatal([Missing AM_PATH_CPPUNIT or PKG_CHECK_MODULES m4 macro.])]
+ )]
+ )
+])
diff --git a/zookeeper-client/zookeeper-client-c/configure.ac
b/zookeeper-client/zookeeper-client-c/configure.ac
index 1e2e4b6..1ecd17d 100644
--- a/zookeeper-client/zookeeper-client-c/configure.ac
+++ b/zookeeper-client/zookeeper-client-c/configure.ac
@@ -34,7 +34,7 @@ if test "$with_cppunit" = "no" ; then
CPPUNIT_INCLUDE=
CPPUNIT_LIBS=
else
- AM_PATH_CPPUNIT(1.10.2)
+ CHECK_CPPUNIT(1.10.2)
fi
if test "$CALLER" = "ANT" ; then