static libnftables by now?
Pablo Neira Ayuso
maintainerHi Phil,
Until the library API is stable, before 0.9.0 release, I think it would be good if we make it static by now.
This would also allow me to make more frequent 0.8.x releases including fixes and such.
What do you think? Would you have a look into it?
Thanks.
Phil Sutter
reviewerPATCH 1/1 Make libnftables a local static library
This changes Makefiles so that libnftables is built into a static library which is not installed. This allows for incompatible changes while still providing a library to link to for testing purposes.
--- Makefile.am | 3 --- src/Makefile.am | 14 ++++++-------- 2 files changed, 6 insertions(+), 11 deletions(-)
Makefile.am +0 -3
@@ -6,6 +6,3 @@ SUBDIRS = src \ files EXTRA_DIST = tests - -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = libnftables.pc
src/Makefile.am +6 -8
@@ -27,9 +27,9 @@ parser_bison.o scanner.o: AM_CFLAGS += -Wno-missing-prototypes -Wno-missing-decl BUILT_SOURCES = parser_bison.h -lib_LTLIBRARIES = libnftables.la +noinst_LIBRARIES = libnftables.a -libnftables_la_SOURCES = \ +libnftables_a_SOURCES = \ rule.c \ statement.c \ datatype.c \
@@ -64,14 +64,14 @@ libnftables_la_SOURCES = \ if BUILD_MINIGMP mini-gmp.o: AM_CFLAGS += -Wno-sign-compare -libnftables_la_SOURCES += mini-gmp.c +libnftables_a_SOURCES += mini-gmp.c endif -libnftables_la_LIBADD = ${LIBMNL_LIBS} ${LIBNFTNL_LIBS} +nft_LDADD = libnftables.a ${LIBMNL_LIBS} ${LIBNFTNL_LIBS} if BUILD_XTABLES -libnftables_la_SOURCES += xt.c -libnftables_la_LIBADD += ${XTABLES_LIBS} +libnftables_a_SOURCES += xt.c +nft_LDADD += ${XTABLES_LIBS} endif nft_SOURCES = main.c
@@ -79,5 +79,3 @@ nft_SOURCES = main.c if BUILD_CLI nft_SOURCES += cli.c endif - -nft_LDADD = libnftables.la
Signature · 1 line
2.13.1
Re: [nft PATCH] Make libnftables a local static library
Quoted 12 lines · Phil Sutter
This changes Makefiles so that libnftables is built into a static library which is not installed. This allows for incompatible changes while still providing a library to link to for testing purposes.
src/Makefile.am +0
-0@@ -27,9 +27,9 @@ parser_bison.o scanner.o: AM_CFLAGS += -Wno-missing-prototypes -Wno-missing-decl
BUILT_SOURCES=parser_bison.h
src/Makefile.am parser_bison.o scanner.o: AM_CFLAGS += -Wno-missing-prototypes -Wno-missing-decl · line 30
Quoted 2 lines
src/Makefile.am +1
-1-lib_LTLIBRARIES = libnftables.la +noinst_LIBRARIES = libnftables.a
Making it a noinst_LTLIBRARIES would have the benefit that its dependencies are at least recorded.
Phil Sutter
reviewerRe: [nft PATCH] Make libnftables a local static library
Quoted 13 lines · Jan Engelhardt
Quoted 10 lines · Phil Sutter
This changes Makefiles so that libnftables is built into a static library which is not installed. This allows for incompatible changes while still providing a library to link to for testing purposes.
src/Makefile.am +0
-0@@ -27,9 +27,9 @@ parser_bison.o scanner.o: AM_CFLAGS += -Wno-missing-prototypes -Wno-missing-decl
Quoted 7 lines
src/Makefile.am parser_bison.o scanner.o: AM_CFLAGS += -Wno-missing-prototypes -Wno-missing-decl · line 30
Quoted 4 lines
BUILT_SOURCES=parser_bison.hsrc/Makefile.am +1
-1-lib_LTLIBRARIES = libnftables.la +noinst_LIBRARIES = libnftables.aMaking it a
noinst_LTLIBRARIESwould have the benefit that its dependencies are at least recorded.
Oh, thanks for the hint! I wasn't aware this is supported at all. In fact, doing so shrinks my patch to a one-liner. :)
Thanks, Phil
Phil Sutter
reviewerPATCH v2 1/1 Make libnftables a local static library
This changes Makefiles so that libnftables is built into a static library which is not installed. This allows for incompatible changes while still providing a library to link to for testing purposes.
---
Changes since v1:
- Keep it a libtool library.
- Update src/.gitignore.
--- src/.gitignore | 1 + src/Makefile.am | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)
src/.gitignore +1 -0
@@ -1,3 +1,4 @@ +libnftables.a libnftables.la parser.c parser.h
src/Makefile.am +1 -1
@@ -27,7 +27,7 @@ parser_bison.o scanner.o: AM_CFLAGS += -Wno-missing-prototypes -Wno-missing-decl BUILT_SOURCES = parser_bison.h -lib_LTLIBRARIES = libnftables.la +noinst_LTLIBRARIES = libnftables.la libnftables_la_SOURCES = \ rule.c \
Signature · 1 line
2.13.1
Re: [nft PATCH v2] Make libnftables a local static library
Quoted 3 lines · Phil Sutter
This changes Makefiles so that libnftables is built into a static library which is not installed. This allows for incompatible changes while still providing a library to link to for testing purposes.
Applied, thanks Phil.