~csurbhi/ubuntu/maverick/iptables/iptable-fix.600195

« back to all changes in this revision

Viewing changes to patches/006-32_64.patch

  • Committer: Bazaar Package Importer
  • Author(s): Laurence J. Lane
  • Date: 2004-06-15 20:38:42 UTC
  • Revision ID: james.westby@ubuntu.com-20040615203842-o4o634vwht1cix5k
Tags: 1.2.9-10
* Closes: #246037, added default logging level to man pages, requested
  by Max Vozeler. Thanks.
* conslidated all man page patches to 003-man_pages.patch.
* added 006-64_32.patch, CVS pull, Sparc64 and HPPA makefile clean up
  for 64/32-bit builds. Reported by Igor Genibel. Thanks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
4
@@ -38,21 +38,6 @@
 
5
 CFLAGS += -DNO_SHARED_LIBS=1
 
6
 endif
 
7
 
 
8
-ifndef NO_SHARED_LIBS
 
9
-DEPFILES = $(SHARED_LIBS:%.so=%.d)
 
10
-SH_CFLAGS:=$(CFLAGS) -fPIC
 
11
-STATIC_LIBS  =
 
12
-STATIC6_LIBS =
 
13
-LDFLAGS      = -rdynamic
 
14
-LDLIBS       = -ldl -lnsl
 
15
-else
 
16
-DEPFILES = $(EXT_OBJS:%.o=%.d)
 
17
-STATIC_LIBS  = extensions/libext.a
 
18
-STATIC6_LIBS = extensions/libext6.a
 
19
-LDFLAGS      = -static
 
20
-LDLIBS       =
 
21
-endif
 
22
-
 
23
 EXTRAS+=iptables iptables.o
 
24
 EXTRA_INSTALLS+=$(DESTDIR)$(BINDIR)/iptables $(DESTDIR)$(MANDIR)/man8/iptables.8
 
25
 
 
26
@@ -69,20 +54,56 @@
 
27
 
 
28
 # Sparc64 hack
 
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
 
32
-endif
 
33
-
 
34
-# HPPA hack
 
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
 
38
+       POINTERTEST:=1
 
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)
 
40
+       ifdef 32bituser
 
41
+               # The kernel is 64-bit, even though userspace is 32.
 
42
+               CFLAGS+=-DIPT_MIN_ALIGN=8 -DKERNEL_64_USERSPACE_32
 
43
+       else
 
44
+               EXT_LDFLAGS=-m elf64_sparc
 
45
+       endif
 
46
+endif
 
47
+
 
48
+# Alpha only has 64bit userspace and fails the test below
 
49
+ifeq ($(shell uname -m), alpha)
 
50
+       POINTERTEST:=1
 
51
+endif
 
52
+
 
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)
 
58
+               ifdef 64bitkernel
 
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)
 
60
+                       ifdef 32bituser
 
61
+                               CFLAGS+=-DIPT_MIN_ALIGN=8 -DKERNEL_64_USERSPACE_32
 
62
+                       endif
 
63
+               endif
 
64
+       else
 
65
+               CFLAGS+=-D_UNKNOWN_KERNEL_POINTER_SIZE
 
66
+       endif
 
67
 endif
 
68
 
 
69
 ifndef IPT_LIBDIR
 
70
 IPT_LIBDIR:=$(LIBDIR)/iptables
 
71
 endif
 
72
 
 
73
+ifndef NO_SHARED_LIBS
 
74
+DEPFILES = $(SHARED_LIBS:%.so=%.d)
 
75
+SH_CFLAGS:=$(CFLAGS) -fPIC
 
76
+STATIC_LIBS  =
 
77
+STATIC6_LIBS =
 
78
+LDFLAGS      = -rdynamic
 
79
+LDLIBS       = -ldl -lnsl
 
80
+else
 
81
+DEPFILES = $(EXT_OBJS:%.o=%.d)
 
82
+STATIC_LIBS  = extensions/libext.a
 
83
+STATIC6_LIBS = extensions/libext6.a
 
84
+LDFLAGS      = -static
 
85
+LDLIBS       =
 
86
+endif
 
87
+
 
88
 .PHONY: default
 
89
 default: print-extensions all
 
90
 
 
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
 
94
@@ -31,7 +31,7 @@
 
95
            sed -e 's@^.*\.o:@$*.d $*_sh.o:@' > $@
 
96
 
 
97
 $(SHARED_LIBS): %.so : %_sh.o
 
98
-       $(CC) -shared -o $@ -nostdlib $< -lgcc
 
99
+       $(CC) -shared $(EXT_LDFLAGS) -o $@ -nostdlib $< -lgcc
 
100
 
 
101
 %_sh.o : %.c
 
102
        $(CC) $(SH_CFLAGS) -o $@ -c $<