1
diff -urN old/iptables-1.2.9/Makefile new/iptables-1.2.9/Makefile
2
--- old/iptables-1.2.9/Makefile 2003-11-02 12:00:08.000000000 -0500
3
+++ new/iptables-1.2.9/Makefile 2004-06-15 20:28:18.000000000 -0400
5
CFLAGS += -DNO_SHARED_LIBS=1
9
-DEPFILES = $(SHARED_LIBS:%.so=%.d)
10
-SH_CFLAGS:=$(CFLAGS) -fPIC
16
-DEPFILES = $(EXT_OBJS:%.o=%.d)
17
-STATIC_LIBS = extensions/libext.a
18
-STATIC6_LIBS = extensions/libext6.a
23
EXTRAS+=iptables iptables.o
24
EXTRA_INSTALLS+=$(DESTDIR)$(BINDIR)/iptables $(DESTDIR)$(MANDIR)/man8/iptables.8
29
ifeq ($(shell uname -m),sparc64)
30
-# The kernel is 64-bit, even though userspace is 32.
31
-CFLAGS+=-DIPT_MIN_ALIGN=8 -DKERNEL_64_USERSPACE_32
35
-ifeq ($(shell uname -m),parisc64)
36
-# The kernel is 64-bit, even though userspace is 32.
37
-CFLAGS+=-DIPT_MIN_ALIGN=8 -DKERNEL_64_USERSPACE_32
39
+ 32bituser := $(shell echo -e "\#include <stdio.h>\n\#if !defined(__sparcv9) && !defined(__arch64__) && !defined(_LP64)\nuserspace_is_32bit\n\#endif" | $(CC) $(CFLAGS) -E - | grep userspace_is_32bit)
41
+ # The kernel is 64-bit, even though userspace is 32.
42
+ CFLAGS+=-DIPT_MIN_ALIGN=8 -DKERNEL_64_USERSPACE_32
44
+ EXT_LDFLAGS=-m elf64_sparc
48
+# Alpha only has 64bit userspace and fails the test below
49
+ifeq ($(shell uname -m), alpha)
53
+# Generic test if arch wasn't found above
54
+ifneq ($(POINTERTEST),1)
55
+ # Try to determine if kernel is 64bit and we are compiling for 32bit
56
+ ifeq ($(shell [ -a $(KERNEL_DIR)/include/asm ] && echo YES), YES)
57
+ 64bitkernel := $(shell echo -e "\#include <asm/types.h>\n\#if BITS_PER_LONG == 64\nkernel_is_64bits\n\#endif" | $(CC) $(CFLAGS) -D__KERNEL__ -E - | grep kernel_is_64bits)
59
+ 32bituser := $(shell echo -e "\#include <stdio.h>\n\#if !defined(__arch64__) && !defined(_LP64)\nuserspace_is_32bit\n\#endif" | $(CC) $(CFLAGS) -E - | grep userspace_is_32bit)
61
+ CFLAGS+=-DIPT_MIN_ALIGN=8 -DKERNEL_64_USERSPACE_32
65
+ CFLAGS+=-D_UNKNOWN_KERNEL_POINTER_SIZE
70
IPT_LIBDIR:=$(LIBDIR)/iptables
73
+ifndef NO_SHARED_LIBS
74
+DEPFILES = $(SHARED_LIBS:%.so=%.d)
75
+SH_CFLAGS:=$(CFLAGS) -fPIC
81
+DEPFILES = $(EXT_OBJS:%.o=%.d)
82
+STATIC_LIBS = extensions/libext.a
83
+STATIC6_LIBS = extensions/libext6.a
89
default: print-extensions all
91
diff -urN old/iptables-1.2.9/Rules.make new/iptables-1.2.9/Rules.make
92
--- old/iptables-1.2.9/Rules.make 2004-06-15 20:36:15.000000000 -0400
93
+++ new/iptables-1.2.9/Rules.make 2004-06-15 20:34:01.000000000 -0400
95
sed -e 's@^.*\.o:@$*.d $*_sh.o:@' > $@
97
$(SHARED_LIBS): %.so : %_sh.o
98
- $(CC) -shared -o $@ -nostdlib $< -lgcc
99
+ $(CC) -shared $(EXT_LDFLAGS) -o $@ -nostdlib $< -lgcc
102
$(CC) $(SH_CFLAGS) -o $@ -c $<