Skip to content

Commit

Permalink
Enable static builds with --prefer-static
Browse files Browse the repository at this point in the history
Static builds of the culvert binary allow it to run anywhere without
having to worry about packaging up libraries. This is useful if sending
the binary to 3rd parties to run or when trying to support multiple
Linux distributions that may have very old system libraries.

Signed-off-by: Ian Woloschin <[email protected]>
[AJ: Drop static kwarg for libfdt dependency, fix actions]
Signed-off-by: Andrew Jeffery <[email protected]>
  • Loading branch information
iwoloschin authored and amboar committed Nov 30, 2023
1 parent 5b60f09 commit 605255a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ jobs:
run: sudo apt-get install -qq
gcc
gcc-arm-linux-gnueabi libc-dev-armel-cross
git meson device-tree-compiler qemu-user
git device-tree-compiler qemu-user
python3-pip
- name: Install current meson
run: pip3 install --user meson~=0.63
- uses: actions/checkout@v2
- name: arm32
# meson compile requires 0.54, but Ubuntu 20.04 ships 0.53, so run ninja directly
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ project('culvert', 'c',
'b_lto=true',
'b_ndebug=true',
],
meson_version: '>=0.53.0',
meson_version: '>=0.63.0',
version: 'v0.4.0')

add_global_link_arguments('-z', 'noexecstack', language: 'c')
Expand Down
4 changes: 4 additions & 0 deletions src/meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
fs = import('fs')

if get_option('prefer_static')
add_project_link_arguments('-static', language: 'c')
endif

incdirs = [ '.' ]

src = files(
Expand Down

0 comments on commit 605255a

Please sign in to comment.