netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* static libnftables by now?
@ 2017-11-24 14:02 Pablo Neira Ayuso
  2017-11-30 17:11 ` [nft PATCH] Make libnftables a local static library Phil Sutter
  0 siblings, 1 reply; 6+ messages in thread
From: Pablo Neira Ayuso @ 2017-11-24 14:02 UTC (permalink / raw)
  To: Phil Sutter; +Cc: netfilter-devel

Hi 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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [nft PATCH] Make libnftables a local static library
  2017-11-24 14:02 static libnftables by now? Pablo Neira Ayuso
@ 2017-11-30 17:11 ` Phil Sutter
  2017-11-30 17:36   ` Jan Engelhardt
  0 siblings, 1 reply; 6+ messages in thread
From: Phil Sutter @ 2017-11-30 17:11 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: netfilter-devel

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.

Signed-off-by: Phil Sutter <phil@nwl.cc>
---
 Makefile.am     |  3 ---
 src/Makefile.am | 14 ++++++--------
 2 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 9af25ded836b8..10aa40f14127f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -6,6 +6,3 @@ SUBDIRS = 	src	\
 		files
 
 EXTRA_DIST =	tests
-
-pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = libnftables.pc
diff --git a/src/Makefile.am b/src/Makefile.am
index 9f7a4bfbb90a4..07ddfd590dd8f 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -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
-- 
2.13.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [nft PATCH] Make libnftables a local static library
  2017-11-30 17:11 ` [nft PATCH] Make libnftables a local static library Phil Sutter
@ 2017-11-30 17:36   ` Jan Engelhardt
  2017-11-30 18:30     ` Phil Sutter
  0 siblings, 1 reply; 6+ messages in thread
From: Jan Engelhardt @ 2017-11-30 17:36 UTC (permalink / raw)
  To: Phil Sutter; +Cc: Pablo Neira Ayuso, netfilter-devel


On Thursday 2017-11-30 18:11, Phil Sutter wrote:

>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.
>
>diff --git a/src/Makefile.am b/src/Makefile.am
>index 9f7a4bfbb90a4..07ddfd590dd8f 100644
>--- a/src/Makefile.am
>+++ b/src/Makefile.am
>@@ -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

Making it a noinst_LTLIBRARIES would have the benefit that its dependencies are
at least recorded.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [nft PATCH] Make libnftables a local static library
  2017-11-30 17:36   ` Jan Engelhardt
@ 2017-11-30 18:30     ` Phil Sutter
  2017-11-30 18:36       ` [nft PATCH v2] " Phil Sutter
  0 siblings, 1 reply; 6+ messages in thread
From: Phil Sutter @ 2017-11-30 18:30 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: Pablo Neira Ayuso, netfilter-devel

On Thu, Nov 30, 2017 at 06:36:04PM +0100, Jan Engelhardt wrote:
> 
> On Thursday 2017-11-30 18:11, Phil Sutter wrote:
> 
> >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.
> >
> >diff --git a/src/Makefile.am b/src/Makefile.am
> >index 9f7a4bfbb90a4..07ddfd590dd8f 100644
> >--- a/src/Makefile.am
> >+++ b/src/Makefile.am
> >@@ -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
> 
> Making it a noinst_LTLIBRARIES would 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [nft PATCH v2] Make libnftables a local static library
  2017-11-30 18:30     ` Phil Sutter
@ 2017-11-30 18:36       ` Phil Sutter
  2017-12-04 10:06         ` Pablo Neira Ayuso
  0 siblings, 1 reply; 6+ messages in thread
From: Phil Sutter @ 2017-11-30 18:36 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: netfilter-devel

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.

Signed-off-by: Phil Sutter <phil@nwl.cc>
---
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(-)

diff --git a/src/.gitignore b/src/.gitignore
index 36d6acd1e4d01..e27d4f8431eec 100644
--- a/src/.gitignore
+++ b/src/.gitignore
@@ -1,3 +1,4 @@
+libnftables.a
 libnftables.la
 parser.c
 parser.h
diff --git a/src/Makefile.am b/src/Makefile.am
index 9f7a4bfbb90a4..7581ec2090092 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -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				\
-- 
2.13.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [nft PATCH v2] Make libnftables a local static library
  2017-11-30 18:36       ` [nft PATCH v2] " Phil Sutter
@ 2017-12-04 10:06         ` Pablo Neira Ayuso
  0 siblings, 0 replies; 6+ messages in thread
From: Pablo Neira Ayuso @ 2017-12-04 10:06 UTC (permalink / raw)
  To: Phil Sutter; +Cc: netfilter-devel

On Thu, Nov 30, 2017 at 07:36:23PM +0100, Phil Sutter wrote:
> 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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-12-04 10:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-24 14:02 static libnftables by now? Pablo Neira Ayuso
2017-11-30 17:11 ` [nft PATCH] Make libnftables a local static library Phil Sutter
2017-11-30 17:36   ` Jan Engelhardt
2017-11-30 18:30     ` Phil Sutter
2017-11-30 18:36       ` [nft PATCH v2] " Phil Sutter
2017-12-04 10:06         ` Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).