diff --git a/.travis.yml b/.travis.yml index 7e59e1e0..4d9d9a2f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,7 @@ os: env: - BUILD_TYPE=default - BUILD_TYPE=android -- BUILD_TYPE=tweetnacl +- BUILD_TYPE=libsodium - BUILD_TYPE=cmake sudo: false diff --git a/CMakeLists.txt b/CMakeLists.txt index 93dea034..2c35b996 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,14 +22,14 @@ option (ENABLE_CURVE "Enable CURVE security" ON) if (NOT ENABLE_CURVE) message (STATUS "CURVE security is disabled") -elseif (WITH_SODIUM) +elseif (WITH_LIBSODIUM) find_package (Sodium) if (SODIUM_FOUND) message (STATUS "Using libsodium for CURVE security") include_directories (${SODIUM_INCLUDE_DIRS}) # On Solaris, libsodium depends on libssp - if (${CMAKE_SYSTEM_NAME} matches "SunOS") + if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS") target_link_libraries (libzmq ssp) endif () set (HAVE_LIBSODIUM 1) diff --git a/Makefile.am b/Makefile.am index e25fa260..8bffeeec 100644 --- a/Makefile.am +++ b/Makefile.am @@ -192,8 +192,6 @@ src_libzmq_la_SOURCES = \ src/tipc_listener.hpp \ src/trie.cpp \ src/trie.hpp \ - src/tweetnacl.c \ - src/tweetnacl.h \ src/udp_address.cpp \ src/udp_address.hpp \ src/udp_engine.cpp \ @@ -232,6 +230,12 @@ src_libzmq_la_SOURCES = \ src/socket_poller.hpp \ src/socket_poller.cpp +if USE_TWEETNACL +src_libzmq_la_SOURCES += \ + src/tweetnacl.c \ + src/tweetnacl.h +endif + if ON_MINGW src_libzmq_la_LDFLAGS = \ -no-undefined \ diff --git a/builds/android/build.sh b/builds/android/build.sh index 17810688..0b942989 100755 --- a/builds/android/build.sh +++ b/builds/android/build.sh @@ -30,7 +30,7 @@ fi (android_build_verify_so "libsodium.so" &> /dev/null) || { rm -rf "${cache}/libsodium" - (cd "${cache}" && git clone --depth 1 git://github.com/jedisct1/libsodium.git) || exit 1 + (cd "${cache}" && git clone -b stable --depth 1 git://github.com/jedisct1/libsodium.git) || exit 1 (cd "${cache}/libsodium" && ./autogen.sh \ && ./configure --quiet "${ANDROID_BUILD_OPTS[@]}" --disable-soname-versions \ && make -j 4 \ diff --git a/builds/cmake/ci_build.sh b/builds/cmake/ci_build.sh index 7f2c70a2..96904ea6 100755 --- a/builds/cmake/ci_build.sh +++ b/builds/cmake/ci_build.sh @@ -18,8 +18,5 @@ CMAKE_OPTS+=("-DCMAKE_PREFIX_PATH:PATH=${BUILD_PREFIX}") CMAKE_OPTS+=("-DCMAKE_LIBRARY_PATH:PATH=${BUILD_PREFIX}/lib") CMAKE_OPTS+=("-DCMAKE_INCLUDE_PATH:PATH=${BUILD_PREFIX}/include") -git clone --depth 1 -b stable git://github.com/jedisct1/libsodium.git && -( cd libsodium; ./autogen.sh && ./configure --prefix=$BUILD_PREFIX && make && make install ) || exit 1 - # Build, check, and install from local source ( cd ../..; mkdir build_cmake && cd build_cmake && PKG_CONFIG_PATH=${BUILD_PREFIX}/lib/pkgconfig cmake "${CMAKE_OPTS[@]}" .. && make all VERBOSE=1 && make install ) || exit 1 diff --git a/builds/tweetnacl/ci_build.sh b/builds/libsodium/ci_build.sh similarity index 67% rename from builds/tweetnacl/ci_build.sh rename to builds/libsodium/ci_build.sh index e59c10f0..f9501cf4 100755 --- a/builds/tweetnacl/ci_build.sh +++ b/builds/libsodium/ci_build.sh @@ -13,11 +13,17 @@ CONFIG_OPTS+=("LDFLAGS=-L${BUILD_PREFIX}/lib") CONFIG_OPTS+=("PKG_CONFIG_PATH=${BUILD_PREFIX}/lib/pkgconfig") CONFIG_OPTS+=("--prefix=${BUILD_PREFIX}") +# Build required projects first + +# libsodium +git clone --depth 1 -b stable git://github.com/jedisct1/libsodium.git +( cd libsodium; ./autogen.sh; ./configure --prefix=$BUILD_PREFIX; make check; make install) + # Build and check this project ( cd ../..; ./autogen.sh && - ./configure "${CONFIG_OPTS[@]}" --with-tweetnacl=yes && + ./configure "${CONFIG_OPTS[@]}" --with-libsodium=yes && make && ( if make check; then true; else cat test-suite.log; exit 1; fi ) && make install diff --git a/ci_build.sh b/ci_build.sh index 848be338..e8e900f4 100755 --- a/ci_build.sh +++ b/ci_build.sh @@ -14,16 +14,10 @@ if [ $BUILD_TYPE == "default" ]; then CONFIG_OPTS+=("PKG_CONFIG_PATH=${BUILD_PREFIX}/lib/pkgconfig") CONFIG_OPTS+=("--prefix=${BUILD_PREFIX}") - # Build required projects first - - # libsodium - git clone --depth 1 -b stable git://github.com/jedisct1/libsodium.git - ( cd libsodium; ./autogen.sh; ./configure --prefix=$BUILD_PREFIX; make check; make install) - # Build and check this project ( ./autogen.sh && - ./configure "${CONFIG_OPTS[@]}" --with-libsodium=yes && + ./configure "${CONFIG_OPTS[@]}" && make && ( if make check; then true; else cat test-suite.log; exit 1; fi ) && make install diff --git a/configure.ac b/configure.ac index 0d8c57af..41590714 100644 --- a/configure.ac +++ b/configure.ac @@ -461,7 +461,7 @@ else libzmq_pedantic="no" # Disable pedantic warnings fi -AM_CONDITIONAL(USE_LIBSODIUM, test "$curve_library" == "sodium") +AM_CONDITIONAL(USE_LIBSODIUM, test "$curve_library" == "libsodium") AM_CONDITIONAL(USE_TWEETNACL, test "$curve_library" == "tweetnacl") # build using pgm