Skip to content

Commit 3c6fc52

Browse files
symatMate Szalay-Beko
authored andcommitted
Merge remote-tracking branch 'apache/master' into ZOOKEEPER-3188
2 parents 356882d + 8e89050 commit 3c6fc52

64 files changed

Lines changed: 2078 additions & 316 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ tags
6868
.cproject
6969
.project
7070
obj
71+
zookeeper-server/src/main/resources/lib/ant-eclipse-*
72+
zookeeper-server/src/main/resources/lib/ivy-*
73+
zookeeper-server/src/main/java/org/apache/zookeeper/version/Info.java
74+
zookeeper-server/src/main/java/org/apache/zookeeper/version/VersionInfoMain.java
75+
zookeeper-server/src/test/resources/
7176
zookeeper-client/zookeeper-client-c/Makefile.in
7277
zookeeper-client/zookeeper-client-c/aclocal.m4
7378
zookeeper-client/zookeeper-client-c/autom4te.cache/
@@ -80,12 +85,23 @@ zookeeper-client/zookeeper-client-c/depcomp
8085
zookeeper-client/zookeeper-client-c/install-sh
8186
zookeeper-client/zookeeper-client-c/ltmain.sh
8287
zookeeper-client/zookeeper-client-c/missing
88+
zookeeper-client/zookeeper-client-c/.deps/
89+
zookeeper-client/zookeeper-client-c/.libs/
90+
zookeeper-client/zookeeper-client-c/Makefile
91+
zookeeper-client/zookeeper-client-c/cli_mt
92+
zookeeper-client/zookeeper-client-c/cli_st
93+
zookeeper-client/zookeeper-client-c/config.h
94+
zookeeper-client/zookeeper-client-c/config.status
95+
zookeeper-client/zookeeper-client-c/libtool
96+
zookeeper-client/zookeeper-client-c/load_gen
97+
zookeeper-client/zookeeper-client-c/stamp-h1
98+
zookeeper-client/zookeeper-client-c/build
99+
zookeeper-client/zookeeper-client-c/core.*
83100
zookeeper-client/zookeeper-client-c/TEST-*.txt
101+
zookeeper-client/zookeeper-client-c/*.la
102+
zookeeper-client/zookeeper-client-c/*.lo
103+
zookeeper-client/zookeeper-client-c/*.o
84104
zookeeper-client/zookeeper-client-c/generated/
85-
zookeeper-server/src/main/resources/lib/ant-eclipse-*
86-
zookeeper-server/src/main/resources/lib/ivy-*
87-
zookeeper-server/src/main/java/org/apache/zookeeper/version/Info.java
88-
zookeeper-server/src/main/java/org/apache/zookeeper/version/VersionInfoMain.java
89105

90106
# Python
91107
*.py[cod]

README_packaging.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,23 @@ http://bigtop.apache.org/
88

99
## Requirements
1010

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

1414
On RHEL machine:
1515

1616
```
1717
yum install cppunit
1818
yum install python-setuptools
19+
yum install openssl openssl-devel
1920
```
2021

2122
On Ubuntu:
2223

2324
```
2425
apt-get install cppunit
2526
apt-get install python-setuptools
27+
apt-get install openssl libssl-dev
2628
```
2729

2830

excludeFindBugsFilter.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,5 @@
77
<!-- this problem is to be addressed in ZOOKEEPER-3227 -->
88
<Bug pattern="DM_DEFAULT_ENCODING"/>
99

10-
<!-- not really a problem -->
11-
<Bug pattern="DM_EXIT"/>
12-
1310
</FindBugsFilter>
1411

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@
280280
<commons-cli.version>1.2</commons-cli.version>
281281
<netty.version>4.1.42.Final</netty.version>
282282
<jetty.version>9.4.18.v20190429</jetty.version>
283-
<jackson.version>2.9.10</jackson.version>
283+
<jackson.version>2.9.10.1</jackson.version>
284284
<json.version>1.1.1</json.version>
285285
<jline.version>2.11</jline.version>
286286
<snappy.version>1.1.7</snappy.version>
@@ -574,7 +574,7 @@
574574
<plugin>
575575
<groupId>org.owasp</groupId>
576576
<artifactId>dependency-check-maven</artifactId>
577-
<version>5.2.1</version>
577+
<version>5.2.4</version>
578578
</plugin>
579579
<plugin>
580580
<groupId>org.apache.maven.plugins</groupId>
@@ -808,7 +808,7 @@
808808
<exclude>src/hashtable/*</exclude>
809809
<exclude>include/winconfig.h</exclude>
810810
<exclude>tests/wrappers.opt</exclude>
811-
<exclude>tests/quorum.cfg</exclude>
811+
<exclude>tests/zoo.cfg</exclude>
812812
<exclude>tests/wrappers-mt.opt</exclude>
813813
<exclude>**/c-doc.Doxyfile</exclude>
814814
</excludes>

zookeeper-client/zookeeper-client-c/CMakeLists.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,19 @@ target_link_libraries(zookeeper PUBLIC
182182
$<$<PLATFORM_ID:Linux>:rt> # clock_gettime
183183
$<$<PLATFORM_ID:Windows>:ws2_32>) # Winsock 2.0
184184

185+
option(WITH_OPENSSL "openssl directory" OFF)
186+
if(WITH_OPENSSL)
187+
target_compile_definitions(zookeeper PUBLIC HAVE_OPENSSL_H)
188+
include_directories(${WITH_OPENSSL}/include)
189+
link_directories(${WITH_OPENSSL}/lib)
190+
if(WIN32)
191+
target_link_libraries(zookeeper PUBLIC ssleay32 libeay32)
192+
else()
193+
target_link_libraries(zookeeper PUBLIC ssl crypto)
194+
endif()
195+
196+
endif()
197+
185198
if(WANT_SYNCAPI AND NOT WIN32)
186199
find_package(Threads REQUIRED)
187200
target_link_libraries(zookeeper PUBLIC Threads::Threads)
@@ -224,6 +237,7 @@ if(WANT_SYNCAPI)
224237
endif()
225238

226239
if(WANT_CPPUNIT)
240+
set (CMAKE_CXX_STANDARD 11)
227241
add_executable(zktest ${test_sources})
228242
target_include_directories(zktest PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
229243

zookeeper-client/zookeeper-client-c/Makefile.am

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,28 @@
22
include $(top_srcdir)/aminclude.am
33

44
AUTOMAKE_OPTIONS = serial-tests
5+
56
if SOLARIS
67
SOLARIS_CPPFLAGS = -D_POSIX_PTHREAD_SEMANTICS
78
SOLARIS_LIB_LDFLAGS = -lnsl -lsocket
89
endif
9-
AM_CPPFLAGS = -I${srcdir}/include -I${srcdir}/tests -I${srcdir}/generated $(SOLARIS_CPPFLAGS)
10+
11+
if WANT_OPENSSL
12+
OPENSSL_CPPFLAGS = -DHAVE_OPENSSL_H -I$(OPENSSL_DIR)
13+
OPENSSL_LIB_LDFLAGS = -lssl -lcrypto
14+
endif
15+
16+
AM_CPPFLAGS = -I${srcdir}/include -I${srcdir}/tests -I${srcdir}/generated $(SOLARIS_CPPFLAGS) $(OPENSSL_CPPFLAGS)
1017
AM_CFLAGS = -Wall -Werror -Wdeclaration-after-statement
1118
AM_CXXFLAGS = -Wall $(USEIPV6)
19+
LIB_LDFLAGS = -no-undefined -version-info 2 $(SOLARIS_LIB_LDFLAGS) $(OPENSSL_LIB_LDFLAGS)
1220

1321
# Additional flags for coverage testing (if enabled)
1422
if ENABLEGCOV
1523
AM_CFLAGS += -fprofile-arcs -ftest-coverage
1624
AM_LDFLAGS = -lgcov
1725
endif
1826

19-
LIB_LDFLAGS = -no-undefined -version-info 2 $(SOLARIS_LIB_LDFLAGS)
20-
2127
pkginclude_HEADERS = include/zookeeper.h include/zookeeper_version.h include/zookeeper_log.h include/proto.h include/recordio.h generated/zookeeper.jute.h
2228
EXTRA_DIST=LICENSE
2329

@@ -107,7 +113,7 @@ TEST_SOURCES = \
107113
tests/ZooKeeperQuorumServer.h \
108114
tests/TestReadOnlyClient.cc \
109115
tests/TestLogClientEnv.cc \
110-
tests/TestServerRequireClientSASLAuth.cc \
116+
tests/TestServerRequireClientSASLAuth.cc \
111117
$(NULL)
112118

113119
if SOLARIS
@@ -121,14 +127,14 @@ check_PROGRAMS = zktest-st
121127
TESTS_ENVIRONMENT = ZKROOT=${srcdir}/../.. \
122128
CLASSPATH=$$CLASSPATH:$$CLOVER_HOME/lib/clover*.jar
123129
nodist_zktest_st_SOURCES = $(TEST_SOURCES)
124-
zktest_st_LDADD = libzkst.la libhashtable.la $(CPPUNIT_LIBS) -ldl
130+
zktest_st_LDADD = libzkst.la libhashtable.la $(CPPUNIT_LIBS) $(OPENSSL_LIB_LDFLAGS) -ldl
125131
zktest_st_CXXFLAGS = -DUSE_STATIC_LIB $(CPPUNIT_CFLAGS) $(USEIPV6) $(SOLARIS_CPPFLAGS)
126132
zktest_st_LDFLAGS = -shared $(SYMBOL_WRAPPERS) $(SOLARIS_LIB_LDFLAGS)
127133

128134
if WANT_SYNCAPI
129135
check_PROGRAMS += zktest-mt
130136
nodist_zktest_mt_SOURCES = $(TEST_SOURCES) tests/PthreadMocks.cc
131-
zktest_mt_LDADD = libzkmt.la libhashtable.la -lpthread $(CPPUNIT_LIBS) -ldl
137+
zktest_mt_LDADD = libzkmt.la libhashtable.la -lpthread $(CPPUNIT_LIBS) $(OPENSSL_LIB_LDFLAGS) -ldl
132138
zktest_mt_CXXFLAGS = -DUSE_STATIC_LIB -DTHREADED $(CPPUNIT_CFLAGS) $(USEIPV6)
133139
if SOLARIS
134140
SHELL_SYMBOL_WRAPPERS_MT = cat ${srcdir}/tests/wrappers-mt.opt

zookeeper-client/zookeeper-client-c/configure.ac

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ DX_INIT_DOXYGEN([zookeeper],[c-doc.Doxyfile],[docs])
2323

2424
# initialize automake
2525
AM_INIT_AUTOMAKE([-Wall foreign])
26+
2627
AC_CONFIG_HEADER([config.h])
2728

2829
# Checks for programs.
@@ -37,6 +38,26 @@ else
3738
CHECK_CPPUNIT(1.10.2)
3839
fi
3940

41+
AM_CONDITIONAL([WANT_OPENSSL],[test "x$with_openssl" != x])
42+
43+
44+
AC_ARG_WITH(openssl,
45+
AS_HELP_STRING([--without-openssl],
46+
[Do not use Openssl. Default: auto-detect]), [
47+
case "$with_openssl" in
48+
yes|no)
49+
: # Nothing special to do here
50+
;;
51+
*)
52+
if test ! -d "$withval" ; then
53+
AC_MSG_ERROR([--with-openssl path does not point to a directory])
54+
fi
55+
OPENSSL_DIR="$withval"
56+
AC_SUBST(OPENSSL_DIR)
57+
esac
58+
])
59+
AH_TEMPLATE(USE_OPENSSL,[Openssl support is available])
60+
4061
if test "$CALLER" = "ANT" ; then
4162
CPPUNIT_CFLAGS="$CPPUNIT_CFLAGS -DZKSERVER_CMD=\"\\\"${base_dir}/zookeeper-client/zookeeper-client-c/tests/zkServer.sh\\\"\""
4263
else
@@ -92,6 +113,9 @@ AC_MSG_CHECKING([whether to enable gcov])
92113
AS_IF([test "x${enable_gcov}" = "xyes"],AC_MSG_RESULT([yes]),AC_MSG_RESULT([no]))
93114
AM_CONDITIONAL([ENABLEGCOV],[test "x${enable_gcov}" = "xyes"])
94115

116+
117+
CXXFLAGS="$CXXFLAGS -std=c++11"
118+
95119
AC_ARG_WITH([syncapi],
96120
[AS_HELP_STRING([--with-syncapi],[build with support for SyncAPI [default=yes]])],
97121
[],[with_syncapi=yes])

0 commit comments

Comments
 (0)