This is an automated email from the ASF dual-hosted git repository.

andor pushed a commit to branch branch-3.5
in repository https://gitbox.apache.org/repos/asf/zookeeper.git


The following commit(s) were added to refs/heads/branch-3.5 by this push:
     new eb3b42a  ZOOKEEPER-3034: Facing issues while building from source
eb3b42a is described below

commit eb3b42ab68993a6cf6024d3aed1f58cd2e9729a9
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
    
    (cherry picked from commit b3577278ab23f142fdb104a07bd61fbc74a4f152)
    Signed-off-by: Andor Molnar <[email protected]>
---
 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 f6bb9a7..8f2a07f 100644
--- a/zookeeper-client/zookeeper-client-c/Makefile.am
+++ b/zookeeper-client/zookeeper-client-c/Makefile.am
@@ -119,14 +119,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 d0041d8..d6bc339 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 f4ddd35..511c249 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

Reply via email to