aboutsummaryrefslogtreecommitdiffstats
path: root/build-scripts/build-windows
blob: 815436688c163e8feac9a3ff26485e1b596ee975 (plain) (blame)
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
#!/bin/bash
set -ex
cd $(dirname $0)/..
wordsize=$1
tool=$2

if [[ $tool == mingw ]]; then
    pacman -Sy --noconfirm make base-devel tar zip unzip
    if [ -d /c/msys64 ]; then
        PATH="/c/msys64/mingw$wordsize/bin:$PATH"
    else
        if [[ $wordsize == 64 ]]; then
            pacman -Sy --noconfirm mingw-w64-x86_64-toolchain
        else
            pacman -Sy --noconfirm mingw-w64-i686-toolchain
        fi
        PATH="/c/tools/msys64/mingw$wordsize/bin:$PATH"
    fi
    g++ -v
elif [[ $tool == msvc ]]; then
    cl
fi
unzip doc.zip
unzip qpdf-external-libs-bin.zip
cwd=`pwd`
PATH=$cwd/libqpdf/build:$PATH

installdir=install-$tool$wordsize
rm -rf $installdir
./config-$tool --enable-show-failed-test-output
make -j$(nproc) -k
make -k check
make install

v=`(cd $installdir; ls -d qpdf-*)`
cp -p README-windows-install.txt $installdir/$v/README.txt
mkdir distribution
(cd $installdir; zip -r ../distribution/$v-bin-$tool$wordsize-ci.zip $v)
sha256sum distribution/*