summaryrefslogtreecommitdiff
path: root/TestScripts
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2017-09-13 07:16:41 -0400
committerJeffrey Walton <noloader@gmail.com>2017-09-13 07:16:41 -0400
commit6e1a07025c0b4934cd7426bd3cb4441731e80f35 (patch)
tree0797e8cc71931968943dbbda5d70fb789d492015 /TestScripts
parentfcee76594c3dcb74da0cc3dbfed4ed62ce4fd9b4 (diff)
downloadcryptopp-git-6e1a07025c0b4934cd7426bd3cb4441731e80f35.tar.gz
Build Android cpu-features from sources (GH #491)
Thanks to Deadpikle for suggesting the strategy
Diffstat (limited to 'TestScripts')
-rwxr-xr-xTestScripts/setenv-android.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/TestScripts/setenv-android.sh b/TestScripts/setenv-android.sh
index b93ce796..af59640a 100755
--- a/TestScripts/setenv-android.sh
+++ b/TestScripts/setenv-android.sh
@@ -356,6 +356,22 @@ if [ ! -z "$AOSP_BITS_INC" ]; then
export AOSP_BITS_INC
fi
+# Now that we are using cpu-features from Android rather than CPU probing, we
+# need to copy cpu-features.h and cpu-features.c from the NDK into our source
+# directory and then build it.
+
+if [[ ! -e "$ANDROID_NDK_ROOT/sources/android/cpufeatures/cpu-features.h" ]]; then
+ echo "ERROR: Unable to locate cpu-features.h"
+ [ "$0" = "$BASH_SOURCE" ] && exit 1 || return 1
+fi
+cp "$ANDROID_NDK_ROOT/sources/android/cpufeatures/cpu-features.h" .
+
+if [[ ! -e "$ANDROID_NDK_ROOT/sources/android/cpufeatures/cpu-features.c" ]]; then
+ echo "ERROR: Unable to locate cpu-features.c"
+ [ "$0" = "$BASH_SOURCE" ] && exit 1 || return 1
+fi
+cp "$ANDROID_NDK_ROOT/sources/android/cpufeatures/cpu-features.c" .
+
#####################################################################
VERBOSE=1
@@ -371,6 +387,10 @@ if [ ! -z "$VERBOSE" ] && [ "$VERBOSE" != "0" ]; then
if [ ! -z "$AOSP_BITS_INC" ]; then
echo "AOSP_BITS_INC: $AOSP_BITS_INC"
fi
+
+ if [ -e "cpu-features.h" ] && [ -e "cpu-features.c" ]; then
+ echo "CPU FEATURES: cpu-features.h and cpu-features.c are present"
+ fi
fi
#####################################################################