This finally creates the libnftables shared object.
For some reason, this causes two compiler warnings to appear:
| parser_bison.y: In function 'nft_parse':
| parser_bison.y:131:3: warning: implicit declaration of function 'nft_set_debug' [-Wimplicit-function-declaration]
| nft_set_debug(1, scanner);
| ^~~~~~~~~~~~~
| parser_bison.c:64:25: warning: implicit declaration of function 'nft_lex' [-Wimplicit-function-declaration]
| #define yylex nft_lex
| ^
| parser_bison.c:4745:16: note: in expansion of macro 'yylex'
| yychar = yylex (&yylval, &yylloc, scanner);
So this patch contains a workaround, namely declaring both functions
in src/parser_bison.y. During linking the objects are found, so this is
rather a matter of cosmetics.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
# Dependency and object files
.*.d
+*.lo
*.o
# Generated by autoconf/configure/automake
Makefile.in
src/Makefile.in
src/.deps/
+src/.libs/
stamp-h1
config.h
config.h.in
configure
autom4te.cache
build-aux/
+libnftables.pc
libtool
missing
depcomp
files
EXTRA_DIST = tests
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = libnftables.pc
exit 1
fi
+AM_PROG_AR
+AM_PROG_LIBTOOL
+
AC_CHECK_PROG(DOCBOOK2X_MAN, [docbook2x-man], [docbook2x-man], [no])
AC_CHECK_PROG(DOCBOOK2MAN, [docbook2man], [docbook2man], [no])
AC_CHECK_PROG(DB2X_DOCBOOK2MAN, [db2x_docbook2man], [db2x_docbook2man], [no])
AC_CONFIG_FILES([ \
Makefile \
+ libnftables.pc \
src/Makefile \
include/Makefile \
include/nftables/Makefile \
--- /dev/null
+# libnftables pkg-config file
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: libnftables
+Description: Netfilter nf_tables user library
+URL: http://netfilter.org/projects/nftables/
+Version: @VERSION@
+Requires:
+Conflicts:
+Libs: -L${libdir} -lnftables
+Cflags: -I${includedir}
+libnftables.la
parser.c
parser.h
scanner.c
BUILT_SOURCES = parser_bison.h
-nft_SOURCES = main.c \
+lib_LTLIBRARIES = libnftables.la
+
+libnftables_la_SOURCES = \
rule.c \
statement.c \
datatype.c \
parser_bison.y \
libnftables.c
-if BUILD_CLI
-nft_SOURCES += cli.c
-endif
-
if BUILD_MINIGMP
mini-gmp.o: AM_CFLAGS += -Wno-sign-compare
-nft_SOURCES += mini-gmp.c
+libnftables_la_SOURCES += mini-gmp.c
endif
-nft_LDADD = ${LIBMNL_LIBS} ${LIBNFTNL_LIBS}
+libnftables_la_LIBADD = ${LIBMNL_LIBS} ${LIBNFTNL_LIBS}
if BUILD_XTABLES
-nft_SOURCES += xt.c
-nft_LDADD += ${XTABLES_LIBS}
+libnftables_la_SOURCES += xt.c
+libnftables_la_LIBADD += ${XTABLES_LIBS}
endif
+
+nft_SOURCES = main.c
+
+if BUILD_CLI
+nft_SOURCES += cli.c
+endif
+
+nft_LDADD = libnftables.la
#define symbol_value(loc, str) \
symbol_expr_alloc(loc, SYMBOL_VALUE, current_scope(state), str)
+
+/* Declare those here to avoid compiler warnings */
+void nft_set_debug(int, void *);
+int nft_lex(void *, void *, void *);
%}
/* Declaration section */