diff options
Diffstat (limited to 'other/docker/windows/build_dependencies.sh')
-rw-r--r-- | other/docker/windows/build_dependencies.sh | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/other/docker/windows/build_dependencies.sh b/other/docker/windows/build_dependencies.sh new file mode 100644 index 00000000..f3d4b603 --- /dev/null +++ b/other/docker/windows/build_dependencies.sh | |||
@@ -0,0 +1,89 @@ | |||
1 | #!/usr/bin/env sh | ||
2 | |||
3 | set -e -x | ||
4 | |||
5 | #=== Cross-Compile Dependencies === | ||
6 | |||
7 | build() | ||
8 | { | ||
9 | ARCH=${1} | ||
10 | |||
11 | echo "Building for ${ARCH} architecture" | ||
12 | |||
13 | # set some things | ||
14 | WINDOWS_TOOLCHAIN=${ARCH}-w64-mingw32 | ||
15 | |||
16 | # prefix that we will copy to the user | ||
17 | PREFIX_DIR="/root/prefix/${ARCH}" | ||
18 | # prefix for things that shouldn't be copied to the user | ||
19 | EXTRA_PREFIX_DIR="/root/extra-prefix/${ARCH}" | ||
20 | mkdir -p "${PREFIX_DIR}" "${EXTRA_PREFIX_DIR}" | ||
21 | |||
22 | export MAKEFLAGS=j$(nproc) | ||
23 | export CFLAGS=-O3 | ||
24 | |||
25 | cd /tmp | ||
26 | |||
27 | echo | ||
28 | echo "=== Building Sodium ${VERSION_SODIUM} ${ARCH} ===" | ||
29 | git clone --depth=1 --branch="${VERSION_SODIUM}" https://github.com/jedisct1/libsodium | ||
30 | cd libsodium | ||
31 | ./autogen.sh | ||
32 | ./configure --host="${WINDOWS_TOOLCHAIN}" --prefix="${PREFIX_DIR}" --disable-shared --enable-static | ||
33 | make | ||
34 | make install | ||
35 | cd .. | ||
36 | |||
37 | echo | ||
38 | echo "=== Building Opus ${VERSION_OPUS} ${ARCH} ===" | ||
39 | git clone --depth=1 --branch="${VERSION_OPUS}" https://github.com/xiph/opus | ||
40 | cd opus | ||
41 | ./autogen.sh | ||
42 | ./configure --host="${WINDOWS_TOOLCHAIN}" --prefix="${PREFIX_DIR}" --disable-extra-programs --disable-doc --disable-shared --enable-static | ||
43 | make | ||
44 | make install | ||
45 | cd .. | ||
46 | |||
47 | echo | ||
48 | echo "=== Building VPX ${VERSION_VPX} ${ARCH} ===" | ||
49 | LIB_VPX_TARGET="" | ||
50 | if [ "${ARCH}" = "i686" ]; then | ||
51 | LIB_VPX_TARGET=x86-win32-gcc | ||
52 | else | ||
53 | LIB_VPX_TARGET=x86_64-win64-gcc | ||
54 | fi | ||
55 | git clone --depth=1 --branch="${VERSION_VPX}" https://github.com/webmproject/libvpx | ||
56 | cd libvpx | ||
57 | CROSS="${WINDOWS_TOOLCHAIN}"- ./configure --target="${LIB_VPX_TARGET}" --prefix="${PREFIX_DIR}" --disable-examples --disable-unit-tests --disable-shared --enable-static | ||
58 | make | ||
59 | make install | ||
60 | cd .. | ||
61 | |||
62 | if [ "${SUPPORT_TEST}" = "true" ]; then | ||
63 | echo | ||
64 | echo "=== Building Check ${VERSION_CHECK} ${ARCH} ===" | ||
65 | git clone --depth=1 --branch="${VERSION_CHECK}" https://github.com/libcheck/check | ||
66 | cd check | ||
67 | autoreconf --install | ||
68 | ./configure --host="${WINDOWS_TOOLCHAIN}" --prefix="${EXTRA_PREFIX_DIR}" | ||
69 | make | ||
70 | make install | ||
71 | cd .. | ||
72 | fi | ||
73 | |||
74 | rm -rf /tmp/* | ||
75 | } | ||
76 | |||
77 | if [ "${SUPPORT_ARCH_i686}" = "true" ]; then | ||
78 | build i686 | ||
79 | fi | ||
80 | |||
81 | if [ "${SUPPORT_ARCH_x86_64}" = "true" ]; then | ||
82 | build x86_64 | ||
83 | fi | ||
84 | |||
85 | tree /root | ||
86 | |||
87 | echo | ||
88 | echo "Built dependencies successfully!" | ||
89 | echo | ||