Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
wernerd committed Nov 12, 2016
2 parents 872e577 + fa539f2 commit b45af0e
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 21 deletions.
44 changes: 23 additions & 21 deletions CMakeLists.txt
Expand Up @@ -33,7 +33,7 @@ option(SQLCIPHER "Use SQLCipher DB as backend for ZRTP cache." OFF)
option(SDES "Include SDES when not building for CCRTP." OFF)
option(AXO "Include Axolotl support when not building for CCRTP." OFF)

option(ANDROID "Generate Android makefiles (Android.mk)" ON)
option(ANDROID "Generate Android makefiles (Android.mk)" OFF)
option(JAVA "Generate Java support files (requires JDK and SWIG)" OFF)

#
Expand Down Expand Up @@ -155,28 +155,30 @@ else()

endif()

if (SQLITE)
pkg_check_modules(SQLITE3 sqlite3>=3.7)
if (SQLITE3_FOUND)
check_include_files(sqlite3.h HAVE_SQLITE_H)
set(LIBS ${LIBS} -lsqlite3)
MESSAGE(STATUS "Using SQLite based ZRTP cache")
else()
message(FATAL_ERROR "SQLite3 library not found")
endif()
elseif(SQLCIPHER)
pkg_check_modules(SQLCIPHER sqlcipher>=3.7)
if (SQLCIPHER_FOUND)
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${SQLCIPHER_INCLUDE_DIRS})
check_include_files(sqlite3.h HAVE_SQLCIPHER_H)
set(LIBS ${LIBS} -lsqlcipher)
MESSAGE(STATUS "Using SQlCipher based ZRTP cache")
add_definitions(-DSQL_CIPHER -DSQLITE_HAS_CODEC)
if (NOT ANDROID)
if (SQLITE)
pkg_check_modules(SQLITE3 sqlite3>=3.7)
if (SQLITE3_FOUND)
check_include_files(sqlite3.h HAVE_SQLITE_H)
set(LIBS ${LIBS} -lsqlite3)
MESSAGE(STATUS "Using SQLite based ZRTP cache")
else()
message(FATAL_ERROR "SQLite3 library not found")
endif()
elseif(SQLCIPHER)
pkg_check_modules(SQLCIPHER sqlcipher>=3.7)
if (SQLCIPHER_FOUND)
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${SQLCIPHER_INCLUDE_DIRS})
check_include_files(sqlite3.h HAVE_SQLCIPHER_H)
set(LIBS ${LIBS} -lsqlcipher)
MESSAGE(STATUS "Using SQlCipher based ZRTP cache")
add_definitions(-DSQL_CIPHER -DSQLITE_HAS_CODEC)
else()
message(FATAL_ERROR "SQLCipher library not found")
endif()
else()
message(FATAL_ERROR "SQLCipher library not found")
MESSAGE(STATUS "Using file based ZRTP cache")
endif()
else()
MESSAGE(STATUS "Using file based ZRTP cache")
endif()

# necessary and required modules checked, ready to generate config.h in top-level build directory
Expand Down
46 changes: 46 additions & 0 deletions buildNativeAndroidTivi.sh
@@ -0,0 +1,46 @@
#!/usr/bin/env bash

# This script builds the specific variant of zrtpcpp as used by Silent Phone
# on Android. The script always runs on a clean build directory and copies
# the resulting static library to the SPA jni directory.
# The script requires some environment variables which are either set by the
# build system (Jenkins for example) or by a shell script that call this script.

if [ ! -d "${WORKSPACE}/silentphone2" ]; then
echo '***** Variable WORKSPACE does not point to correct directory *****'
exit 1
fi

if [ "x$ANDROID_NDK" = "x" ]; then
echo '***** Variable ANDROID_NDK not set *****'
exit 1
fi

#if [ "x$SC_BUILD_TYPE" = "xDEVELOP" ]; then
# BUILD_TYPE=Debug
# echo "*** building develop configuration"
#else
# BUILD_TYPE="Release"
# echo "*** building release configuration"
#fi

rm -rf buildTiviAndroid
mkdir buildTiviAndroid
pushd buildTiviAndroid

cmake -DTIVI=true -DBUILD_STATIC=true -DAXO=true -DANDROID=true .. # -DCMAKE_BUILD_TYPE=$BUILD_TYPE ..

pushd clients/tivi/android

if ndk-build; then
echo "ZRTPCPP Android build OK."
else
echo "ZRTPCPP Android build failed!"
exit 1
fi

cp obj/local/armeabi-v7a/libzrtpcpp.a ${WORKSPACE}/silentphone2/jni/armeabi-v7a/

# cleanup build directory
rm -rf buildTiviAndroid
exit 0

0 comments on commit b45af0e

Please sign in to comment.