From dad1c14df755973b2c0ddfb783f872481043e410 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deniz=20T=C3=BCrkoglu?= Date: Wed, 27 Apr 2016 09:10:00 +0200 Subject: [PATCH] Enable builds on OSX Remove hardcoded platform strings with variables and fix scripts to work on both OSX and Linux. --- Build_android/boost-for-android-x86.patch | 24 ++++++++++++++++------- Build_android/boost-for-android.patch | 23 ++++++++++++++++------ Build_android/openssl/Makefile | 4 ++-- 3 files changed, 36 insertions(+), 15 deletions(-) diff --git a/Build_android/boost-for-android-x86.patch b/Build_android/boost-for-android-x86.patch index 8e3f2edcf9..be0957dd3b 100644 --- a/Build_android/boost-for-android-x86.patch +++ b/Build_android/boost-for-android-x86.patch @@ -20,8 +20,15 @@ index 40453f7..7ffc050 100755 ;; *) echo "Undefined or not supported Android NDK version!" -@@ -404,8 +409,8 @@ echo "Building boost for android" - threading=multi \ +@@ -391,6 +396,7 @@ echo "Building boost for android" + export AndroidBinariesPath=`dirname $CXXPATH` + export PATH=$AndroidBinariesPath:$PATH + export AndroidNDKRoot ++ export PlatformOS + export NO_BZIP2=1 + + cxxflags="" +@@ -405,7 +411,7 @@ echo "Building boost for android" --layout=versioned \ --prefix="./../$BUILD_DIR/" \ $LIBRARIES \ @@ -31,11 +38,14 @@ index 40453f7..7ffc050 100755 } | tee -a $PROGDIR/build.log diff --git a/configs/user-config-boost-1_55_0.jam b/configs/user-config-boost-1_55_0.jam -index 666d4c8..762753e 100644 +index 666d4c8..4cd3441 100644 --- a/configs/user-config-boost-1_55_0.jam +++ b/configs/user-config-boost-1_55_0.jam -@@ -41,91 +41,44 @@ import os ; +@@ -39,93 +39,47 @@ + + import os ; local AndroidNDKRoot = [ os.environ AndroidNDKRoot ] ; ++local PlatformOS = [ os.environ PlatformOS ] ; # -------------------------------------------------------------------- -# Is same for 8b, 8c and 8d @@ -43,10 +53,10 @@ index 666d4c8..762753e 100644 +using clang : androidR8e : -arm-linux-androideabi-g++ -+$(AndroidNDKRoot)/toolchains/llvm-3.6/prebuilt/linux-x86_64/bin/clang++ ++$(AndroidNDKRoot)/toolchains/llvm-3.6/prebuilt/$(PlatformOS)-x86_64/bin/clang++ : -arm-linux-androideabi-ar -+--gcc-toolchain="$(AndroidNDKRoot)/toolchains/x86-4.8/prebuilt/linux-x86_64" ++--gcc-toolchain="$(AndroidNDKRoot)/toolchains/x86-4.8/prebuilt/$(PlatformOS)-x86_64" -fexceptions -frtti -fpic @@ -82,7 +92,7 @@ index 666d4c8..762753e 100644 +-I$(AndroidNDKRoot)/sources/cxx-stl/gnu-libstdc++/4.8/include +-I$(AndroidNDKRoot)/sources/cxx-stl/gnu-libstdc++/4.8/libs/x86/include +--target=i686-none-linux-android -+--gcc-toolchain="$(AndroidNDKRoot)/toolchains/x86-4.8/prebuilt/linux-x86_64" ++--gcc-toolchain="$(AndroidNDKRoot)/toolchains/x86-4.8/prebuilt/$(PlatformOS)-x86_64" +--sysroot=$(AndroidNDKRoot)/platforms/android-9/arch-x86 # @Moss - Above are the 'oficial' android flags -arm diff --git a/Build_android/boost-for-android.patch b/Build_android/boost-for-android.patch index d37c923862..0b941435e3 100644 --- a/Build_android/boost-for-android.patch +++ b/Build_android/boost-for-android.patch @@ -20,7 +20,15 @@ index 40453f7..ad78ddf 100755 ;; *) echo "Undefined or not supported Android NDK version!" -@@ -404,8 +409,8 @@ echo "Building boost for android" +@@ -391,6 +396,7 @@ echo "Building boost for android" + export AndroidBinariesPath=`dirname $CXXPATH` + export PATH=$AndroidBinariesPath:$PATH + export AndroidNDKRoot ++ export PlatformOS + export NO_BZIP2=1 + + cxxflags="" +@@ -405,7 +411,7 @@ echo "Building boost for android" threading=multi \ --layout=versioned \ --prefix="./../$BUILD_DIR/" \ @@ -34,19 +42,22 @@ diff --git a/configs/user-config-boost-1_55_0.jam b/configs/user-config-boost-1_ index 666d4c8..df597f6 100644 --- a/configs/user-config-boost-1_55_0.jam +++ b/configs/user-config-boost-1_55_0.jam -@@ -41,82 +41,41 @@ import os ; +@@ -39,84 +39,44 @@ + + import os ; local AndroidNDKRoot = [ os.environ AndroidNDKRoot ] ; - ++local PlatformOS = [ os.environ PlatformOS ] ; + # -------------------------------------------------------------------- -# Is same for 8b, 8c and 8d -using gcc : androidR8b +using clang : androidR8e : -arm-linux-androideabi-g++ -+$(AndroidNDKRoot)/toolchains/llvm-3.6/prebuilt/linux-x86_64/bin/clang++ ++$(AndroidNDKRoot)/toolchains/llvm-3.6/prebuilt/$(PlatformOS)-x86_64/bin/clang++ : -arm-linux-androideabi-ar -+--gcc-toolchain="$(AndroidNDKRoot)/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64" ++--gcc-toolchain="$(AndroidNDKRoot)/toolchains/arm-linux-androideabi-4.8/prebuilt/$(PlatformOS)-x86_64" -fexceptions -frtti -fpic @@ -126,7 +137,7 @@ index 666d4c8..df597f6 100644 +-I$(AndroidNDKRoot)/sources/cxx-stl/gnu-libstdc++/4.8/include +-I$(AndroidNDKRoot)/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi/include +--target=armv7-none-linux-androideabi -+--gcc-toolchain="$(AndroidNDKRoot)/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64" ++--gcc-toolchain="$(AndroidNDKRoot)/toolchains/arm-linux-androideabi-4.8/prebuilt/$(PlatformOS)-x86_64" +--sysroot=$(AndroidNDKRoot)/platforms/android-9/arch-arm # @Moss - Above are the 'oficial' android flags arm diff --git a/Build_android/openssl/Makefile b/Build_android/openssl/Makefile index fbb5b84b64..f0bc60591d 100644 --- a/Build_android/openssl/Makefile +++ b/Build_android/openssl/Makefile @@ -16,8 +16,8 @@ setenv-android.sh: setenv-android-x86.sh: setenv-android.sh cp setenv-android.sh setenv-android-x86.sh.tmp - sed -i 's/_ANDROID_EABI="arm-linux-androideabi-4.8"/_ANDROID_EABI="x86-4.8"/g' setenv-android-x86.sh.tmp - sed -i 's/_ANDROID_ARCH=arch-arm/_ANDROID_ARCH=arch-x86/g' setenv-android-x86.sh.tmp + sed -i -e 's/_ANDROID_EABI="arm-linux-androideabi-4.8"/_ANDROID_EABI="x86-4.8"/g' setenv-android-x86.sh.tmp + sed -i -e 's/_ANDROID_ARCH=arch-arm/_ANDROID_ARCH=arch-x86/g' setenv-android-x86.sh.tmp mv setenv-android-x86.sh.tmp setenv-android-x86.sh $(OPENSSL_VER).tar.gz: