5 MUTEX="x86_64/gcc-assembly"
7 if [[ ! "${CROSS}" =~ ^(aarch64|x86_64) ]]; then
8 echo "Platform ${CROSS} is not supported"
9 echo "Expected either aarch64 or x86_64."
13 if [[ ! $(which ${CROSS}-w64-mingw32-clang) ]]; then
14 echo "llvm-mingw is not installed, please download it from https://github.com/mstorsjo/llvm-mingw/releases"
18 if [[ ! $(which make) ]]; then
19 echo "make is not installed, please install buld-essential package"
23 if [ "${CROSS}" == "aarch64" ]; then
24 MUTEX="ARM64/gcc-assembly"
27 # Make build directories
28 mkdir ${ROOT}/${CROSS}-w64-mingw32-build
31 mkdir ${ROOT}/${CROSS}-w64-mingw32
35 cd ${ROOT}/${CROSS}-w64-mingw32-build
36 export CFLAGS="-fstack-protector-all -D_FORTIFY_SOURCE=2"
37 export CXXFLAGS=${CFLAGS}
38 export LDFLAGS="-fstack-protector-all"
39 ${ROOT}/libdb/dist/configure --prefix=${ROOT}/${CROSS}-w64-mingw32 --enable-smallbuild --enable-cxx --disable-shared --disable-replication --with-mutex=${MUTEX} --enable-mingw --host=${CROSS}-w64-mingw32
40 make -j 4 library_build
43 # Remove build directore
45 rm -rf ${ROOT}/${CROSS}-w64-mingw32-build