diff --git a/external/curl/build_curl.sh b/external/curl/build_curl.sh new file mode 100755 index 00000000..10b8197c --- /dev/null +++ b/external/curl/build_curl.sh @@ -0,0 +1,76 @@ +#!/bin/bash +#编译curl库 +platform=$1 +CMAKE_SOURCE_DIR=$2 +echo "Compile curl, platform = $platform, cmake source dir = $CMAKE_SOURCE_DIR." +export ROOT_PATH=$PWD +if [ ! -d "./curl-8.1.2" ];then + echo "tar zxvf curl-8.1.2.tar.gz" + tar zxvf curl-8.1.2.tar.gz +fi +if [ -d "./curl-8.1.2" ];then + cd ./curl-8.1.2 + + if [ ! -d "./build" ];then + echo "mkdir build" + mkdir build + fi + cd build +fi +exit +# tailor="no-asm no-async no-md2 no-mdc2 no-poly1305 no-blake2 \ +# no-siphash no-sm3 no-rc2 no-rc4 no-rc5 no-idea no-aria no-bf no-cast \ +# no-camellia no-chacha no-ec no-sm2 no-dso \ +# no-err no-comp no-cms no-ts no-cmac no-ct \ +# no-hw-padlock no-nextprotoneg no-psk no-rfc3779 no-srtp \ +# no-cms no-dgram no-dynamic-engine no-ec no-ec2m no-filenames no-gost \ +# no-afalgeng no-async no-autoalginit no-autoerrinit no-capieng" +tailor="--disable-dict --disable-file --disable-gopher \ + --disable-imap --disable-ldap --disable-pop3 --disable-rtmp \ + --disable-rtsp --disable-scp --disable-sftp --disable-smb \ + --disable-telnet --disable-tftp --disable-ipv6" +if [ ! -f "./googletest-release-1.11.0/googlemock/lib/libgtest.a" ] || [ ! -f "./googletest-release-1.11.0/googlemock/lib/libgmock.a" ];then + echo "make curl" + case $platform in + "linux") + echo "==Compile linux." + # cmake -DCMAKE_TOOLCHAIN_FILE=$CMAKE_SOURCE_DIR/build/cmake/toolchain/linux.toolchain.cmake . + # make + # CFLAGS=-fPIC cmake .. \ + # -DCMAKE_BUILD_TYPE=RELEASE \ + # -DCMAKE_INSTALL_PREFIX=$ROOT_PATH \ + # -DBUILD_SHARED_LIBS=OFF -DCURL_USE_OPENSSL=ON \ + # -DCMAKE_PREFIX_PATH=../../../openssl/build \ + # -DCMAKE_TOOLCHAIN_FILE=../../../../build/cmake/toolchain/linux.toolchain.cmake + # make libcurl + cd ../ + ./configure --without-zlib --prefix=$ROOT_PATH --with-ssl=/home/xiaojiazhu/project_codes/sifarsdk/external/openssl/build CC=gcc + make + # cmake --build .. --target install --config Release -j 8 + ;; + "sigmastart_333DE") + echo "==Compile sigmastart_333DE." + # cmake -DCMAKE_TOOLCHAIN_FILE=$CMAKE_SOURCE_DIR/333DE/build/cmake/toolchain/sigmastart_333DE.toolchain.cmake . + # CFLAGS=-fPIC cmake .. \ + # -DCMAKE_BUILD_TYPE=RELEASE \ + # -DCMAKE_INSTALL_PREFIX=$ROOT_PATH \ + # -DBUILD_SHARED_LIBS=OFF -DCURL_USE_OPENSSL=ON \ + # -DCMAKE_PREFIX_PATH=../../../openssl/build \ + # -DCMAKE_TOOLCHAIN_FILE=../../../../333DE/build/cmake/toolchain/sigmastart_333DE.toolchain.cmake + # make libcurl + cd ../ + # without openssl + # ./configure --prefix=$ROOT_PATH --host=arm-linux CC=arm-linux-gnueabihf-9.1.0-gcc --without-ssl + # with openssl + # ./configure --prefix=$ROOT_PATH --with-ssl=/home/xiaojiazhu/project_codes/sifarsdk/external/curl --host=arm-linux CC=arm-linux-gnueabihf-9.1.0-gcc + ./configure $tailor --without-zlib --prefix=$ROOT_PATH --with-ssl=/home/xiaojiazhu/project_codes/sifarsdk/external/openssl/build --host=arm-linux CC=arm-linux-gnueabihf-9.1.0-gcc + make + ;; + *) + echo "Compile gtest failed." + ;; + esac +fi + +cd $ROOT_PATH +echo "Exit build_curl.sh." \ No newline at end of file diff --git a/external/curl/curl-8.1.2.tar.gz b/external/curl/curl-8.1.2.tar.gz new file mode 100644 index 00000000..f4c028ef Binary files /dev/null and b/external/curl/curl-8.1.2.tar.gz differ diff --git a/external/openssl/build_openssl.sh b/external/openssl/build_openssl.sh new file mode 100755 index 00000000..cbdfb848 --- /dev/null +++ b/external/openssl/build_openssl.sh @@ -0,0 +1,62 @@ +#!/bin/bash +#编译curl库 +platform=$1 +CMAKE_SOURCE_DIR=$2 +echo "Compile curl, platform = $platform, cmake source dir = $CMAKE_SOURCE_DIR." +export ROOT_PATH=$PWD + +# if [ ! -d "./openssl-3.1.0" ];then +# echo "tar zxvf openssl-3.1.0.tar.gz" +# tar zxvf openssl-3.1.0.tar.gz +# fi +# if [ -d "./openssl-3.1.0" ];then +# echo "cd ./openssl-3.1.0" +# cd ./openssl-3.1.0 +# fi + +if [ ! -d "./openssl-1.1.1s" ];then + echo "tar zxvf openssl-1.1.1s.tar.gz" + tar zxvf openssl-1.1.1s.tar.gz +fi +if [ -d "./openssl-1.1.1s" ];then + cd ./openssl-1.1.1s +fi +exit +tailor="no-asm no-async no-md2 no-mdc2 no-poly1305 no-blake2 \ + no-siphash no-sm3 no-rc2 no-rc4 no-rc5 no-idea no-aria no-bf no-cast \ + no-camellia no-chacha no-ec no-sm2 no-dso \ + no-err no-comp no-cms no-ts no-cmac no-ct \ + no-hw-padlock no-nextprotoneg no-psk no-rfc3779 no-srtp \ + no-dgram no-dynamic-engine no-ec2m no-filenames no-gost \ + no-afalgeng no-async no-autoalginit no-autoerrinit no-capieng \ + no-tests \ + no-ssl-trace no-static-engine no-stdio no-threads no-deprecated no-makedepend \ + no-multiblock" +echo $tailor +# if [ -d "./build" ];then +# mkdir build +# fi +if [ ! -f "./googletest-release-1.11.0/googlemock/lib/libgtest.a" ] || [ ! -f "./googletest-release-1.11.0/googlemock/lib/libgmock.a" ];then + echo "make openssl" + case $platform in + "linux") + echo "==Compile linux." + ./Configure $tailor linux-x86_64 --prefix=$ROOT_PATH/build --openssldir=$ROOT_PATH/build --cross-compile-prefix= + # ./Configure no-asm shared --prefix=$ROOT_PATH/build --openssldir=$ROOT_PATH/build + make + make install + ;; + "sigmastart_333DE") + echo "==Compile sigmastart_333DE." + ./Configure $tailor linux-armv4 --prefix=$ROOT_PATH/build --openssldir=$ROOT_PATH/build --cross-compile-prefix=arm-linux-gnueabihf-9.1.0- + make + make install + ;; + *) + echo "Compile gtest failed." + ;; + esac +fi + +cd $ROOT_PATH +echo "Exit build_openssl.sh." \ No newline at end of file diff --git a/external/openssl/openssl-1.1.1s.tar.gz b/external/openssl/openssl-1.1.1s.tar.gz new file mode 100644 index 00000000..9f41c501 Binary files /dev/null and b/external/openssl/openssl-1.1.1s.tar.gz differ