-
Notifications
You must be signed in to change notification settings - Fork 83
/
build.sh
executable file
·72 lines (65 loc) · 1.89 KB
/
build.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
#!/bin/sh
# build.sh
# (C) 2018, all rights reserved,
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
if [ "`uname -s`" != "Linux" ]
then
echo "$0: error: this build script is only for Linux" >&2
exit 1
fi
DIVERT=
while getopts "hd:" OPTION
do
case $OPTION in
d) DIVERT=$OPTARG;;
?) echo "usage: $0 [-h] [-d <divert-install-path>]" >&2
exit 1;;
esac
done
set -e
set -x
# Build Linux 64/32-bit
rm -rf autom4te.cache cfg.mk config.log config.status configure
autoconf
./configure
make client_install
# make client_install32
make server_install
# Build Windows 64/32-bit
DIVERT_VERSION=WinDivert-1.4.3-A
set +x
if [ "$DIVERT" = "" ]
then
if [ ! -d "$DIVERT_VERSION/" ]
then
wget https://reqrypt.org/download/$DIVERT_VERSION.zip
unzip $DIVERT_VERSION.zip
set -x
if [ ! -d "$DIVERT_VERSION/" ]
then
echo "$0: unable to download divert package; cannot build \
windows client" 1>&2
exit 1
fi
fi
DIVERT=$DIVERT_VERSION/
fi
set -x
rm -rf autom4te.cache cfg.mk config.log config.status configure
autoconf -o configure configure-windows.ac
./configure --host=i686-w64-mingw32 "DIVERT=$DIVERT"
make client_install_windows
./configure --host=x86_64-w64-mingw32 "DIVERT=$DIVERT"
make client_install_windows