-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
base: add build-static-ioc.sh to musl image.
This script automates building fully statically linked IOCs using the musl image. Also document it in the README.
- Loading branch information
Showing
3 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/sh | ||
|
||
set -ex | ||
|
||
IOC=$1 | ||
|
||
cp /opt/epics/RELEASE configure/ | ||
cat << EOF > configure/CONFIG_SITE.local | ||
STATIC_BUILD=YES | ||
FULL_STATIC_BUILD=YES | ||
USR_LDFLAGS = -static-pie | ||
EOF | ||
|
||
git config --global --add safe.directory $PWD | ||
|
||
make_skip() { | ||
if [ -z "$SKIP_CLEAN" ]; then | ||
make "$@" | ||
fi | ||
} | ||
|
||
make_skip distclean | ||
make | ||
make_skip clean | ||
make -C iocBoot | ||
|
||
version=$(git describe --tags) | ||
|
||
echo $version > $IOC-version | ||
echo ".git/" > /tmp/globs | ||
# this trick is done so the resulting tarball has a root $IOC/ directory | ||
(cd .. && tar caf $IOC/$IOC-${version}.tar.gz -X /tmp/globs $IOC/) | ||
rm $IOC-version | ||
|
||
make_skip distclean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters