summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--INSTALL40
-rw-r--r--Makefile17
2 files changed, 36 insertions, 21 deletions
diff --git a/INSTALL b/INSTALL
index a7744bb..991f3c9 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,32 +1,40 @@
FOLLOW THESE STEPS:
===================
-Make sure /usr/src/linux contains the kernel headers you're building
-against. If /usr/src/linux is an older kernel, set the KERNEL_DIR
-environment variable to point to the current kernel sources.
+1) If /usr/src/linux contains the kernel headers of a recent 2.4
+ kernel:
+ % make
-If you forget the above step, a bogus dependency files with a ".d"
-extension may be created. If you see messages like:
- make: *** No rule to make target `include/linux/netfilter_ipv4/ipt_limit.h',
- needed by `iptables.d'. Stop.
+ Otherwise:
+ % make KERNEL_DIR=<<where-your-kernel-is>>
-then you have these bogus dependency files. Do this:
+2) Finally, you need to to install the shared libraries, and the binary:
+ # make install
+ Or
+ # make install KERNEL_DIR=<<where-your-kernel-is>>
- % make distclean
+That's it!
+================
+Problems you may encounter:
-To build, just do:
+1) If your kernel is too old, you may be asked to apply one or more of
+ the patches in the directory to your kernel. This can be safely
+ done as follows:
- % make
+ cp -al <<where-your-kernel-is>> <<where-your-kernel-is>>.backup
+ cd <<where-your-kernel-is>>
+ patch -p1 < <<whatever-the-patchfile-is>>
-Finally, you need to to install the shared libraries, and the binary:
+ Then start again.
- # make install
+2) If you get the kernel directory wrong, you may see a message like:
+ Please try `make KERNEL_DIR=path-to-correct-kernel'
-If you want to specify alternate directories for installation (instead
-of /usr/local/ bin lib man), do this:
+3) If you want to specify alternate directories for installation
+(instead of /usr/local/ bin lib man), do this:
% make BINDIR=/usr/bin LIBDIR=/usr/lib MANDIR=/usr/man
- % make BINDIR=/usr/bin LIBDIR=/usr/lib MANDIR=/usr/man install
+ # make BINDIR=/usr/bin LIBDIR=/usr/lib MANDIR=/usr/man install
NOTE: make sure you build with at least the correct LIBDIR=
specification, otherwise iptables(8) won't know where to find the
diff --git a/Makefile b/Makefile
index 07cf219..11c4d1c 100644
--- a/Makefile
+++ b/Makefile
@@ -4,15 +4,15 @@ TOPLEVEL_INCLUDED=YES
ifndef KERNEL_DIR
KERNEL_DIR=/usr/src/linux
endif
-NETFILTER_VERSION:=1.1.0
-OLD_NETFILTER_VERSION:=1.0.0
+NETFILTER_VERSION:=1.1.1
+OLD_NETFILTER_VERSION:=1.1.0
LIBDIR:=/usr/local/lib
BINDIR:=/usr/local/bin
MANDIR:=/usr/local/man
-COPT_FLAGS:=-O2
-CFLAGS:=$(COPT_FLAGS) -Wall -Wunused -Iinclude/ -I$(KERNEL_DIR)/include -DNDEBUG -DNETFILTER_VERSION=\"$(NETFILTER_VERSION)\" #-g #-pg # -DNDEBUG
+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
@@ -30,7 +30,7 @@ ifndef IPT_LIBDIR
IPT_LIBDIR:=$(LIBDIR)/iptables
endif
-default: all
+default: patchcheck all
iptables.o: iptables.c
$(CC) $(CFLAGS) -DIPT_LIB_DIR=\"$(IPT_LIBDIR)\" -c -o $@ $<
@@ -42,6 +42,13 @@ $(DESTDIR)$(BINDIR)/iptables: iptables
@[ -d $(DESTDIR)$(BINDIR) ] || mkdir -p $(DESTDIR)$(BINDIR)
cp $< $@
+# Temporary check for patches: really old patches may fail `isapplied'.
+patchcheck:
+ @for f in `echo patch-*`; do \
+ if ./isapplied $(KERNEL_DIR) $$f >/dev/null; then :; \
+ else echo Please apply $$f to this kernel.; exit 1; \
+ fi; done
+
iptables-save: iptables-save.c iptables.o libiptc/libiptc.a
$(CC) $(CFLAGS) -DIPT_LIB_DIR=\"$(IPT_LIBDIR)\" -rdynamic -o $@ $^ -ldl