]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Merge PR #174: Add Android to Travis testing, by noloader.
authorGeorge Thessalonikefs <george@nlnetlabs.nl>
Mon, 2 Mar 2020 14:09:07 +0000 (15:09 +0100)
committerGeorge Thessalonikefs <george@nlnetlabs.nl>
Mon, 2 Mar 2020 14:17:59 +0000 (15:17 +0100)
- Move android build scripts to contrib/ and allow android tests to fail.

.travis.yml
README-Travis.md
contrib/android/15-android.conf [moved from android/15-android.conf with 100% similarity]
contrib/android/install_expat.sh [moved from android/install_expat.sh with 100% similarity]
contrib/android/install_ndk.sh [moved from android/install_ndk.sh with 100% similarity]
contrib/android/install_openssl.sh [moved from android/install_openssl.sh with 94% similarity]
contrib/android/setenv_android.sh [moved from android/setenv_android.sh with 100% similarity]
doc/Changelog

index 61c13f6d533b95251f977f09937bab82147214bb..5fe4735a56f6931d1c616a18d5c609d2f5dc8f62 100644 (file)
@@ -133,6 +133,20 @@ jobs:
         - ANDROID_SDK_ROOT="$HOME/android-sdk"
         - ANDROID_NDK_ROOT="$HOME/android-ndk"
 
+  allow_failures:
+    - os: linux
+      arch: amd64
+      name: Android armv7a, Linux, Amd64
+    - os: linux
+      arch: amd64
+      name: Android aarch64, Linux, Amd64
+    - os: linux
+      arch: amd64
+      name: Android x86, Linux, Amd64
+    - os: linux
+      arch: amd64
+      name: Android x86_64, Linux, Amd64
+
 script:
   - |
     if [ "$TEST_UBSAN" = "yes" ]; then
@@ -143,19 +157,19 @@ script:
       ./configure
     elif [ "$TEST_ANDROID" = "yes" ]; then
       export AUTOTOOLS_BUILD="$(./config.guess)"
-      if ! ./android/install_ndk.sh ; then
+      if ! ./contrib/android/install_ndk.sh ; then
         echo "Failed to install Android SDK and NDK"
         exit 1
       fi
-      if ! source ./android/setenv_android.sh "$ANDROID_CPU"; then
+      if ! source ./contrib/android/setenv_android.sh "$ANDROID_CPU"; then
         echo "Failed to set Android environment"
         exit 1
       fi
-      if ! ./android/install_openssl.sh; then
+      if ! ./contrib/android/install_openssl.sh; then
         echo "Failed to build and install OpenSSL"
         exit 1
       fi
-      if ! ./android/install_expat.sh; then
+      if ! ./contrib/android/install_expat.sh; then
         echo "Failed to build and install Expat"
         exit 1
       fi
index 4978e5282359916c0a63935fb530b739a67cfdf9..631a4a45b30788834ad82a086fededb80aee17ef 100644 (file)
@@ -71,11 +71,11 @@ export ANDROID_SDK_ROOT="$HOME/android-sdk"
 export ANDROID_NDK_ROOT="$HOME/android-ndk"
 ```
 
-The second step installs the NDK and SDK. This step is handled in by the script `android/install_ndk.sh`. The script uses `ANDROID_NDK_ROOT` and `ANDROID_SDK_ROOT` to place the NDK and SDK in the `$HOME` directory.
+The second step installs the NDK and SDK. This step is handled in by the script `contrib/android/install_ndk.sh`. The script uses `ANDROID_NDK_ROOT` and `ANDROID_SDK_ROOT` to place the NDK and SDK in the `$HOME` directory.
 
-The third step sets the cross-compile environment using the script `android/setenv_android.sh`. The script is `sourced` so the variables set in the script are available to the calling shell. The script sets variables like `CC`, `CXX`, `AS` and `AR`; sets `CFLAGS` and `CXXFLAGS`; sets a `sysroot` so Android headers and libraries are found; and adds the path to the toolchain to `PATH`.
+The third step sets the cross-compile environment using the script `contrib/android/setenv_android.sh`. The script is `sourced` so the variables set in the script are available to the calling shell. The script sets variables like `CC`, `CXX`, `AS` and `AR`; sets `CFLAGS` and `CXXFLAGS`; sets a `sysroot` so Android headers and libraries are found; and adds the path to the toolchain to `PATH`.
 
-`setenv_android.sh` knows which toolchain and architecture to select by inspecting environmental variables set by Travis for the job. In particular, the variables `ANDROID_CPU` and `ANDROID_API` tell `setenv_android.sh` what tools and libraries to select. For example, below is part of the Aarch64 recipe.
+`contrib/android/setenv_android.sh` knows which toolchain and architecture to select by inspecting environmental variables set by Travis for the job. In particular, the variables `ANDROID_CPU` and `ANDROID_API` tell `contrib/android/setenv_android.sh` what tools and libraries to select. For example, below is part of the Aarch64 recipe.
 
 ```
 - os: linux
@@ -91,7 +91,7 @@ The third step sets the cross-compile environment using the script `android/sete
     - ANDROID_API=23
 ```
 
-The `setenv_android.sh` script specifies the tools in a `case` statement like the following. There is a case for each of the architectures armv7a, aarch64, x86 and x86_64.
+The `contrib/android/setenv_android.sh` script specifies the tools in a `case` statement like the following. There is a case for each of the architectures armv7a, aarch64, x86 and x86_64.
 
 ```
 armv8a|aarch64|arm64|arm64-v8a)
@@ -113,19 +113,19 @@ Finally, once all the variables are set the Travis script cross-compiles OpenSSL
 elif [ "$TEST_ANDROID" = "yes" ]; then
   # AUTOTOOLS_HOST is set in the job
   export AUTOTOOLS_BUILD="$(./config.guess)"
-  if ! ./android/install_ndk.sh ; then
+  if ! ./contrib/android/install_ndk.sh ; then
       echo "Failed to install Android SDK and NDK"
       exit 1
   fi
-  if ! source ./android/setenv_android.sh "$ANDROID_CPU"; then
+  if ! source ./contrib/android/setenv_android.sh "$ANDROID_CPU"; then
       echo "Failed to set Android environment"
       exit 1
   fi
-  if ! ./android/install_openssl.sh; then
+  if ! ./contrib/android/install_openssl.sh; then
       echo "Failed to build and install OpenSSL"
       exit 1
   fi
-  if ! ./android/install_expat.sh; then
+  if ! ./contrib/android/install_expat.sh; then
       echo "Failed to build and install Expat"
       exit 1
   fi
@@ -150,7 +150,7 @@ Note the `--prefix="$ANDROID_SYSROOT"` used by OpenSSL, Expat and Unbound. This
 
 ## Android flags
 
-`android/setenv_android.sh` uses specific flags for `CFLAGS` and `CXXFLAGS`. The flags are not arbitrary; they are taken from the `ndk-build` tool. It is important to use the same flags across projects to avoid subtle problems due to mixing and matching different flags.
+`contrib/android/setenv_android.sh` uses specific flags for `CFLAGS` and `CXXFLAGS`. The flags are not arbitrary; they are taken from the `ndk-build` tool. It is important to use the same flags across projects to avoid subtle problems due to mixing and matching different flags.
 
 `CXXFLAGS` includes `-fexceptions` because exceptions are disabled by default. `CFLAGS` include `-funwind-tables` and `-fexceptions` to ensure C++ exceptions pass through C code, if needed. Also see `docs/CPLUSPLUS—SUPPORT.html` in the NDK docs.
 
similarity index 94%
rename from android/install_openssl.sh
rename to contrib/android/install_openssl.sh
index 0377cc9fa422b2caf8ce7e40811a8bea31123b8d..64d87e313f8c96d6f2bfafd6dc5a238b87c41d6a 100755 (executable)
@@ -22,7 +22,7 @@ fi
 cd openssl-1.1.1d || exit 1
 
 # Damn OpenSSL devs... They just make the shit up as they go...
-if ! cp ../android/15-android.conf Configurations/; then
+if ! cp ../contrib/android/15-android.conf Configurations/; then
     echo "Failed to copy OpenSSL Android config"
     exit 1
 fi
index 5cf0ac716c23408178c92a36cdba7c20950b21a7..232bf40f3072cf9dab87f2971c95f09b9ac08114 100644 (file)
@@ -4,6 +4,8 @@
 
 2 March 2020: George
        - Fix compiler warning in dns64/dns64.c
+       - Merge PR #174: Add Android to Travis testing, by noloader.
+       - Move android build scripts to contrib/ and allow android tests to fail.
 
 2 March 2020: Wouter
        - Fix #177: dnstap does not build on macOS.