Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ tags
.cproject
.project
obj
zookeeper-server/src/main/resources/lib/ant-eclipse-*
zookeeper-server/src/main/resources/lib/ivy-*
zookeeper-server/src/main/java/org/apache/zookeeper/version/Info.java
zookeeper-server/src/main/java/org/apache/zookeeper/version/VersionInfoMain.java
zookeeper-server/src/test/resources/
zookeeper-client/zookeeper-client-c/Makefile.in
zookeeper-client/zookeeper-client-c/aclocal.m4
zookeeper-client/zookeeper-client-c/autom4te.cache/
Expand All @@ -80,12 +85,23 @@ zookeeper-client/zookeeper-client-c/depcomp
zookeeper-client/zookeeper-client-c/install-sh
zookeeper-client/zookeeper-client-c/ltmain.sh
zookeeper-client/zookeeper-client-c/missing
zookeeper-client/zookeeper-client-c/.deps/
zookeeper-client/zookeeper-client-c/.libs/
zookeeper-client/zookeeper-client-c/Makefile
zookeeper-client/zookeeper-client-c/cli_mt
zookeeper-client/zookeeper-client-c/cli_st
zookeeper-client/zookeeper-client-c/config.h
zookeeper-client/zookeeper-client-c/config.status
zookeeper-client/zookeeper-client-c/libtool
zookeeper-client/zookeeper-client-c/load_gen
zookeeper-client/zookeeper-client-c/stamp-h1
zookeeper-client/zookeeper-client-c/build
zookeeper-client/zookeeper-client-c/core.*
zookeeper-client/zookeeper-client-c/TEST-*.txt
zookeeper-client/zookeeper-client-c/*.la
zookeeper-client/zookeeper-client-c/*.lo
zookeeper-client/zookeeper-client-c/*.o
zookeeper-client/zookeeper-client-c/generated/
zookeeper-server/src/main/resources/lib/ant-eclipse-*
zookeeper-server/src/main/resources/lib/ivy-*
zookeeper-server/src/main/java/org/apache/zookeeper/version/Info.java
zookeeper-server/src/main/java/org/apache/zookeeper/version/VersionInfoMain.java

# Python
*.py[cod]
6 changes: 4 additions & 2 deletions README_packaging.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,23 @@ http://bigtop.apache.org/

## Requirements

- ant (recommended version 1.9.4 or later for concurrent JUnit test execution) or maven to build the java code
- gcc, cppunit and python-setuptools are required to build C and python bindings.
- you need maven to build the java code
- gcc, cppunit, openssl and python-setuptools are required to build C and python bindings. (only needed when using `-Pfull-build`)

On RHEL machine:

```
yum install cppunit
yum install python-setuptools
yum install openssl openssl-devel
```

On Ubuntu:

```
apt-get install cppunit
apt-get install python-setuptools
apt-get install openssl libssl-dev
```


Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,7 @@
<exclude>src/hashtable/*</exclude>
<exclude>include/winconfig.h</exclude>
<exclude>tests/wrappers.opt</exclude>
<exclude>tests/quorum.cfg</exclude>
<exclude>tests/zoo.cfg</exclude>
<exclude>tests/wrappers-mt.opt</exclude>
<exclude>**/c-doc.Doxyfile</exclude>
</excludes>
Expand Down
14 changes: 14 additions & 0 deletions zookeeper-client/zookeeper-client-c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,19 @@ target_link_libraries(zookeeper PUBLIC
$<$<PLATFORM_ID:Linux>:rt> # clock_gettime
$<$<PLATFORM_ID:Windows>:ws2_32>) # Winsock 2.0

option(WITH_OPENSSL "openssl directory" OFF)
if(WITH_OPENSSL)
target_compile_definitions(zookeeper PUBLIC HAVE_OPENSSL_H)
include_directories(${WITH_OPENSSL}/include)
link_directories(${WITH_OPENSSL}/lib)
if(WIN32)
target_link_libraries(zookeeper PUBLIC ssleay32 libeay32)
else()
target_link_libraries(zookeeper PUBLIC ssl crypto)
endif()

endif()

if(WANT_SYNCAPI AND NOT WIN32)
find_package(Threads REQUIRED)
target_link_libraries(zookeeper PUBLIC Threads::Threads)
Expand Down Expand Up @@ -224,6 +237,7 @@ if(WANT_SYNCAPI)
endif()

if(WANT_CPPUNIT)
set (CMAKE_CXX_STANDARD 11)
add_executable(zktest ${test_sources})
target_include_directories(zktest PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})

Expand Down
18 changes: 12 additions & 6 deletions zookeeper-client/zookeeper-client-c/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,28 @@
include $(top_srcdir)/aminclude.am

AUTOMAKE_OPTIONS = serial-tests

if SOLARIS
SOLARIS_CPPFLAGS = -D_POSIX_PTHREAD_SEMANTICS
SOLARIS_LIB_LDFLAGS = -lnsl -lsocket
endif
AM_CPPFLAGS = -I${srcdir}/include -I${srcdir}/tests -I${srcdir}/generated $(SOLARIS_CPPFLAGS)

if WANT_OPENSSL
OPENSSL_CPPFLAGS = -DHAVE_OPENSSL_H -I$(OPENSSL_DIR)
OPENSSL_LIB_LDFLAGS = -lssl -lcrypto
endif

AM_CPPFLAGS = -I${srcdir}/include -I${srcdir}/tests -I${srcdir}/generated $(SOLARIS_CPPFLAGS) $(OPENSSL_CPPFLAGS)
AM_CFLAGS = -Wall -Werror -Wdeclaration-after-statement
AM_CXXFLAGS = -Wall $(USEIPV6)
LIB_LDFLAGS = -no-undefined -version-info 2 $(SOLARIS_LIB_LDFLAGS) $(OPENSSL_LIB_LDFLAGS)

# Additional flags for coverage testing (if enabled)
if ENABLEGCOV
AM_CFLAGS += -fprofile-arcs -ftest-coverage
AM_LDFLAGS = -lgcov
endif

LIB_LDFLAGS = -no-undefined -version-info 2 $(SOLARIS_LIB_LDFLAGS)

pkginclude_HEADERS = include/zookeeper.h include/zookeeper_version.h include/zookeeper_log.h include/proto.h include/recordio.h generated/zookeeper.jute.h
EXTRA_DIST=LICENSE

Expand Down Expand Up @@ -107,7 +113,7 @@ TEST_SOURCES = \
tests/ZooKeeperQuorumServer.h \
tests/TestReadOnlyClient.cc \
tests/TestLogClientEnv.cc \
tests/TestServerRequireClientSASLAuth.cc \
tests/TestServerRequireClientSASLAuth.cc \
$(NULL)

if SOLARIS
Expand All @@ -121,14 +127,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) -ldl
zktest_st_LDADD = libzkst.la libhashtable.la $(CPPUNIT_LIBS) $(OPENSSL_LIB_LDFLAGS) -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) -ldl
zktest_mt_LDADD = libzkmt.la libhashtable.la -lpthread $(CPPUNIT_LIBS) $(OPENSSL_LIB_LDFLAGS) -ldl
zktest_mt_CXXFLAGS = -DUSE_STATIC_LIB -DTHREADED $(CPPUNIT_CFLAGS) $(USEIPV6)
if SOLARIS
SHELL_SYMBOL_WRAPPERS_MT = cat ${srcdir}/tests/wrappers-mt.opt
Expand Down
24 changes: 24 additions & 0 deletions zookeeper-client/zookeeper-client-c/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ DX_INIT_DOXYGEN([zookeeper],[c-doc.Doxyfile],[docs])

# initialize automake
AM_INIT_AUTOMAKE([-Wall foreign])

AC_CONFIG_HEADER([config.h])

# Checks for programs.
Expand All @@ -37,6 +38,26 @@ else
CHECK_CPPUNIT(1.10.2)
fi

AM_CONDITIONAL([WANT_OPENSSL],[test "x$with_openssl" != x])


AC_ARG_WITH(openssl,
AS_HELP_STRING([--without-openssl],
[Do not use Openssl. Default: auto-detect]), [
case "$with_openssl" in
yes|no)
: # Nothing special to do here
;;
*)
if test ! -d "$withval" ; then
AC_MSG_ERROR([--with-openssl path does not point to a directory])
fi
OPENSSL_DIR="$withval"
AC_SUBST(OPENSSL_DIR)
esac
])
AH_TEMPLATE(USE_OPENSSL,[Openssl support is available])

if test "$CALLER" = "ANT" ; then
CPPUNIT_CFLAGS="$CPPUNIT_CFLAGS -DZKSERVER_CMD=\"\\\"${base_dir}/zookeeper-client/zookeeper-client-c/tests/zkServer.sh\\\"\""
else
Expand Down Expand Up @@ -92,6 +113,9 @@ AC_MSG_CHECKING([whether to enable gcov])
AS_IF([test "x${enable_gcov}" = "xyes"],AC_MSG_RESULT([yes]),AC_MSG_RESULT([no]))
AM_CONDITIONAL([ENABLEGCOV],[test "x${enable_gcov}" = "xyes"])


CXXFLAGS="$CXXFLAGS -std=c++11"

AC_ARG_WITH([syncapi],
[AS_HELP_STRING([--with-syncapi],[build with support for SyncAPI [default=yes]])],
[],[with_syncapi=yes])
Expand Down
Loading