libhv编译

参考:https://juejin.cn/post/7265042701065961508

export OPENSSL_CRYPTO_LIBRARY=/usr/local/Cellar/openssl@1.1/1.1.1t
export OPENSSL_INCLUDE_DIR=/usr/local/Cellar/openssl@1.1/1.1.1t/include
export OPENSSL_ROOT_DIR=/usr/local/Cellar/openssl@1.1/1.1.1t
export LDFLAGS="/usr/local/Cellar/openssl@1.1/1.1.1t/lib/libssl.a /usr/local/Cellar/openssl@1.1/1.1.1t/lib/libcrypto.a"
export PKG_CONFIG_PATH=/usr/local/Cellar/openssl@1.1/1.1.1t

环境变量参数设置为这些才行

//下面是libcurl编译

libcurl macosx编译

export ARCH=x86_64
export SDK=macosx
export DEPLOYMENT_TARGET=11.0

#export MACOSX_DEPLOYMENT_TARGET="10.6"

#./buildconf
#
#export CFLAGS="-arch $ARCH -isysroot $(xcrun -sdk $SDK --show-sdk-path) -m$SDK-version-min=$DEPLOYMENT_TARGET"
#./configure --prefix=$(pwd)/artifacts --disable-shared       --enable-static  --with-secure-transport --enable-threaded-resolver --disable-ldap --disable-ldaps
#
#echo "make start"
#make
#echo "make end"
export CFLAGS="-arch $ARCH -isysroot $(xcrun -sdk $SDK --show-sdk-path) -m$SDK-version-min=$DEPLOYMENT_TARGET"
./configure --host=$ARCH-apple-darwin --prefix $(pwd)/artifacts --with-secure-transport CFLAGS=-fPIC   --enable-websockets --disable-ldap --disable-ldaps --enable-shared=no  --disable-rtsp --without-librtmp  --without-zstd  --without-brotli --without-libidn2  --without-nghttp2
make -j8
make install

libcurl linux编译
切忌不能使用macosx编译后的文件,要重新github下载,要不会被macosx污染,除非删除macosx编译生成的文件

用openssl编译

./configure --target=powerpc-hardhat-linux --host=powerpc-hardhat-linux --prefix $(pwd)/build --with-openssl="/usr/local" --enable-websockets --disable-ldap --disable-ldaps --disable-rtsp --without-librtmp  --without-zstd  --without-brotli --without-libidn2  --without-nghttp2

make -j8
make install

用wolfssl编译
由于openssl和其他的库版本不匹配会冲突,只能用wolfssl进行编译
编译wolfssl,
我下载的是5.2.0版本,最主要的是要打开--enable-curl参数,要不然参与curl编译链接时会报错

./configure --target=powerpc-hardhat-linux --host=powerpc-hardhat-linux --enable-static --disable-shared --enable-curl

编译curl,

 ./configure --prefix $(pwd)/build --with-wolfssl=/usr/local --enable-websockets --disable-ldap --disable-ldaps --disable-rtsp --without-librtmp  --without-zstd  --without-brotli --without-libidn2  --without-nghttp2

宋冬野
32 声望4 粉丝