This repository contains scripts to build libcurl for Android, statically linked against BoringSSL.
Starting November 1st, 2025, Google Play requires all apps targeting Android 15+ to support 16 KB page sizes. These build scripts automatically include the required linker flags (-Wl,-z,max-page-size=16384) to ensure ELF segments are properly aligned for 16KB page size compatibility.
- 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.shscript and set theANDROID_NDKvariable 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_NDKpath. - Validates that the NDK path exists.
- Creates a
build/directory to store the final artifacts. - Copies the
build-boringssl.shscript into theboringssl/subdirectory. - Changes into the
boringssl/directory. - Executes
build-boringssl.shwhich builds BoringSSL (libssl.a,libcrypto.a) for the following ABIs:armeabi-v7aarm64-v8ax86x86_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.shscript into thecurl/subdirectory. - Changes into the
curl/directory. - Executes
build-curl.shwhich 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>/