aboutsummaryrefslogtreecommitdiff
path: root/examples/mswin-build/mkrelease
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2023-06-04 10:56:34 +0100
committerRon Yorston <rmy@pobox.com>2023-06-04 10:56:34 +0100
commit0b6aed138649cb843cbbdfe2ca5ff5e56f3a0825 (patch)
tree35b3eba8e14d4c54d8af6a99e894783b9bb76531 /examples/mswin-build/mkrelease
parente3bfe36959af3029fca49ca3eeb3e05edb7420ac (diff)
downloadbusybox-w32-0b6aed138649cb843cbbdfe2ca5ff5e56f3a0825.tar.gz
busybox-w32-0b6aed138649cb843cbbdfe2ca5ff5e56f3a0825.tar.bz2
busybox-w32-0b6aed138649cb843cbbdfe2ca5ff5e56f3a0825.zip
Example build scripts
Supply the scripts used to build release and prerelease busybox-w32. (GitHub issue #330)
Diffstat (limited to '')
-rwxr-xr-xexamples/mswin-build/mkrelease70
1 files changed, 70 insertions, 0 deletions
diff --git a/examples/mswin-build/mkrelease b/examples/mswin-build/mkrelease
new file mode 100755
index 000000000..7ce9094f6
--- /dev/null
+++ b/examples/mswin-build/mkrelease
@@ -0,0 +1,70 @@
1#!/bin/sh
2#
3# Build 32- and 64-bit busybox binaries for release
4#
5TARGETS="build_32 build_64"
6
7if [ ! -d busybox-w32 ]
8then
9 echo "busybox-w32 doesn't exist"
10 exit 0
11fi
12
13# remove old and make new build directories
14for i in $TARGETS
15do
16 rm -rf $i
17 cp -rp busybox-w32 $i
18done
19
20# apply default configuration
21for i in $TARGETS
22do
23 BITS=32
24 if [ $i = "build_64" ]
25 then
26 BITS=64;
27 fi
28
29 (
30 cd $i
31 make mingw${BITS}_defconfig
32 # link time optimisation, fortify, stack protection
33 sed -e 's/^CONFIG_EXTRA_CFLAGS="\(.*\)"$/CONFIG_EXTRA_CFLAGS="\1 -flto -fstack-protector --param=ssp-buffer-size=4"/' \
34 -e 's/^CONFIG_EXTRA_CFLAGS=" /CONFIG_EXTRA_CFLAGS="/' \
35 -e 's/^CONFIG_EXTRA_LDLIBS="\(.*\)"$/CONFIG_EXTRA_LDLIBS="\1 -l:libssp.a"/' \
36 -e 's/^CONFIG_EXTRA_LDLIBS=" /CONFIG_EXTRA_LDLIBS="/' \
37 -i .config
38 # does ld support --disable-reloc-section?
39 eval $(grep CONFIG_CROSS_COMPILER_PREFIX .config)
40 [ $BITS -eq 32 ] && [ -n "$CONFIG_CROSS_COMPILER_PREFIX" ] && \
41 ${CONFIG_CROSS_COMPILER_PREFIX}ld --help | \
42 grep -q disable-reloc-section &&
43 sed -e 's/^CONFIG_EXTRA_LDFLAGS="\(.*\)"$/CONFIG_EXTRA_LDFLAGS="\1 -Wl,--disable-reloc-section"/' \
44 -e 's/^CONFIG_EXTRA_LDFLAGS=" /CONFIG_EXTRA_LDFLAGS="/' \
45 -i .config
46 )
47done
48
49# perform build
50for i in $TARGETS
51do
52 BITS=32
53 if [ $i = "build_64" ]
54 then
55 BITS=64;
56 fi
57
58 (
59 cd $i
60 GCCV=`rpm -q --qf '%{name} %{version}-%{release}\n' mingw${BITS}-gcc`
61 CRTV=`rpm -q --qf '%{name} %{version}-%{release}\n' mingw${BITS}-crt`
62 GLOB="; noglob"
63 if grep -q ^CONFIG_GLOBBING=y .config
64 then
65 GLOB="; glob"
66 fi
67 VER="($GCCV; $CRTV$GLOB)"
68 make -j $(nproc) EXTRAVERSION="-`git describe --match=FRP`" MINGW_VER="$VER"
69 )
70done