Build sanity checks
[novacoin.git] / mingw64_deps / openssl / build.sh
1 #!/bin/bash
2
3 CROSS=$1
4 ROOT=$(pwd)
5
6 if [[ ! "${CROSS}" =~ ^(aarch64|x86_64) ]]; then
7 echo "Platform ${CROSS} is not supported"
8 echo "Expected either aarch64 or x86_64."
9 exit 1
10 fi
11
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"
14 exit 1
15 fi
16
17 if [[ ! $(which make) ]]; then
18 echo "make is not installed, please install buld-essential package"
19 exit 1
20 fi
21
22 # Make build directories
23 mkdir ${ROOT}/${CROSS}-w64-mingw32-build
24
25 # Stage directory
26 mkdir ${ROOT}/${CROSS}-w64-mingw32
27
28 # Compile BerkeleyDB
29
30 cd ${ROOT}/${CROSS}-w64-mingw32-build
31 #CC=${CROSS}-w64-mingw32-gcc CXX=${CROSS}-w64-mingw32-g++ 
32 ${ROOT}/openssl/Configure --cross-compile-prefix=${CROSS}-w64-mingw32- --prefix=${ROOT}/${CROSS}-w64-mingw32 no-shared no-asm mingw64 --api=1.1.1
33 make -j 4 build_libs
34 make install_dev
35
36 # Create symlink for compatibility
37 cd ${ROOT}/${CROSS}-w64-mingw32
38 ln -s lib64 lib
39
40 # Remove build directore
41 cd ${ROOT}
42 rm -rf ${ROOT}/${CROSS}-w64-mingw32-build