conntrack-tools compilation problem
PATCH 1/1 conntrack-tools compilation problem
Hi Pablo,
I've just tried to build conntrack-tools and all the required netfilter libraries from scratch. The libs were built and installed without problems, but then conntrack-tools failed to compile with a missing include problem.
Looks like conntrack-tools' autoconf/automake templates do not properly use pkg-config information. configure.in detects the presence of libnfnetlink and libnetfilter_conntrack using pkg-config, but then fails to add the necessary flags to the compile and linker flags. For me, this is a problem because all those libraries live under /opt/netfilter, and thus compilation fails because of missing headers.
The attached patch fixes this problem for me, although I'm quite sure that it does not break compilation for someone else. (Should not, but I'm not much of an autoconf expert...)
--
KOVACS Krisztian
configure.in +4 -0
@@ -104,4 +104,8 @@ dnl extensions/Makefile dnl src/Makefile]) +CFLAGS="$CFLAGS $LIBNETFILTER_CONNTRACK_CFLAGS" + +AC_SUBST(LIBNETFILTER_CONNTRACK_LIBS) + AC_OUTPUT(Makefile src/Makefile include/Makefile extensions/Makefile)
src/Makefile.am +2 -1
@@ -8,6 +8,7 @@ conntrack_SOURCES = conntrack.c conntrack_LDADD = ../extensions/libct_proto_tcp.la ../extensions/libct_proto_udp.la ../extensions/libct_proto_icmp.la +conntrack_LDFLAGS = $(all_libraries) @LIBNETFILTER_CONNTRACK_LIBS@ conntrackd_SOURCES = alarm.c main.c run.c hash.c buffer.c \ local.c log.c mcast.c netlink.c \
@@ -22,6 +23,6 @@ build.c parse.c \ read_config_yy.y read_config_lex.l -conntrackd_LDFLAGS = $(all_libraries) -lnfnetlink -lnetfilter_conntrack +conntrackd_LDFLAGS = $(all_libraries) @LIBNETFILTER_CONNTRACK_LIBS@ EXTRA_DIST = read_config_yy.h
Makefile.am +1 -1
@@ -9,7 +9,7 @@ SUBDIRS = extensions src DIST_SUBDIRS = include src extensions -LINKOPTS = -lnfnetlink -lnetfilter_conntrack -lpthread +LIBS = @LIBNETFILTER_CONNTRACK_LIBS@ AM_CFLAGS = -g $(OBJECTS): libtool
Quoted 4 lines · KOVACS Krisztian
The attached patch fixes this problem for me, although I'm quite sure that it does not break compilation for someone else. (Should not, but I'm not much of an autoconf expert...)
Given that the lines the patchs adds _already exist_ in libnetfilter_conntrack (that is, to properly include libnfnetlink). So that should be fine :)
Jan
Hi,
Quoted 6 lines · Jan Engelhardt
Quoted 3 lines
The attached patch fixes this problem for me, although I'm quite sure that it does not break compilation for someone else. (Should not, but I'm not much of an autoconf expert...)
Given that the lines the patchs adds
_alreadyexist_inlibnetfilter_conntrack(that is, to properly include libnfnetlink). So that should be fine :)
Yep, but those lines were added by patch of mine long ago, so it's also possible that I'm just trying to cripple conntrack-tools, too... ;)
Signature · 1 line
KOVACS Krisztian
Quoted 12 lines · KOVACS Krisztian
I've just tried to build conntrack-tools and all the required netfilter libraries from scratch. The libs were built and installed without problems, but then conntrack-tools failed to compile with a missing include problem.
Looks like conntrack-tools' autoconf/automake templates do not properly use pkg-config information. configure.in detects the presence of libnfnetlink and
libnetfilter_conntrackusing pkg-config, but then fails to add the necessary flags to the compile and linker flags. For me, this is a problem because all those libraries live under/opt/netfilter, and thus compilation fails because of missing headers.
Quoted 3 lines
The attached patch fixes this problem for me, although I'm quite sure that it does not break compilation for someone else. (Should not, but I'm not much of an autoconf expert...)
Applied, thanks Krisztian!
Signature · 2 lines
"Será preciso viajar a través de los ojos de los idiotas" -- Poeta en Nueva York -- Federico García Lorca.