From 98e21eb8633b31b006671735602df08d3f073261 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Tue, 27 May 2014 11:10:16 +0200 Subject: build: Allow to build astraceroute and flowtop without GeoIP support Both tools are already prepared to handle NULL return values of the geoip_* lookup functions, so we might as well build them without geoip support if not needed/present. Signed-off-by: Tobias Klauser --- INSTALL | 8 ++++++-- astraceroute/Makefile | 13 ++++++++++--- configure | 2 -- flowtop/Makefile | 14 ++++++++++---- 4 files changed, 26 insertions(+), 11 deletions(-) diff --git a/INSTALL b/INSTALL index d828f39..830f6a1 100644 --- a/INSTALL +++ b/INSTALL @@ -20,8 +20,6 @@ What additional tools next to your build-chain are required? What libraries are required? - libncurses: ifpps, flowtop - - libGeoIP >=1.4.8: astraceroute, flowtop, netsniff-ng - - libz: astraceroute, flowtop, netsniff-ng - libnacl or libsodium: curvetun - libnetfilter-conntrack: flowtop - libpcap: mausezahn, netsniff-ng (tcpdump-like filters) @@ -30,6 +28,12 @@ What libraries are required? - libcli: mausezahn - libnet: mausezahn +The following libraries can optionally be used to provide additional +functionality for certain tools: + + - libGeoIP >=1.4.8: astraceroute, flowtop, netsniff-ng + - libz: astraceroute, flowtop, netsniff-ng + What additional tools are recommended, but not mandatory after the build? - cpp: trafgen diff --git a/astraceroute/Makefile b/astraceroute/Makefile index 5574168..5895730 100644 --- a/astraceroute/Makefile +++ b/astraceroute/Makefile @@ -1,6 +1,10 @@ -astraceroute-libs = -lGeoIP \ - -lpthread \ +astraceroute-libs = -lpthread + +ifeq ($(CONFIG_GEOIP), 1) +astraceroute-libs += -lGeoIP \ -lz +endif + astraceroute-objs = xmalloc.o \ ioops.o \ @@ -12,11 +16,14 @@ astraceroute-objs = xmalloc.o \ sock.o \ link.o \ dev.o \ - geoip.o \ ring_rx.o \ ring.o \ astraceroute.o +ifeq ($(CONFIG_GEOIP), 1) +astraceroute-objs += geoip.o +endif + astraceroute-eflags = astraceroute-confs = geoip.conf diff --git a/configure b/configure index 3bda0e0..d9cebff 100755 --- a/configure +++ b/configure @@ -303,8 +303,6 @@ EOF if [ ! -x $TMPDIR/geoiptest ] ; then echo "[NO]" MISSING_DEFS=1 - tools_remove "astraceroute" - tools_remove "flowtop" else echo "[YES]" HAVE_LIBGEOIP=1 diff --git a/flowtop/Makefile b/flowtop/Makefile index 12f8d61..03f628e 100644 --- a/flowtop/Makefile +++ b/flowtop/Makefile @@ -1,11 +1,14 @@ -flowtop-libs = -lGeoIP \ - -lurcu \ +flowtop-libs = -lurcu \ -lnetfilter_conntrack \ $(shell pkg-config --libs ncurses 2> /dev/null \ || echo '-lncurses') \ $(shell pkg-config --libs tinfo 2> /dev/null ) \ - -lpthread \ + -lpthread + +ifeq ($(CONFIG_GEOIP), 1) +flowtop-libs += -lGeoIP \ -lz +endif flowtop-objs = xmalloc.o \ ioops.o \ @@ -21,10 +24,13 @@ flowtop-objs = xmalloc.o \ dissector.o \ proto_none.o \ tprintf.o \ - geoip.o \ screen.o \ flowtop.o +ifeq ($(CONFIG_GEOIP), 1) +flowtop-objs += geoip.o +endif + flowtop-eflags = $(shell pkg-config --cflags ncurses) flowtop-confs = tcp.conf \ -- cgit v1.2.3-54-g00ecf