Switch to official openssl version and update to 1.0.1j

master
sapier 2015-01-03 23:49:46 +01:00
parent 64cdbae6df
commit bf5d6e670a
3 changed files with 36 additions and 17 deletions

View File

@ -34,6 +34,7 @@ TARGET_ABI = armeabi
TARGET_LIBDIR = armeabi TARGET_LIBDIR = armeabi
TARGET_TOOLCHAIN = arm-linux-androideabi- TARGET_TOOLCHAIN = arm-linux-androideabi-
TARGET_CFLAGS_ADDON = -mfloat-abi=softfp -mfpu=vfp TARGET_CFLAGS_ADDON = -mfloat-abi=softfp -mfpu=vfp
TARGET_ARCH = armv7
CROSS_PREFIX = arm-linux-androideabi- CROSS_PREFIX = arm-linux-androideabi-
COMPILER_VERSION = 4.8 COMPILER_VERSION = 4.8
HAVE_LEVELDB = 1 HAVE_LEVELDB = 1
@ -49,6 +50,7 @@ HAVE_LEVELDB = 1
# -mfloat-abi=hard -march=armv7-a # -mfloat-abi=hard -march=armv7-a
#TARGET_CXXFLAGS_ADDON = $(TARGET_CFLAGS_ADDON) #TARGET_CXXFLAGS_ADDON = $(TARGET_CFLAGS_ADDON)
#TARGET_LDFLAGS_ADDON = -Wl,--no-warn-mismatch -lm_hard #TARGET_LDFLAGS_ADDON = -Wl,--no-warn-mismatch -lm_hard
#TARGET_ARCH = arm
#CROSS_PREFIX = arm-linux-androideabi- #CROSS_PREFIX = arm-linux-androideabi-
#COMPILER_VERSION = 4.8 #COMPILER_VERSION = 4.8
#HAVE_LEVELDB = 1 #HAVE_LEVELDB = 1
@ -60,6 +62,7 @@ HAVE_LEVELDB = 1
#TARGET_ABI = mips #TARGET_ABI = mips
#TARGET_LIBDIR = mips #TARGET_LIBDIR = mips
#TARGET_TOOLCHAIN = mipsel-linux-android- #TARGET_TOOLCHAIN = mipsel-linux-android-
#TARGET_ARCH = mips32
#CROSS_PREFIX = mipsel-linux-android- #CROSS_PREFIX = mipsel-linux-android-
#COMPILER_VERSION = 4.8 #COMPILER_VERSION = 4.8
#HAVE_LEVELDB = 0 #HAVE_LEVELDB = 0
@ -72,6 +75,7 @@ HAVE_LEVELDB = 1
#TARGET_LIBDIR = x86 #TARGET_LIBDIR = x86
#TARGET_TOOLCHAIN = x86- #TARGET_TOOLCHAIN = x86-
#CROSS_PREFIX = i686-linux-android- #CROSS_PREFIX = i686-linux-android-
#TARGET_ARCH = x86
#COMPILER_VERSION = 4.8 #COMPILER_VERSION = 4.8
#HAVE_LEVELDB = 1 #HAVE_LEVELDB = 1
@ -103,12 +107,13 @@ IRRLICHT_TIMESTAMP = $(IRRLICHT_DIR)timestamp
IRRLICHT_TIMESTAMP_INT = $(ROOT)/deps/irrlicht_timestamp IRRLICHT_TIMESTAMP_INT = $(ROOT)/deps/irrlicht_timestamp
IRRLICHT_URL_SVN = http://svn.code.sf.net/p/irrlicht/code/branches/ogl-es/ IRRLICHT_URL_SVN = http://svn.code.sf.net/p/irrlicht/code/branches/ogl-es/
OPENSSL_BASEDIR = openssl-android OPENSSL_VERSION = 1.0.1j
OPENSSL_BASEDIR = openssl-$(OPENSSL_VERSION)
OPENSSL_DIR = $(ROOT)/deps/$(OPENSSL_BASEDIR)/ OPENSSL_DIR = $(ROOT)/deps/$(OPENSSL_BASEDIR)/
OPENSSL_LIB = $(OPENSSL_DIR)libs/$(TARGET_ABI)/libopenssl.so OPENSSL_LIB = $(OPENSSL_DIR)/libssl.so.1.0.0
OPENSSL_TIMESTAMP = $(OPENSSL_DIR)timestamp OPENSSL_TIMESTAMP = $(OPENSSL_DIR)timestamp
OPENSSL_TIMESTAMP_INT = $(ROOT)/deps/openssl_timestamp OPENSSL_TIMESTAMP_INT = $(ROOT)/deps/openssl_timestamp
OPENSSL_URL_GIT = https://github.com/wobbals/openssl-android OPENSSL_URL = http://www.openssl.org/source/openssl-$(OPENSSL_VERSION).tar.gz
CURL_VERSION = 7.35.0 CURL_VERSION = 7.35.0
CURL_DIR = $(ROOT)/deps/curl-$(CURL_VERSION) CURL_DIR = $(ROOT)/deps/curl-$(CURL_VERSION)
@ -118,7 +123,7 @@ CURL_TIMESTAMP_INT = $(ROOT)/deps/curl_timestamp
CURL_URL_HTTP = http://curl.haxx.se/download/curl-${CURL_VERSION}.tar.bz2 CURL_URL_HTTP = http://curl.haxx.se/download/curl-${CURL_VERSION}.tar.bz2
FREETYPE_DIR = $(ROOT)/deps/freetype2-android/ FREETYPE_DIR = $(ROOT)/deps/freetype2-android/
FREETYPE_LIB = $(FREETYPE_DIR)/Android/obj/local/$(TARGER_ABI)/libfreetype2-static.a FREETYPE_LIB = $(FREETYPE_DIR)/Android/obj/local/$(TARGET_ABI)/libfreetype2-static.a
FREETYPE_TIMESTAMP = $(FREETYPE_DIR)timestamp FREETYPE_TIMESTAMP = $(FREETYPE_DIR)timestamp
FREETYPE_TIMESTAMP_INT = $(ROOT)/deps/freetype_timestamp FREETYPE_TIMESTAMP_INT = $(ROOT)/deps/freetype_timestamp
FREETYPE_URL_GIT = https://github.com/cdave1/freetype2-android FREETYPE_URL_GIT = https://github.com/cdave1/freetype2-android
@ -283,7 +288,10 @@ openssl_download :
echo "openssl sources missing, downloading..."; \ echo "openssl sources missing, downloading..."; \
mkdir -p ${ROOT}/deps; \ mkdir -p ${ROOT}/deps; \
cd ${ROOT}/deps ; \ cd ${ROOT}/deps ; \
git clone ${OPENSSL_URL_GIT} || exit 1; \ wget ${OPENSSL_URL} || exit 1; \
tar -xzf ${OPENSSL_BASEDIR}.tar.gz; \
cd ${OPENSSL_BASEDIR}; \
patch -p1 < ../../openssl_arch.patch; \
fi fi
openssl : $(OPENSSL_LIB) openssl : $(OPENSSL_LIB)
@ -298,16 +306,16 @@ $(OPENSSL_LIB): $(OPENSSL_TIMESTAMP)
REFRESH=1; \ REFRESH=1; \
fi; \ fi; \
if [ $$REFRESH -ne 0 ] ; then \ if [ $$REFRESH -ne 0 ] ; then \
export PATH=$$PATH:${SDKFOLDER}/platform-tools:${ANDROID_NDK}; \
echo "changed timestamp for openssl detected building..."; \ echo "changed timestamp for openssl detected building..."; \
cd ${OPENSSL_DIR}; \ cd ${OPENSSL_DIR}; \
cat jni/Application.mk | grep -v NDK_TOOLCHAIN_VERSION >jni/Application.mk.new;\ ln -s ${OPENSSL_DIR} ../openssl; \
mv jni/Application.mk.new jni/Application.mk; \ export TOOLCHAIN=/tmp/ndk-${TARGET_HOST}; \
ndk-build NDEBUG=${NDEBUG} NDK_MODULE_PATH=${NDK_MODULE_PATH} \ ${ANDROID_NDK}/build/tools/make-standalone-toolchain.sh \
APP_ABI=${TARGET_ABI} APP_PLATFORM=${APP_PLATFORM} -j${PARALLEL} \ --toolchain=${TARGET_TOOLCHAIN}${COMPILER_VERSION} \
TARGET_CFLAGS+="${TARGET_CFLAGS_ADDON}" \ --install-dir=$${TOOLCHAIN} --system=linux-x86_64; \
TARGET_LDFLAGS+="${TARGET_LDFLAGS_ADDON}" \ export PATH="$${TOOLCHAIN}/bin:$${PATH}"; \
TARGET_CXXFLAGS+="${TARGET_CXXFLAGS_ADDON}" || exit 1; \ CC=${CROSS_PREFIX}gcc ./Configure -shared android-${TARGET_ARCH}; \
CC=${CROSS_PREFIX}gcc ANDROID_DEV=/tmp/ndk-${TARGET_HOST} make all; \
touch ${OPENSSL_TIMESTAMP}; \ touch ${OPENSSL_TIMESTAMP}; \
touch ${OPENSSL_TIMESTAMP_INT}; \ touch ${OPENSSL_TIMESTAMP_INT}; \
else \ else \
@ -346,7 +354,7 @@ $(LEVELDB_LIB): $(LEVELDB_TIMESTAMP)
echo "changed timestamp for leveldb detected building..."; \ echo "changed timestamp for leveldb detected building..."; \
cd deps/leveldb; \ cd deps/leveldb; \
export CROSS_PREFIX=${CROSS_PREFIX}; \ export CROSS_PREFIX=${CROSS_PREFIX}; \
export TOOLCHAIN=/tmp/ndk-arm; \ export TOOLCHAIN=/tmp/ndk-${TARGET_HOST}; \
${ANDROID_NDK}/build/tools/make-standalone-toolchain.sh \ ${ANDROID_NDK}/build/tools/make-standalone-toolchain.sh \
--toolchain=${TARGET_TOOLCHAIN}${COMPILER_VERSION} \ --toolchain=${TARGET_TOOLCHAIN}${COMPILER_VERSION} \
--install-dir=$${TOOLCHAIN} --system=linux-x86_64; \ --install-dir=$${TOOLCHAIN} --system=linux-x86_64; \
@ -503,7 +511,7 @@ $(CURL_LIB): $(CURL_TIMESTAMP) $(OPENSSL_LIB)
echo "changed timestamp for curl detected building..."; \ echo "changed timestamp for curl detected building..."; \
cd deps/curl-${CURL_VERSION}; \ cd deps/curl-${CURL_VERSION}; \
export CROSS_PREFIX=${CROSS_PREFIX}; \ export CROSS_PREFIX=${CROSS_PREFIX}; \
export TOOLCHAIN=/tmp/ndk-arm; \ export TOOLCHAIN=/tmp/ndk-${TARGET_HOST}; \
${ANDROID_NDK}/build/tools/make-standalone-toolchain.sh \ ${ANDROID_NDK}/build/tools/make-standalone-toolchain.sh \
--toolchain=${TARGET_TOOLCHAIN}${COMPILER_VERSION} \ --toolchain=${TARGET_TOOLCHAIN}${COMPILER_VERSION} \
--install-dir=$${TOOLCHAIN} --system=linux-x86_64; \ --install-dir=$${TOOLCHAIN} --system=linux-x86_64; \

View File

@ -41,12 +41,12 @@ include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS) include $(CLEAR_VARS)
LOCAL_MODULE := ssl LOCAL_MODULE := ssl
LOCAL_SRC_FILES := deps/openssl-android/libs/$(TARGET_LIBDIR)/libssl.so LOCAL_SRC_FILES := deps/openssl/libssl.so
include $(PREBUILT_SHARED_LIBRARY) include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS) include $(CLEAR_VARS)
LOCAL_MODULE := crypto LOCAL_MODULE := crypto
LOCAL_SRC_FILES := deps/openssl-android/libs/$(TARGET_LIBDIR)/libcrypto.so LOCAL_SRC_FILES := deps/openssl/libcrypto.so
include $(PREBUILT_SHARED_LIBRARY) include $(PREBUILT_SHARED_LIBRARY)

View File

@ -0,0 +1,11 @@
--- openssl-1.0.1j/Configure.orig 2014-10-15 14:53:39.000000000 +0200
+++ openssl-1.0.1j/Configure 2015-01-03 22:41:43.505749921 +0100
@@ -407,6 +407,8 @@
"android","gcc:-mandroid -I\$(ANDROID_DEV)/include -B\$(ANDROID_DEV)/lib -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"android-x86","gcc:-mandroid -I\$(ANDROID_DEV)/include -B\$(ANDROID_DEV)/lib -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:".eval{my $asm=${x86_elf_asm};$asm=~s/:elf/:android/;$asm}.":dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"android-armv7","gcc:-march=armv7-a -mandroid -I\$(ANDROID_DEV)/include -B\$(ANDROID_DEV)/lib -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${armv4_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"android-arm","gcc:-march=armv4 -mandroid -I\$(ANDROID_DEV)/include -B\$(ANDROID_DEV)/lib -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${armv4_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"android-mips32","gcc:-march=mips32 -mandroid -I\$(ANDROID_DEV)/include -B\$(ANDROID_DEV)/lib -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${mips32_asm}:o32:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
#### *BSD [do see comment about ${BSDthreads} above!]
"BSD-generic32","gcc:-DTERMIOS -O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",