diff options
Diffstat (limited to '')
-rwxr-xr-x | examples/mswin-build/mkprerelease | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/examples/mswin-build/mkprerelease b/examples/mswin-build/mkprerelease new file mode 100755 index 000000000..7562c8557 --- /dev/null +++ b/examples/mswin-build/mkprerelease | |||
@@ -0,0 +1,84 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # Build busybox prerelease binaries | ||
4 | # | ||
5 | TARGETS="build_pre_32 build_pre_64 build_pre_64a build_pre_64u" | ||
6 | |||
7 | # If an argument is supplied it overrides the default source directory. | ||
8 | SRC=busybox-w32 | ||
9 | if [ $# -eq 1 ] | ||
10 | then | ||
11 | SRC=$1 | ||
12 | fi | ||
13 | |||
14 | if [ ! -d $SRC ] | ||
15 | then | ||
16 | echo "$SRC doesn't exist" | ||
17 | exit 0 | ||
18 | fi | ||
19 | |||
20 | # remove old and make new build directories | ||
21 | for i in $TARGETS | ||
22 | do | ||
23 | rm -rf $i | ||
24 | cp -rp $SRC $i | ||
25 | done | ||
26 | |||
27 | # apply default configuration | ||
28 | for i in $TARGETS | ||
29 | do | ||
30 | ( | ||
31 | if [ $i = "build_pre_64" ] | ||
32 | then | ||
33 | CONFIG=mingw64_defconfig | ||
34 | elif [ $i = "build_pre_64u" ] | ||
35 | then | ||
36 | CONFIG=mingw64u_defconfig | ||
37 | elif [ $i = "build_pre_64a" ] | ||
38 | then | ||
39 | CONFIG=mingw64a_defconfig | ||
40 | PATH="/data2/llvm/current/bin:$PATH" | ||
41 | elif [ $i = "build_pre_32" ] | ||
42 | then | ||
43 | CONFIG=mingw32_defconfig | ||
44 | fi | ||
45 | |||
46 | cd $i | ||
47 | git checkout master | ||
48 | SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) TZ=UTC0 \ | ||
49 | make ${CONFIG} | ||
50 | ) | ||
51 | done | ||
52 | |||
53 | # perform build | ||
54 | for i in $TARGETS | ||
55 | do | ||
56 | BITS=64 | ||
57 | if [ $i = "build_pre_32" ] | ||
58 | then | ||
59 | BITS=32; | ||
60 | fi | ||
61 | |||
62 | ( | ||
63 | cd $i | ||
64 | if [ $i = "build_pre_64a" ] | ||
65 | then | ||
66 | # /data2/llvm/current should be a symlink | ||
67 | PATH="/data2/llvm/current/bin:$PATH" | ||
68 | VERSION=$(readlink /data2/llvm/current) | ||
69 | else | ||
70 | GCCV=$(rpm -q --qf '%{name} %{version}-%{release}\n' mingw${BITS}-gcc) | ||
71 | CRTV=$(rpm -q --qf '%{name} %{version}-%{release}\n' mingw${BITS}-crt) | ||
72 | VERSION="$GCCV; $CRTV" | ||
73 | fi | ||
74 | SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) TZ=UTC0 \ | ||
75 | make -j $(nproc) EXTRAVERSION="-$(git describe --match=FRP | sed 's/FRP/PRE/')" MINGW_VER="$VERSION" | ||
76 | ) | ||
77 | done | ||
78 | |||
79 | # Check the expected binaries exist | ||
80 | echo | ||
81 | for i in $TARGETS | ||
82 | do | ||
83 | ls -l $i/busybox.exe | ||
84 | done | ||