编译openssl
参考macOS 编译 openssl
成功之后,目录结构为
➜ openssl git:(master) ✗ tree out -L 1
out
├── bin
├── include
├── lib
├── share
└── ssl
编译 curl
源码
git clone https://github.com/curl/curl.git
编译
brew install libtool
brew search libpsl
cd curl
# 生成 configure文件
autoconf # 出问题尝试请尝试 autoreconf -if
mkdir out
touch build_macOS.sh
chmod +x build_macOS.sh
build_macOS.sh
#!/bin/sh
# $DIR 替换为openssl克隆的目录
export CPPFLAGS="-I$DIR/openssl/out/include"
export LDFLAGS="-L$DIR/openssl/out/lib"
./configure --prefix=`pwd`/out
执行编译
./build_macOS.sh
make -j `nproc`
make install
结果
➜ curl git:(f147c6947) ✗ tree out -L 2
out
├── bin
│ ├── curl
│ └── curl-config
├── include
│ └── curl
├── lib
│ ├── libcurl.4.dylib
│ ├── libcurl.a
│ ├── libcurl.dylib -> libcurl.4.dylib
│ ├── libcurl.la
│ └── pkgconfig
└── share
├── aclocal
└── man
网友评论