Assign "-all-static" (instead of "-static") to "static_LDFLAGS" in
Makefile.am, as libtool will only produce a static binary if it is
explicitly told that all of the linked libraries should be static.
BEFORE
$ file static
static: ELF 32-bit LSB pie executable, Intel 80386, version 1 (SYSV),
dynamically linked, interpreter /lib/ld-musl-i386.so.1,
not stripped
AFTER
$ file static
static: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV),
statically linked, not stripped
REFERENCE
"Another common situation where static linking is desirable is in
creating a standalone binary. Use libtool to do the linking and
add the -all-static flag." -- Libtool Manual, Section 3.7
Signed-off-by: Justin Swartz <justin.swartz@xxxxxxxxxxxxxxxx>
---
Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile.am b/Makefile.am
index b246064..d011919 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -51,7 +51,7 @@ ebtablesd_LDADD = libebtc.la
ebtables_legacy_restore_SOURCES = ebtables-restore.c
ebtables_legacy_restore_LDADD = libebtc.la
static_SOURCES = ebtables-standalone.c $(libebtc_la_SOURCES)
-static_LDFLAGS = -static
+static_LDFLAGS = -all-static
examples_ulog_test_ulog_SOURCES = examples/ulog/test_ulog.c
getethertype.c
daemon: ebtablesd ebtablesu