diff --git a/proxy/CMakeLists.txt b/proxy/CMakeLists.txt index a676f2f..b72acee 100644 --- a/proxy/CMakeLists.txt +++ b/proxy/CMakeLists.txt @@ -31,6 +31,7 @@ add_executable(hood_proxy src/network.cpp src/tls_security_policy.cpp src/tls_check_certificate.cpp src/tls_check_certificate_worker.cpp src/name_service_client.cpp ) +set_property(TARGET hood_proxy PROPERTY POSITION_INDEPENDENT_CODE TRUE) if(MSVC) target_compile_options(hood_proxy PRIVATE /W4 /WX) @@ -38,4 +39,5 @@ else() target_compile_options(hood_proxy PRIVATE -Wall -Wextra -Werror -fstack-protector) endif() + target_link_libraries( hood_proxy ${Boost_LIBRARIES} pthread ${OPENSSL_LIBRARIES} ) diff --git a/proxy/build.sh b/proxy/build.sh index ce77f82..1019a9f 100755 --- a/proxy/build.sh +++ b/proxy/build.sh @@ -18,5 +18,5 @@ done mkdir -p $script_dir/build/$type/$arch cd $script_dir/build/$type/$arch -cmake -DCMAKE_BUILD_TYPE=$type -DOPENSSL_ROOT_DIR=$script_dir/libs/$system/$arch/openssl -DBOOST_ROOT=$script_dir/libs/$system/$arch/boost .. +cmake -DCMAKE_BUILD_TYPE=$type -DOPENSSL_ROOT_DIR=$script_dir/libs/$system/$arch/openssl -DBOOST_ROOT=$script_dir/libs/$system/$arch/boost $script_dir make -j $(nproc --all) diff --git a/proxy/install_dependencies_debian.sh b/proxy/install_dependencies_debian.sh index 0a1428f..c03c11a 100755 --- a/proxy/install_dependencies_debian.sh +++ b/proxy/install_dependencies_debian.sh @@ -33,20 +33,24 @@ fi export TAR_OPTIONS=--no-same-owner -echo "Downloading openssl." -openssl_src=$(curl -s https://www.openssl.org/source/|grep "tar.gz([^<]*).*/\1/") -curl -L -O -C - https://www.openssl.org/source/$openssl_src -echo "Extracting openssl." -tar -xmf $openssl_src -openssl_src=$(echo $openssl_src |sed "s/.......$//") -cd $openssl_src -install_dir=../$(uname -s)/$arch/openssl -mkdir -p $install_dir -install_dir=$(realpath $install_dir) -./Configure no-ssl2 no-ssl3 no-shared no-weak-ssl-ciphers no-rc2 no-rc4 no-md2 no-md4 no-des no-unit-test no-apps --prefix=$install_dir -make -j ${HOOD_PROXY_BUILD_CONCURRENCY} -make install_sw -cd .. +if [ -d ./$(uname -s)/$arch/openssl ] ; then + echo "${BOOST_FILE_NAME} already installed." +else + echo "Downloading openssl." + openssl_src=$(curl -s https://www.openssl.org/source/|grep "tar.gz([^<]*).*/\1/") + curl -L -O -C - https://www.openssl.org/source/$openssl_src + echo "Extracting openssl." + tar -xmf $openssl_src + openssl_src=$(echo $openssl_src |sed "s/.......$//") + cd $openssl_src + install_dir=../$(uname -s)/$arch/openssl + mkdir -p $install_dir + install_dir=$(realpath $install_dir) + ./Configure no-ssl2 no-ssl3 no-shared no-weak-ssl-ciphers no-rc2 no-rc4 no-md2 no-md4 no-des no-unit-test no-apps --prefix=$install_dir + make -j ${HOOD_PROXY_BUILD_CONCURRENCY} + make install_sw + cd .. +fi # ---- begin code copied and modified from carla Simulator which is MIT License # ============================================================================== @@ -56,7 +60,7 @@ cd .. BOOST_VERSION="1.84.0" BOOST_FILE_NAME=$(echo boost_$BOOST_VERSION|tr '.' '_') -if [ -d /$(uname -s)/$arch/boost ] ; then +if [ -d ./$(uname -s)/$arch/boost ] ; then echo "${BOOST_FILE_NAME} already installed." else if [ ! -d "${BOOST_FILE_NAME}-source" ]; then @@ -68,9 +72,8 @@ else tar -xmf $BOOST_FILE_NAME.tar.gz --exclude "libs" --exclude "doc" --exclude "example" --exclude "test" tar -xmf $BOOST_FILE_NAME.tar.gz --exclude "test" --exclude "example" --exclude "doc" ${BOOST_FILE_NAME}/libs/ mkdir -p $(uname -s)/$arch/boost/include - mv ${BOOST_FILE_NAME} ${BOOST_FILE_NAME}-source fi - cd ${BOOST_FILE_NAME}-source + cd ${BOOST_FILE_NAME} if [ ! -f "b2" ] ; then ./bootstrap.sh --prefix="../$(uname -s)/$arch/boost" diff --git a/scripts/hood_proxy_x64 b/scripts/hood_proxy_x64 index b37077f..eca0556 100644 Binary files a/scripts/hood_proxy_x64 and b/scripts/hood_proxy_x64 differ