diff --git a/git/build.sh b/git/build.sh index 9a7dd10..930bafd 100755 --- a/git/build.sh +++ b/git/build.sh @@ -103,10 +103,16 @@ fi git -C git-src fetch --depth 1 origin "v${VERSION}" git -C git-src checkout --force FETCH_HEAD -# Gather static link flags for curl's dependencies -CURL_LDFLAGS="-L$PREFIX/lib -lcurl -lssl -lcrypto -lz" +# Gather static link flags for curl and openssl dependencies +# CURL_LIBCURL: used by git-remote-http, git-http-fetch, git-http-push +# LIB_4_CRYPTO: used by git-imap-send and other direct openssl consumers +# Both need transitive deps (-ldl, -lpthread) since we link statically +CRYPTO_DEPS="-lpthread" +CURL_EXTRA="" if [ "$PLATFORM" = "Linux" ]; then - CURL_LDFLAGS="$CURL_LDFLAGS -lpthread -ldl" + CRYPTO_DEPS="$CRYPTO_DEPS -ldl" +elif [ "$PLATFORM" = "Darwin" ]; then + CURL_EXTRA="-framework SystemConfiguration -framework Security -framework CoreFoundation" fi cd git-src @@ -119,7 +125,9 @@ make prefix="$PREFIX" \ NO_EXPAT=YesPlease \ INSTALL_SYMLINKS=1 \ CURLDIR="$PREFIX" \ - CURL_LDFLAGS="$CURL_LDFLAGS" \ + CURL_LIBCURL="-L$PREFIX/lib -lcurl -lssl -lcrypto -lz $CRYPTO_DEPS $CURL_EXTRA" \ + OPENSSL_LIBSSL="-L$PREFIX/lib -lssl" \ + LIB_4_CRYPTO="-lcrypto $CRYPTO_DEPS" \ ZLIB_PATH="$PREFIX" \ -j"$NJOBS" \ all @@ -132,7 +140,9 @@ make prefix="$PREFIX" \ NO_EXPAT=YesPlease \ INSTALL_SYMLINKS=1 \ CURLDIR="$PREFIX" \ - CURL_LDFLAGS="$CURL_LDFLAGS" \ + CURL_LIBCURL="-L$PREFIX/lib -lcurl -lssl -lcrypto -lz $CRYPTO_DEPS $CURL_EXTRA" \ + OPENSSL_LIBSSL="-L$PREFIX/lib -lssl" \ + LIB_4_CRYPTO="-lcrypto $CRYPTO_DEPS" \ ZLIB_PATH="$PREFIX" \ install cd "$DIR" diff --git a/setup.sh b/setup.sh index ceca7df..ab72c06 100755 --- a/setup.sh +++ b/setup.sh @@ -15,7 +15,7 @@ run_as_root() { } if [ "$(uname)" = "Darwin" ]; then - brew install nasm pkg-config ccache + brew install nasm pkg-config ccache autoconf automake libtool elif command -v dnf &>/dev/null; then dnf install -y nasm cmake gcc-c++ pkgconfig git perl-IPC-Cmd ccache autoconf automake libtool elif command -v apt-get &>/dev/null; then