aboutsummaryrefslogtreecommitdiff
path: root/examples/mswin-build/mkprerelease
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xexamples/mswin-build/mkprerelease84
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#
5TARGETS="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.
8SRC=busybox-w32
9if [ $# -eq 1 ]
10then
11 SRC=$1
12fi
13
14if [ ! -d $SRC ]
15then
16 echo "$SRC doesn't exist"
17 exit 0
18fi
19
20# remove old and make new build directories
21for i in $TARGETS
22do
23 rm -rf $i
24 cp -rp $SRC $i
25done
26
27# apply default configuration
28for i in $TARGETS
29do
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 )
51done
52
53# perform build
54for i in $TARGETS
55do
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 )
77done
78
79# Check the expected binaries exist
80echo
81for i in $TARGETS
82do
83 ls -l $i/busybox.exe
84done