Created
October 23, 2021 22:55
-
-
Save thevery/6c0251889fc3d7d821e6bc0ef8bdaa77 to your computer and use it in GitHub Desktop.
wget static build for macos
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export PREFIX=$HOME/prefix/usr | |
curl -L https://github.com/openssl/openssl/archive/refs/tags/OpenSSL_1_1_1l.tar.gz -o openssl.tar.gz | |
tar xf openssl.tar.gz | |
cd openssl-OpenSSL_1_1_1l | |
./config --prefix=$PREFIX | |
make install_sw | |
cd .. | |
curl https://ftp.gnu.org/gnu/wget/wget-1.21.2.tar.gz -o wget.tar.gz | |
tar xf wget.tar.gz | |
cd wget-1.21.2 | |
./configure --disable-nls --disable-iri --disable-pcre --disable-pcre2 --without-libpsl --without-included-regex --with-ssl=openssl --with-libssl-prefix=$PREFIX --prefix=$PREFIX | |
// remove dynamic libraries to force use static for linker | |
rm $PREFIX/lib/*.dylib | |
make install LDFLAGS="-L$PREFIX/lib -lssl -lcrypto" | |
echo "please make sure there is no '$PREFIX' or '/usr/local' in dependencies" | |
otool -L ./src/wget | |
echo "wget static binary: `pwd`/src/wget" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
add
export MACOSX_DEPLOYMENT_TARGET=10.14
to build mojave-compatible binary