Skip to content

Commit

Permalink
Merge remote-tracking branch 'apache/master' into ZOOKEEPER-3188
Browse files Browse the repository at this point in the history
  • Loading branch information
symat authored and Mate Szalay-Beko committed Nov 28, 2019
2 parents 356882d + 8e89050 commit 3c6fc52
Show file tree
Hide file tree
Showing 64 changed files with 2,078 additions and 316 deletions.
24 changes: 20 additions & 4 deletions .gitignore
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
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
3 changes: 0 additions & 3 deletions excludeFindBugsFilter.xml
Expand Up @@ -7,8 +7,5 @@
<!-- this problem is to be addressed in ZOOKEEPER-3227 -->
<Bug pattern="DM_DEFAULT_ENCODING"/>

<!-- not really a problem -->
<Bug pattern="DM_EXIT"/>

</FindBugsFilter>

6 changes: 3 additions & 3 deletions pom.xml
Expand Up @@ -280,7 +280,7 @@
<commons-cli.version>1.2</commons-cli.version>
<netty.version>4.1.42.Final</netty.version>
<jetty.version>9.4.18.v20190429</jetty.version>
<jackson.version>2.9.10</jackson.version>
<jackson.version>2.9.10.1</jackson.version>
<json.version>1.1.1</json.version>
<jline.version>2.11</jline.version>
<snappy.version>1.1.7</snappy.version>
Expand Down Expand Up @@ -574,7 +574,7 @@
<plugin>
<groupId>org.owasp</groupId>
<artifactId>dependency-check-maven</artifactId>
<version>5.2.1</version>
<version>5.2.4</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down 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
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
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
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

0 comments on commit 3c6fc52

Please sign in to comment.