From d7f6b63f0a026494152f15822271521d8eec7393 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 15 Oct 2007 14:44:06 +1000 Subject: [PATCH] only link to -lipq if needed (This used to be ctdb commit 7c378d881e37db0f14e07ccba19fde1f9f4f0831) --- ctdb/Makefile.in | 4 +++- ctdb/configure.ac | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ctdb/Makefile.in b/ctdb/Makefile.in index bf06a92a891..0dce3aa8187 100644 --- a/ctdb/Makefile.in +++ b/ctdb/Makefile.in @@ -23,6 +23,8 @@ POPT_LIBS = @POPT_LIBS@ POPT_CFLAGS = @POPT_CFLAGS@ POPT_OBJ = @POPT_OBJ@ +IPQ_LIBS = @IPQ_LIBS@ + CFLAGS=-g -I$(srcdir)/include -Iinclude -Ilib -Ilib/util -I$(srcdir) \ -I@tallocdir@ -I@tdbdir@/include -I@libreplacedir@ \ -DVARDIR=\"$(localstatedir)\" -DETCDIR=\"$(etcdir)\" \ @@ -86,7 +88,7 @@ bin/scsi_io: $(CTDB_CLIENT_OBJ) utils/scsi_io/scsi_io.o bin/ctdb_ipmux: $(CTDB_CLIENT_OBJ) utils/ipmux/ipmux.o @echo Linking $@ - @$(CC) $(CFLAGS) -o $@ utils/ipmux/ipmux.o $(CTDB_CLIENT_OBJ) $(LIB_FLAGS) -lipq + @$(CC) $(CFLAGS) -o $@ utils/ipmux/ipmux.o $(CTDB_CLIENT_OBJ) $(LIB_FLAGS) $(IPQ_LIBS) bin/ctdb: $(CTDB_CLIENT_OBJ) tools/ctdb.o @echo Linking $@ diff --git a/ctdb/configure.ac b/ctdb/configure.ac index b782c70f056..d552eed00b4 100644 --- a/ctdb/configure.ac +++ b/ctdb/configure.ac @@ -49,6 +49,12 @@ m4_include(ib/config.m4) AC_CHECK_HEADERS(libipq.h linux/netfilter.h) +IPQ_LIBS="" +if test x"$ac_cv_header_libipq_h" = x"yes"; then + IPQ_LIBS="-lipq" +fi +AC_SUBST(IPQ_LIBS) + AC_CHECK_HEADERS(sched.h) AC_CHECK_FUNCS(sched_setscheduler)