summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile18
-rw-r--r--libiptc/Makefile10
2 files changed, 21 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index dd28ae5f..c5981310 100644
--- a/Makefile
+++ b/Makefile
@@ -4,22 +4,32 @@ TOPLEVEL_INCLUDED=YES
ifndef KERNEL_DIR
KERNEL_DIR=/usr/src/linux
endif
-NETFILTER_VERSION:=1.1.2
-OLD_NETFILTER_VERSION:=1.1.1
+NETFILTER_VERSION:=1.1.3
+OLD_NETFILTER_VERSION:=1.1.2
LIBDIR:=/usr/local/lib
BINDIR:=/usr/local/bin
MANDIR:=/usr/local/man
INCDIR:=/usr/local/include
+# Need libc6 for this. Should covert to autoconf.
+ifneq ($(shell ldd --version | fgrep 2.2),)
+DO_IPV6=1
+endif
+
COPT_FLAGS:=-O2 -DNDEBUG
CFLAGS:=$(COPT_FLAGS) -Wall -Wunused -Iinclude/ -I$(KERNEL_DIR)/include -DNETFILTER_VERSION=\"$(NETFILTER_VERSION)\" #-g #-pg
DEPFILES = $(SHARED_LIBS:%.so=%.d)
SH_CFLAGS:=$(CFLAGS) -fPIC
-EXTRAS+=iptables iptables.o iptables-save iptables-restore # ip6tables ip6tables.o
-EXTRA_INSTALLS+=$(DESTDIR)$(BINDIR)/iptables $(DESTDIR)$(MANDIR)/man8/iptables.8 $(DESTDIR)$(BINDIR)/iptables-save $(DESTDIR)$(BINDIR)/iptables-restore # $(DESTDIR)$(BINDIR)/ip6tables
+EXTRAS+=iptables iptables.o iptables-save iptables-restore
+EXTRA_INSTALLS+=$(DESTDIR)$(BINDIR)/iptables $(DESTDIR)$(MANDIR)/man8/iptables.8 $(DESTDIR)$(BINDIR)/iptables-save $(DESTDIR)$(BINDIR)/iptables-restore
+
+ifdef DO_IPV6
+EXTRAS+=ip6tables ip6tables.o
+EXTRA_INSTALLS+=$(DESTDIR)$(BINDIR)/ip6tables
+endif
# Sparc64 hack
ifeq ($(shell uname -m),sparc64)
diff --git a/libiptc/Makefile b/libiptc/Makefile
index 18698e4e..a37fa99d 100644
--- a/libiptc/Makefile
+++ b/libiptc/Makefile
@@ -7,10 +7,14 @@ local:
cd .. && $(MAKE) $(KERN_TARGETS) $(SHARED_LIBS) $(EXTRAS)
else
-EXTRA_DEPENDS+=libiptc/libip4tc.d libiptc/libip6tc.d
+EXTRA_DEPENDS+=libiptc/libip4tc.d
-libiptc/libiptc.a: libiptc/libiptc.a(libiptc/libip4tc.o libiptc/libip6tc.o)
-#libiptc/libiptc.a: libiptc/libiptc.a(libiptc/libip4tc.o)
+libiptc/libiptc.a: libiptc/libiptc.a(libiptc/libip4tc.o)
+
+ifdef DO_IPV6
+EXTRA_DEPENDS+= libiptc/libip6tc.d
+libiptc/libiptc.a: libiptc/libiptc.a(libiptc/libip6tc.o)
+endif
libiptc/libip4tc.d libiptc/libip6tc.d: %.d: %.c
@-$(CC) -M -MG $(CFLAGS) $< | sed -e 's@^.*\.o:@$*.d libiptc/libiptc.a($*.o):@' > $@