Skip to content

Commit 5843a39

Browse files
authored
Merge pull request #63 from xbolshe/master
[Android] Remove XCODE tools, update libraries and README.md, remove ANDROID_HOME check
2 parents d55501d + 2540856 commit 5843a39

9 files changed

+20
-34
lines changed

README.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,25 +26,29 @@ If you do not want to build it by yourself, you could download our prebuilt libr
2626
- ~~[openssl-1.0.2c.tar.gz](https://www.openssl.org/source/openssl-1.0.2c.tar.gz)~~
2727
- [openssl-1.1.0f.tar.gz](https://www.openssl.org/source/openssl-1.1.0f.tar.gz)
2828
- [openssl-1.1.1d.tar.gz](https://www.openssl.org/source/openssl-1.1.1d.tar.gz)
29+
- [openssl-1.1.1i.tar.gz](https://www.openssl.org/source/openssl-1.1.1i.tar.gz)
2930
- [https://github.com/openssl/openssl](https://github.com/openssl/openssl)
3031

3132
## nghttp2 Version
3233

3334
- [nghttp2-1.40.0.tar.gz](https://github.com/nghttp2/nghttp2/releases/download/v1.40.0/nghttp2-1.40.0.tar.gz)
35+
- [nghttp2-1.42.0.tar.gz](https://github.com/nghttp2/nghttp2/releases/download/v1.42.0/nghttp2-1.42.0.tar.gz)
3436
- [https://nghttp2.org/](https://nghttp2.org/)
3537

3638
## cURL Version
3739

3840
- ~~[curl-7.47.1.tar.gz](https://curl.haxx.se/download/curl-7.47.1.tar.gz)~~
3941
- [curl-7.66.0.tar.gz](https://curl.haxx.se/download/curl-7.66.0.tar.gz)
4042
- [curl-7.68.0.tar.gz](https://curl.haxx.se/download/curl-7.68.0.tar.gz)
43+
- [curl-7.74.0.tar.gz](https://curl.haxx.se/download/curl-7.74.0.tar.gz)
4144
- [https://github.com/curl/curl](https://github.com/curl/curl)
4245

4346
## Android NDK Version
4447

4548
- ~~[android-ndk-r13b](https://dl.google.com/android/repository/android-ndk-r13b-darwin-x86_64.zip)~~
4649
- ~~[android-ndk-r14b](https://dl.google.com/android/repository/android-ndk-r14b-darwin-x86_64.zip)~~
4750
- ~~android-ndk-r15 (**Do not try to build use 15 It will fail**)~~
51+
- [android-ndk-r21d-darwin](https://dl.google.com/android/repository/android-ndk-r21d-darwin-x86_64.zip) [android-ndk-r21d-linux](https://dl.google.com/android/repository/android-ndk-r21d-linux-x86_64.zip)
4852
- support api 23 above
4953

5054
## How to build
@@ -69,26 +73,30 @@ $ sh build-ios-curl.sh
6973

7074
### For Android
7175

72-
- Android Studio info: 3.5.3 (for reference only)
76+
- Android Studio info: 4.1, November 5, 2020 (for reference only)
77+
- Android NDK info: r21d
7378
- Build dependencies: todo
7479
- Build order: 1.build openssl, 2.build nghttp2, 3.build curl (curl depend openssl and nghttp2)
7580
- build static library(.a) and dynamic library (exclude curl arm64-v8a)
7681
- env macro: for example:
7782
```
78-
export ANDROID_HOME=/Users/userid/Library/Android/sdk
79-
export ANDROID_NDK_ROOT=$ANDROID_HOME/ndk-bundle
83+
export ANDROID_NDK_ROOT=/Location/where/installed/android-ndk-r21d
8084
8185
```
8286
- build sh cmd: for example:
8387
```
8488
$ cd tools
85-
$ sh build-android-openssl.sh
86-
$ sh build-android-nghttp2.sh
87-
$ sh build-android-curl.sh
89+
$ export api=16
90+
$ ./build-android-openssl.sh arm
91+
$ ./build-android-nghttp2.sh arm
92+
$ ./build-android-curl.sh arm
93+
$ export api=21
94+
$ ./build-android-openssl.sh arm64
95+
$ ./build-android-nghttp2.sh arm64
96+
$ ./build-android-curl.sh arm64
8897
```
8998

9099

91-
92100
> **You must build openssl and nghttp2(support http2) first**
93101
94102
### Others

tools/build-android-common.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,6 @@ if [[ -z ${ANDROID_NDK_ROOT} ]]; then
4040
exit 1
4141
fi
4242

43-
if [[ -z ${ANDROID_HOME} ]]; then
44-
echo "ANDROID_HOME not defined"
45-
exit 1
46-
fi
47-
4843
function get_toolchain() {
4944
HOST_OS=$(uname -s)
5045
case ${HOST_OS} in

tools/build-android-curl.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ set -u
2121
source ./build-android-common.sh
2222

2323
if [ -z ${version+x} ]; then
24-
version="7.68.0"
24+
version="7.74.0"
2525
fi
2626

2727
init_log_color
@@ -48,8 +48,6 @@ echo "https://github.com/curl/curl/releases/download/${LIB_VERSION}/${LIB_NAME}.
4848
# https://curl.haxx.se/download/${LIB_NAME}.tar.gz
4949
# https://github.com/curl/curl/releases/download/curl-7_69_0/curl-7.69.0.tar.gz
5050
# https://github.com/curl/curl/releases/download/curl-7_68_0/curl-7.68.0.tar.gz
51-
DEVELOPER=$(xcode-select -print-path)
52-
SDK_VERSION=$(xcrun -sdk iphoneos --show-sdk-version)
5351
rm -rf "${LIB_DEST_DIR}" "${LIB_NAME}"
5452
[ -f "${LIB_NAME}.tar.gz" ] || curl -LO https://github.com/curl/curl/releases/download/${LIB_VERSION}/${LIB_NAME}.tar.gz >${LIB_NAME}.tar.gz
5553

tools/build-android-lz4.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ LIB_DEST_DIR="${pwd_path}/../output/android/lz4"
4141

4242
#echo "https://github.com/lz4/lz4/releases/download/${LIB_VERSION}/${LIB_NAME}.tar.gz"
4343

44-
DEVELOPER=$(xcode-select -print-path)
45-
SDK_VERSION=$(xcrun -sdk iphoneos --show-sdk-version)
4644
rm -rf "${LIB_DEST_DIR}" "${LIB_NAME}"
4745
[ -f "${LIB_NAME}.tar.gz" ] || curl -L https://github.com/lz4/lz4/archive/${LIB_VERSION}.tar.gz >${LIB_NAME}.tar.gz
4846

tools/build-android-nghttp2.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ set -u
2121
source ./build-android-common.sh
2222

2323
if [ -z ${version+x} ]; then
24-
version="1.40.0"
24+
version="1.42.0"
2525
fi
2626

2727
init_log_color
@@ -45,8 +45,6 @@ LIB_DEST_DIR="${pwd_path}/../output/android/nghttp2-universal"
4545

4646
echo "https://github.com/nghttp2/nghttp2/releases/download/${LIB_VERSION}/${LIB_NAME}.tar.gz"
4747

48-
DEVELOPER=$(xcode-select -print-path)
49-
SDK_VERSION=$(xcrun -sdk iphoneos --show-sdk-version)
5048
rm -rf "${LIB_DEST_DIR}" "${LIB_NAME}"
5149
[ -f "${LIB_NAME}.tar.gz" ] || curl -LO https://github.com/nghttp2/nghttp2/releases/download/${LIB_VERSION}/${LIB_NAME}.tar.gz >${LIB_NAME}.tar.gz
5250

tools/build-android-openssl.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ set -u
2121
source ./build-android-common.sh
2222

2323
if [ -z ${version+x} ]; then
24-
version="1.1.1d"
24+
version="1.1.1i"
2525
fi
2626

2727
init_log_color
@@ -49,8 +49,6 @@ echo "https://www.openssl.org/source/${LIB_NAME}.tar.gz"
4949

5050
# https://github.com/openssl/openssl/archive/OpenSSL_1_1_1d.tar.gz
5151
# https://github.com/openssl/openssl/archive/OpenSSL_1_1_1f.tar.gz
52-
DEVELOPER=$(xcode-select -print-path)
53-
SDK_VERSION=$(xcrun -sdk iphoneos --show-sdk-version)
5452
rm -rf "${LIB_DEST_DIR}" "${LIB_NAME}"
5553
[ -f "${LIB_NAME}.tar.gz" ] || curl https://www.openssl.org/source/${LIB_NAME}.tar.gz >${LIB_NAME}.tar.gz
5654

tools/build-android-rsync.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,6 @@ LIB_DEST_DIR="${pwd_path}/../output/android/curl-universal"
4141

4242
echo "https://download.samba.org/pub/rsync/${LIB_NAME}.tar.gz"
4343

44-
# https://curl.haxx.se/download/${LIB_NAME}.tar.gz
45-
# https://github.com/curl/curl/releases/download/curl-7_69_0/curl-7.69.0.tar.gz
46-
# https://github.com/curl/curl/releases/download/curl-7_68_0/curl-7.68.0.tar.gz
47-
DEVELOPER=$(xcode-select -print-path)
48-
SDK_VERSION=$(xcrun -sdk iphoneos --show-sdk-version)
4944
rm -rf "${LIB_DEST_DIR}" "${LIB_NAME}"
5045
[ -f "${LIB_NAME}.tar.gz" ] || curl -LO https://download.samba.org/pub/rsync/${LIB_NAME}.tar.gz >${LIB_NAME}.tar.gz
5146

tools/build-android-xxhash.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ LIB_DEST_DIR="${pwd_path}/../output/android/xxhash"
4141

4242
#echo "https://github.com/xxhash/xxhash/releases/download/${LIB_VERSION}/${LIB_NAME}.tar.gz"
4343

44-
DEVELOPER=$(xcode-select -print-path)
45-
SDK_VERSION=$(xcrun -sdk iphoneos --show-sdk-version)
4644
rm -rf "${LIB_DEST_DIR}" "${LIB_NAME}"
4745
[ -f "${LIB_NAME}.tar.gz" ] || curl -L https://github.com/Cyan4973/xxHash/archive/${LIB_VERSION}.tar.gz >${LIB_NAME}.tar.gz
4846

tools/build-android-zstd.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,12 @@ pwd_path="$(cd -P "$(dirname "$SOURCE")" && pwd)"
3535
echo pwd_path=${pwd_path}
3636
echo TOOLS_ROOT=${TOOLS_ROOT}
3737

38-
LIB_VERSION="v1.4.5"
39-
LIB_NAME="zstd-1.4.5"
38+
LIB_VERSION="v1.4.8"
39+
LIB_NAME="zstd-1.4.8"
4040
LIB_DEST_DIR="${pwd_path}/../output/android/zstd"
4141

4242
#echo "https://github.com/zstd/zstd/releases/download/${LIB_VERSION}/${LIB_NAME}.tar.gz"
4343

44-
DEVELOPER=$(xcode-select -print-path)
45-
SDK_VERSION=$(xcrun -sdk iphoneos --show-sdk-version)
4644
rm -rf "${LIB_DEST_DIR}" "${LIB_NAME}"
4745
[ -f "${LIB_NAME}.tar.gz" ] || curl -L https://github.com/facebook/zstd/archive/${LIB_VERSION}.tar.gz >${LIB_NAME}.tar.gz
4846

0 commit comments

Comments
 (0)