7 if [[ ! "${TARGET_CPU}" =~ ^(aarch64|x86_64) ]]; then
8 echo "Platform ${TARGET_CPU} is not supported"
9 echo "Expected either aarch64 or x86_64."
13 if [[ ! "${TARGET_OS}" =~ ^(w64\-mingw32|linux\-gnu) ]]; then
14 echo "Operation sysrem ${TARGET_OS} is not supported"
15 echo "Expected either w64-mingw32 or linux-gnu."
19 # Cross-building prefix
20 CROSS=${TARGET_CPU}-${TARGET_OS}
22 if [[ ! $(which ${CROSS}-gcc) ]]; then
23 echo "Target C compiler ${CROSS}-gcc is not found"
27 if [[ ! $(which ${CROSS}-g++) ]]; then
28 echo "Target C++ compiler ${CROSS}-g++ is not found"
32 if [ "${TARGET_OS}" == "w64-mingw32" ]; then
33 MINGW32_PARAMS="target-os=windows"
36 # Create stage directory
37 mkdir ${ROOT}/${CROSS}
41 # Create compiler settings
42 echo "using gcc : : ${CROSS}-g++ ;" > user-config-${CROSS}.jam
45 ./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
49 # Remove build directories
50 rm -rf ${ROOT}/boost/stage ${ROOT}/boost/bin.v2 ${ROOT}/boost/user-config-${CROSS}.jam