diff options
author | Ron Yorston <rmy@pobox.com> | 2024-09-25 08:46:52 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2024-09-25 08:46:52 +0100 |
commit | 917b8bf5595023494456d8555a1f6b801b737bfc (patch) | |
tree | b9048a1acf6c748c1a7b6ed85bcc4ab1d5d7a910 | |
parent | bca962188b113497221976a71fd18b1c11a120ab (diff) | |
download | busybox-w32-917b8bf5595023494456d8555a1f6b801b737bfc.tar.gz busybox-w32-917b8bf5595023494456d8555a1f6b801b737bfc.tar.bz2 busybox-w32-917b8bf5595023494456d8555a1f6b801b737bfc.zip |
Update sample build scripts
Recent binaries released on frippery.org use the time of the
latest commit as the build time. This is achieved through the
SOURCE_DATE_EPOCH environment variable, which is respected by
the upstream BusyBox build system.
The sample build scripts have been updated to do the same. This
doesn't result in perfectly reproducible builds as the toolchains
used don't all support SOURCE_DATE_EPOCH.
Add some more details to the README file.
-rw-r--r-- | examples/mswin-build/README | 19 | ||||
-rwxr-xr-x | examples/mswin-build/mkprerelease | 6 | ||||
-rwxr-xr-x | examples/mswin-build/mkrelease | 7 |
3 files changed, 25 insertions, 7 deletions
diff --git a/examples/mswin-build/README b/examples/mswin-build/README index 41cd6ebb2..e1d550d74 100644 --- a/examples/mswin-build/README +++ b/examples/mswin-build/README | |||
@@ -5,9 +5,22 @@ latter needs to be downloaded and installed from: | |||
5 | 5 | ||
6 | https://github.com/mstorsjo/llvm-mingw | 6 | https://github.com/mstorsjo/llvm-mingw |
7 | 7 | ||
8 | The release build performs some additional optimisation and is | 8 | The script should be run from the directory above a git repository |
9 | slightly slower as a result. | 9 | named busybox-w32. The builds are performed in the directories |
10 | named in the TARGETS variable in the scripts. Previous copies of | ||
11 | these directories are deleted. | ||
12 | |||
13 | The scripts check out the master branch of the git repository. You | ||
14 | should edit the script if you wish to build from a different commit. | ||
15 | |||
16 | The build time recorded in the executables is the time of the checked | ||
17 | out commit. This may not result in a perfectly reproducible build | ||
18 | but it's a step in that direction. | ||
19 | |||
20 | The release build performs some additional optimisation and takes | ||
21 | slightly longer as a result. | ||
10 | 22 | ||
11 | The busybox-w32 help message includes information about the build | 23 | The busybox-w32 help message includes information about the build |
12 | platform. Obtaining this information is very specific to the | 24 | platform. Obtaining this information is very specific to the |
13 | platform used. | 25 | platform used: you may need to adjust this if building on something |
26 | other than Fedora. | ||
diff --git a/examples/mswin-build/mkprerelease b/examples/mswin-build/mkprerelease index 1bdf886d9..7562c8557 100755 --- a/examples/mswin-build/mkprerelease +++ b/examples/mswin-build/mkprerelease | |||
@@ -45,7 +45,8 @@ do | |||
45 | 45 | ||
46 | cd $i | 46 | cd $i |
47 | git checkout master | 47 | git checkout master |
48 | make ${CONFIG} | 48 | SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) TZ=UTC0 \ |
49 | make ${CONFIG} | ||
49 | ) | 50 | ) |
50 | done | 51 | done |
51 | 52 | ||
@@ -70,7 +71,8 @@ do | |||
70 | CRTV=$(rpm -q --qf '%{name} %{version}-%{release}\n' mingw${BITS}-crt) | 71 | CRTV=$(rpm -q --qf '%{name} %{version}-%{release}\n' mingw${BITS}-crt) |
71 | VERSION="$GCCV; $CRTV" | 72 | VERSION="$GCCV; $CRTV" |
72 | fi | 73 | fi |
73 | make -j $(nproc) EXTRAVERSION="-$(git describe --match=FRP | sed 's/FRP/PRE/')" MINGW_VER="$VERSION" | 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" | ||
74 | ) | 76 | ) |
75 | done | 77 | done |
76 | 78 | ||
diff --git a/examples/mswin-build/mkrelease b/examples/mswin-build/mkrelease index 6dfd6c87e..2f59dce13 100755 --- a/examples/mswin-build/mkrelease +++ b/examples/mswin-build/mkrelease | |||
@@ -41,7 +41,9 @@ do | |||
41 | fi | 41 | fi |
42 | 42 | ||
43 | cd $i | 43 | cd $i |
44 | make ${CONFIG} | 44 | git checkout master |
45 | SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) TZ=UTC0 \ | ||
46 | make ${CONFIG} | ||
45 | 47 | ||
46 | # The clang/aarch64 build is not subject to optimisation. The | 48 | # The clang/aarch64 build is not subject to optimisation. The |
47 | # '-flto' option increased the size of the binary slightly (0.23%) | 49 | # '-flto' option increased the size of the binary slightly (0.23%) |
@@ -89,7 +91,8 @@ do | |||
89 | CRTV=$(rpm -q --qf '%{name} %{version}-%{release}\n' mingw${BITS}-crt) | 91 | CRTV=$(rpm -q --qf '%{name} %{version}-%{release}\n' mingw${BITS}-crt) |
90 | VERSION="$GCCV; $CRTV" | 92 | VERSION="$GCCV; $CRTV" |
91 | fi | 93 | fi |
92 | make -j $(nproc) EXTRAVERSION="-`git describe --match=FRP`" MINGW_VER="$VERSION" | 94 | SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) TZ=UTC0 \ |
95 | make -j $(nproc) EXTRAVERSION="-`git describe --match=FRP`" MINGW_VER="$VERSION" | ||
93 | ) | 96 | ) |
94 | done | 97 | done |
95 | 98 | ||