Skip to content

Commit

Permalink
add readme and license
Browse files Browse the repository at this point in the history
  • Loading branch information
abao committed Sep 17, 2018
1 parent 2619635 commit 903cb34
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 2 deletions.
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# cURL for Android

Compile curl, openssl, zlib with Android NDK.

## Before build

Download android ndk-r13b from [here](https://developer.android.com/ndk/downloads/),
and set NDK_ROOT in your system environment variable.

For example:

```
export NDK_ROOT=your_ndk_path
```

## Build

```
chmod 755 build_for_android.sh
./build_for_android.sh
```

## Binary and Library

```
# cURL
jni/build/curl/*/curl
jni/libs/*/libcurl.a
jni/libs/*/libcurl.so
# OpenSSL
jni/build/openssl/*/bin/openssl
jni/build/openssl/*/lib/libssl.a
jni/build/openssl/*/lib/libcrypto.a
# zlib
jni/build/zlib/*/lib/libz.a
jni/build/zlib/*/lib/libz.so
```

## License

[GPL-2.0](./LICENSE)
[cURL](https://github.com/curl/curl/blob/master/COPYING)
[OpenSSL](https://github.com/openssl/openssl/blob/master/LICENSE)
[zlib](https://github.com/madler/zlib/blob/master/README)
16 changes: 16 additions & 0 deletions build_for_android.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
#!/bin/bash
# Compile curl & openssl & zlib for android with NDK.
# Copyright (C) 2018 shishuo <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

APP_ABI=(armeabi-v7a x86 arm64-v8a)

BASE_PATH=$(
Expand Down
20 changes: 18 additions & 2 deletions jni/compile-openssl.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
#!/bin/bash
# http://wiki.openssl.org/index.php/Android
# http://doc.qt.io/qt-5/opensslsupport.html
# Compile curl & openssl & zlib for android with NDK.
# Copyright (C) 2018 shishuo <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

APP_ABI=(armeabi-v7a x86 arm64-v8a)

BASE_PATH=$(
Expand Down Expand Up @@ -34,6 +48,8 @@ fi
## Build OpenSSL

# compile $1 ABI $2 SYSROOT $3 TOOLCHAIN $4 MACHINE $5 SYSTEM $6 ARCH $7 CROSS_COMPILE
# http://wiki.openssl.org/index.php/Android
# http://doc.qt.io/qt-5/opensslsupport.html
compile() {
cd $SSL_PATH
ABI=$1
Expand Down
16 changes: 16 additions & 0 deletions jni/compile-zlib.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
#!/bin/bash
# Compile curl & openssl & zlib for android with NDK.
# Copyright (C) 2018 shishuo <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

APP_ABI=(armeabi-v7a x86 arm64-v8a)

BASE_PATH=$(
Expand Down

0 comments on commit 903cb34

Please sign in to comment.