forked from stsaz/phiola
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxbuild-win64.sh
77 lines (65 loc) · 1.49 KB
/
xbuild-win64.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/bash
# phiola: cross-build on Linux for Windows/AMD64
set -xe
if ! test -d "../phiola" ; then
exit 1
fi
if ! podman container exists phiola_win64_build ; then
if ! podman image exists phiola-win64-builder ; then
# Create builder image
cat <<EOF | podman build -t phiola-win64-builder -f - .
FROM debian:bookworm-slim AS cxx-mingw64-debian-bookworm
RUN apt update && \
apt install -y \
gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 make
FROM cxx-mingw64-debian-bookworm
RUN apt install -y \
perl \
zstd unzip cmake patch dos2unix curl
EOF
fi
# Create builder container
podman create --attach --tty \
-v `pwd`/..:/src \
--name phiola_win64_build \
phiola-win64-builder \
bash -c 'cd /src/phiola && source ./build_mingw64.sh'
fi
# Prepare build script
cat >build_mingw64.sh <<EOF
set -xe
make -j8 openssl \
-C ../netmill/3pt \
OS=windows \
COMPILER=gcc \
CROSS_PREFIX=x86_64-w64-mingw32-
make -j8 libzstd \
-C ../ffpack \
OS=windows \
COMPILER=gcc \
CROSS_PREFIX=x86_64-w64-mingw32-
make -j8 \
-C alib3 \
OS=windows \
COMPILER=gcc \
CROSS_PREFIX=x86_64-w64-mingw32-
mkdir -p _windows-amd64
make -j8 \
-C _windows-amd64 \
-f ../Makefile \
ROOT_DIR=../.. \
OS=windows \
COMPILER=gcc \
CROSS_PREFIX=x86_64-w64-mingw32- \
CFLAGS_USER=-fno-diagnostics-color \
$@
make -j8 app \
-C _windows-amd64 \
-f ../Makefile \
ROOT_DIR=../.. \
OS=windows \
COMPILER=gcc \
CROSS_PREFIX=x86_64-w64-mingw32-
EOF
# Build inside the container
podman start --attach phiola_win64_build