Files
core_libraries/resources/packages/curl/prepare
Timothy Prepscius b308a4c280 flatten 20260225
2026-02-25 13:00:25 -05:00

120 lines
2.4 KiB
Plaintext
Executable File

set -ex
mkdir -p sdk/include
LIB=curl
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# we need openssl to exist
$DIR/../openssl/prepare
$DIR/../nghttp2/prepare
mkdir curl
pushd curl
#wget https://curl.haxx.se/download/curl-7.74.0.tar.bz2
#wget https://curl.haxx.se/download/curl-7.46.0.tar.bz2
#wget https://curl.haxx.se/download/curl-7.85.0.tar.bz2
#$DIR/../../prepare-template-no-makefile $LIB $DIR
git clone --depth 1 https://github.com/curl/curl --branch=curl-7_88_1
#cp $DIR/*.h $LIB/lib/
pushd $LIB
OS_FLAGS=
OTHER_FLAGS=
OS_UNAME=`uname`
if [[ $OS_UNAME == 'Linux' ]]; then
OS_FLAGS=--with-openssl=`pwd`/../../openssl/openssl/install-native/
fi
if [[ $OS_UNAME == 'Darwin' ]]; then
OS_FLAGS="\
--with-openssl=`pwd`/../../openssl/openssl/install-native/ \
--with-secure-transport \
"
fi
if [[ $SYS_NAME == 'Android' ]]; then
export ANDROID_NDK_HOME=/opt/android-sdk/ndk/latest # Point into your NDK.
export HOST_TAG=linux-x86_64
export TOOLCHAIN=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/$HOST_TAG
export AR=$TOOLCHAIN/bin/llvm-ar
export AS=$TOOLCHAIN/bin/llvm-as
export CC=$TOOLCHAIN/bin/aarch64-linux-android34-clang
export CXX=$TOOLCHAIN/bin/aarch64-linux-android34-clang++
# export CC=$TOOLCHAIN/bin/clang
# export CXX=$TOOLCHAIN/bin/clang++
export LD=$TOOLCHAIN/bin/ld
export RANLIB=$TOOLCHAIN/bin/llvm-ranlib
export STRIP=$TOOLCHAIN/bin/llvm-strip
OS_FLAGS="\
--host aarch64-linux-android \
--with-openssl=`pwd`/../../openssl/openssl/install-android-arm64 \
--with-ca-path=/system/etc/security/cacerts \
-v -v -v \
"
# --with-zlib=`pwd`/../../zip/zlib \
# --host x86_64-linux-gnu \
# --with-pic \
# --disable-ares \
# --enable-threaded-resolve \
# --disable-ipv6 \
fi
INSTALL_PREFIX=`pwd`/curl-install
echo "If this failed, then make sure the version of clang above, 34, is still correct"
autoreconf -fi
./configure \
--prefix=$INSTALL_PREFIX \
--disable-shared \
--disable-ldap \
--without-librtmp \
--without-ngtcp2 \
--without-brotli \
--without-libidn2 \
--without-zstd \
--with-pic \
--with-nghttp2 \
$OS_FLAGS \
# --without-ca-bundle --without-ca-path \
#make CC=$TOOLCHAIN/bin/aarch64-linux-android21-clang CXX=$TOOLCHAIN/bin/aarch64-linux-android21-clang++
popd
cp -av $DIR/Makefile.* $LIB/
$DIR/../../prepare-template-just-makefile $LIB $DIR
pushd $LIB
make
popd
popd
pushd sdk/include
rm -f curl
ln -s ../../curl/$LIB/include/curl
popd