6 if [[ ! "${CROSS}" =~ ^(aarch64|x86_64) ]]; then
7 echo "Platform ${CROSS} is not supported"
8 echo "Expected either aarch64 or x86_64."
12 if [[ ! $(which ${CROSS}-w64-mingw32-clang) ]]; then
13 echo "llvm-mingw is not installed, please download it from https://github.com/mstorsjo/llvm-mingw/releases"
17 if [[ ! $(which make) ]]; then
18 echo "make is not installed, please install buld-essential package"
22 # Make build directories
23 mkdir ${ROOT}/${CROSS}-w64-mingw32-build
26 mkdir ${ROOT}/${CROSS}-w64-mingw32
30 cd ${ROOT}/${CROSS}-w64-mingw32-build
31 export CFLAGS="-fstack-protector-all -D_FORTIFY_SOURCE=2"
32 export LDFLAGS="-fstack-protector-all"
33 ${ROOT}/openssl/Configure --cross-compile-prefix=${CROSS}-w64-mingw32- --prefix=${ROOT}/${CROSS}-w64-mingw32 no-shared no-asm mingw64 --api=1.1.1
37 # Create symlink for compatibility
38 cd ${ROOT}/${CROSS}-w64-mingw32
41 # Remove build directore
43 rm -rf ${ROOT}/${CROSS}-w64-mingw32-build