fix shell-fm installation
[openwrt/svn-archive/archive.git] / ipv6 / aiccu / patches / 100-cross_compile.patch
1 diff -ruN aiccu-old/unix-console/Makefile aiccu-new/unix-console/Makefile
2 --- aiccu-old/unix-console/Makefile 2007-01-15 12:22:48.000000000 +0100
3 +++ aiccu-new/unix-console/Makefile 2007-01-15 12:33:13.000000000 +0100
4 @@ -10,6 +10,9 @@
5 # $Date: 2007-01-11 00:28:45 $
6 # **********************************************************/
7
8 +OS_NAME=$(shell uname)
9 +OS_VERSION=$(shell uname -r)
10 +
11 SRCS = main.c ../common/tun.c ../common/aiccu.c ../common/hash_md5.c ../common/hash_sha1.c ../common/common.c ../common/heartbeat.c ../common/tic.c ../common/ayiya.c ../common/aiccu_test.c ../common/resolver.c
12 INCS = ../common/tun.h ../common/aiccu.h ../common/hash_md5.h ../common/hash_sha1.h ../common/common.h ../common/heartbeat.h ../common/tic.h ../common/ayiya.h ../common/resolver.h
13 OBJS = main.o ../common/tun.o ../common/aiccu.o ../common/hash_md5.o ../common/hash_sha1.o ../common/common.o ../common/heartbeat.o ../common/tic.o ../common/ayiya.o ../common/aiccu_test.o ../common/resolver.o
14 @@ -40,13 +43,13 @@
15 # GnuTLS Support ?
16 # Used by TIC to secure that communication
17 # Currently defaultly builds only on Linux, but other platforms might easily also support it
18 -ifeq ($(shell uname | grep -c "Linux"),1)
19 +ifneq ($(HAVE_GNUTLS),)
20 CFLAGS += -D AICCU_GNUTLS
21 LDFLAGS += -lgnutls
22 endif
23
24 # Linux
25 -ifeq ($(shell uname | grep -c "Linux"),1)
26 +ifeq ($(shell echo $(OS_NAME) | grep -c "Linux"),1)
27 CFLAGS += -D_LINUX -D HAS_IFHEAD -D AICCU_TYPE="\"linux\""
28 SRCS += ../common/aiccu_linux.c
29 OBJS += ../common/aiccu_linux.o
30 @@ -54,11 +57,11 @@
31 endif
32
33 # FreeBSD
34 -ifeq ($(shell uname | grep -c "FreeBSD"),1)
35 +ifeq ($(shell echo $(OS_NAME) | grep -c "FreeBSD"),1)
36 CFLAGS += -D_FREEBSD
37
38 # FreeBSD 4.x
39 -ifeq ($(shell uname -r | cut -c 1),4)
40 +ifeq ($(shell echo $(OS_VERSION) | cut -c 1),4)
41 CFLAGS += -D AICCU_TYPE="\"freebsd4\""
42 SRCS += ../common/aiccu_freebsd4.c
43 OBJS += ../common/aiccu_freebsd4.o
44 @@ -71,7 +74,7 @@
45 endif
46
47 # DragonFlyBSD
48 -ifeq ($(shell uname | grep -c "DragonFly"),1)
49 +ifeq ($(shell echo $(OS_NAME) | grep -c "DragonFly"),1)
50 CFLAGS += -D_DFBSD -D NEED_IFHEAD -D AICCU_TYPE="\"dragonfly\""
51 SRCS += ../common/aiccu_freebsd4.c
52 OBJS += ../common/aiccu_freebsd4.o
53 @@ -79,7 +82,7 @@
54 endif
55
56 # NetBSD
57 -ifeq ($(shell uname | grep -c "NetBSD"),1)
58 +ifeq ($(shell echo $(OS_NAME) | grep -c "NetBSD"),1)
59 CFLAGS += -D_NETBSD -D NEED_IFHEAD -D AICCU_TYPE="\"kame\""
60 SRCS += ../common/aiccu_kame.c
61 OBJS += ../common/aiccu_kame.o
62 @@ -87,10 +90,10 @@
63 endif
64
65 # OpenBSD
66 -ifeq ($(shell uname | grep -c "OpenBSD"),1)
67 +ifeq ($(shell echo $(OS_NAME) | grep -c "OpenBSD"),1)
68 CFLAGS += -D_OPENBSD -D HAS_IFHEAD
69 # 2.7-2.9
70 -ifeq ($(shell uname -r | cut -c 1),2)
71 +ifeq ($(shell echo $(OS_VERSION) | cut -c 1),2)
72 CFLAGS += -D AICCU_TYPE="\"openbsd2\""
73 SRCS += ../common/aiccu_openbsd2.c
74 OBJS += ../common/aiccu_openbsd2.o
75 @@ -104,7 +107,7 @@
76 endif
77
78 # Darwin
79 -ifeq ($(shell uname | grep -c "Darwin"),1)
80 +ifeq ($(shell echo $(OS_NAME) | grep -c "Darwin"),1)
81 CFLAGS += -D_DARWIN -D NEED_IFHEAD -D AICCU_TYPE="\"darwin\""
82 SRCS += ../common/aiccu_darwin.c
83 OBJS += ../common/aiccu_darwin.o
84 @@ -112,7 +115,7 @@
85 endif
86
87 # SunOS / Solaris
88 -ifeq ($(shell uname | grep -c "SunOS"),1)
89 +ifeq ($(shell echo $(OS_NAME) | grep -c "SunOS"),1)
90 CFLAGS += -D_SUNOS -D AICCU_TYPE="\"sunos\""
91 SRCS += ../common/aiccu_sunos.c
92 OBJS += ../common/aiccu_sunos.o
93 @@ -120,7 +123,7 @@
94 endif
95
96 # AIX
97 -ifeq ($(shell uname | grep -c "AIX"),1)
98 +ifeq ($(shell echo $(OS_NAME) | grep -c "AIX"),1)
99 CC = @/usr/vac/bin/xlc_r
100 CFLAGS = -qthreaded -q64 -qlanglvl=stdc99 -bmaxdata:0xD0000000 -D_64BIT -g -qdbxextra -qfullpath -qheapdebug -qformat=all -qcheck=all
101 CFLAGS += -D AICCU_CONSOLE