X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=blobdiff_plain;f=mingw64_deps%2Fboost%2Fbuild.sh;fp=mingw64_deps%2Fboost%2Fbuild.sh;h=10e1e4c93c261b278b8a47b29667dcfe1f26e149;hp=754b053db485f17dbc1508fcc74c7f1971485459;hb=2d9f474bb1fe11944327529f9339518963264a70;hpb=9560306bac3c6853356c3eb289674cfadc2ebccc diff --git a/mingw64_deps/boost/build.sh b/mingw64_deps/boost/build.sh index 754b053..10e1e4c 100755 --- a/mingw64_deps/boost/build.sh +++ b/mingw64_deps/boost/build.sh @@ -1,36 +1,50 @@ #!/bin/bash -CROSS=$1 +TARGET_CPU=$1 +TARGET_OS=$2 ROOT=$(pwd) -if [[ ! "${CROSS}" =~ ^(aarch64|x86_64) ]]; then -echo "Platform ${CROSS} is not supported" +if [[ ! "${TARGET_CPU}" =~ ^(aarch64|x86_64) ]]; then +echo "Platform ${TARGET_CPU} is not supported" echo "Expected either aarch64 or x86_64." exit 1 fi -if [[ ! $(which ${CROSS}-w64-mingw32-clang) ]]; then -echo "llvm-mingw is not installed, please download it from https://github.com/mstorsjo/llvm-mingw/releases" +if [[ ! "${TARGET_OS}" =~ ^(w64\-mingw32|linux\-gnu) ]]; then +echo "Operation sysrem ${TARGET_OS} is not supported" +echo "Expected either w64-mingw32 or linux-gnu." exit 1 fi -if [[ ! $(which make) ]]; then -echo "make is not installed, please install buld-essential package" +# Cross-building prefix +CROSS=${TARGET_CPU}-${TARGET_OS} + +if [[ ! $(which ${CROSS}-gcc) ]]; then +echo "Target C compiler ${CROSS}-gcc is not found" +exit 1 +fi + +if [[ ! $(which ${CROSS}-g++) ]]; then +echo "Target C++ compiler ${CROSS}-g++ is not found" exit 1 fi +if [ "${TARGET_OS}" == "w64-mingw32" ]; then +MINGW32_PARAMS="target-os=windows" +fi + # Create stage directory -mkdir ${ROOT}/${CROSS}-w64-mingw32 +mkdir ${ROOT}/${CROSS} cd ${ROOT}/boost # Create compiler settings -echo "using gcc : : ${CROSS}-w64-mingw32-g++ ;" > user-config-${CROSS}.jam +echo "using gcc : : ${CROSS}-g++ ;" > user-config-${CROSS}.jam # Build boost -./b2 --user-config=user-config-${CROSS}.jam cxxflags="-fstack-protector-strong -D_FORTIFY_SOURCE=2" linkflags=-fstack-protector-strong --build-type=minimal --layout=system --with-chrono --with-filesystem --with-program_options --with-system --with-thread target-os=windows address-model=64 variant=release link=static threading=multi runtime-link=static stage --prefix=${ROOT}/${CROSS}-w64-mingw32 install +./b2 --user-config=user-config-${CROSS}.jam cxxflags="-fstack-protector-strong -D_FORTIFY_SOURCE=2" linkflags=-fstack-protector-strong --build-type=minimal --layout=system --with-chrono --with-filesystem --with-program_options --with-system --with-thread ${MINGW32_PARAMS} address-model=64 variant=release link=static threading=multi runtime-link=static stage --prefix=${ROOT}/${CROSS} install cd ${ROOT} # Remove build directories -rm -rf ${ROOT}/boost/stage ${ROOT}/boost/bin.v2 +rm -rf ${ROOT}/boost/stage ${ROOT}/boost/bin.v2 ${ROOT}/boost/user-config-${CROSS}.jam