This repository contains scripts to build libcurl for Android, statically linked against BoringSSL.
- Android NDK: You need the Android NDK installed. The build script requires the path to your NDK installation.
- CMake: Required by both BoringSSL and libcurl build processes.
- Ninja: Used as the build system generator for BoringSSL.
- Standard Build Tools: A working C/C++ compiler toolchain,
bash
,git
, etc.
-
Clone the Repository:
git clone --recurse-submodules https://github.com/BugSplat-Git/libcurl-android
-
Configure NDK Path: Edit the
build.sh
script and set theANDROID_NDK
variable to the full path of your installed Android NDK.# build.sh export ANDROID_NDK="/path/to/your/android/ndk"
-
Run the Build Script: Make sure the script is executable and run it:
chmod +x build.sh ./build.sh
The build.sh
script performs the following steps:
- Exports the
ANDROID_NDK
path. - Validates that the NDK path exists.
- Creates a
build/
directory to store the final artifacts. - Copies the
build-boringssl.sh
script into theboringssl/
subdirectory. - Changes into the
boringssl/
directory. - Executes
build-boringssl.sh
which builds BoringSSL (libssl.a
,libcrypto.a
) for the following ABIs:armeabi-v7a
arm64-v8a
x86
x86_64
- Copies the resulting BoringSSL build directories (
build_android_*
) into the mainbuild/boringssl/
directory. - Cleans up the BoringSSL build artifacts and the copied script from the
boringssl/
subdirectory. - Copies the
build-curl.sh
script into thecurl/
subdirectory. - Changes into the
curl/
directory. - Executes
build-curl.sh
which builds libcurl (statically linked against the previously built BoringSSL) for the same ABIs. - Copies the resulting libcurl installation directories (
_install/android/*
) into the mainbuild/curl/
directory. - Cleans up the curl build artifacts (
_build/*
,_install/*
) and the copied script from thecurl/
subdirectory.
The final build artifacts (include files and libraries) will be located in the build/
directory, organized by library and ABI:
build/boringssl/build_android_<ABI>/
build/curl/<ABI>/