#!/bin/bash
# Build script for curl
# Command line tool for transferring data with URLs

set -e

cd "$SRCDIR"

# Ensure runtime linker can find our libraries
export LD_LIBRARY_PATH="/usr/lib:$LD_LIBRARY_PATH"

# Configure curl with LibreSSL
./configure \
    --build=$BUILD_TRIPLE \
    --host=$BUILD_TRIPLE \
    --prefix=$PREFIX \
    --with-ssl=/usr \
    --with-zlib=/usr \
    --enable-ipv6 \
    --enable-unix-sockets \
    --disable-ldap \
    --disable-ldaps \
    --without-brotli \
    --without-zstd \
    --without-libidn2 \
    --without-libpsl \
    --without-nghttp2 \
    --without-nghttp3 \
    --without-ngtcp2 \
    --without-librtmp \
    --without-libssh2

gmake -j${JOBS:-1}
gmake install DESTDIR="$PKGDIR"
