pass ARCH down to uClibc
[buildroot.git] / package / quagga / quagga.mk
bloba6a4a4f5d454e8a2340688eb30213627ea4861bd
1 #############################################################
3 # quagga suite
5 #############################################################
6 QUAGGA_VERSION:=0.99.9
7 QUAGGA_SOURCE:=quagga-$(QUAGGA_VERSION).tar.gz
8 QUAGGA_SITE:=http://www.quagga.net/download
9 QUAGGA_DIR:=$(BUILD_DIR)/quagga-$(QUAGGA_VERSION)
10 QUAGGA_CAT:=$(ZCAT)
12 QUAGGA_CONFIGURE:=
13 ifeq ($(BR2_PACKAGE_QUAGGA_ZEBRA),y)
14 QUAGGA_CONFIGURE+=--enable-zebra
15 ifndef QUAGGA_TARGET_BINARY
16 QUAGGA_TARGET_BINARY=zebra
17 QUAGGA_BINARY=$(QUAGGA_DIR)/zebra/.libs/zebra
18 endif
19 else
20 QUAGGA_CONFIGURE+=--disable-zebra
21 endif
22 ifeq ($(BR2_PACKAGE_QUAGGA_BGPD),y)
23 QUAGGA_CONFIGURE+=--enable-bgpd
24 ifndef QUAGGA_TARGET_BINARY
25 QUAGGA_TARGET_BINARY=bgpd
26 QUAGGA_BINARY=$(QUAGGA_DIR)/bgpd/.libs/bgpd
27 endif
28 else
29 QUAGGA_CONFIGURE+=--disable-bgpd
30 endif
31 ifeq ($(BR2_PACKAGE_QUAGGA_RIPD),y)
32 QUAGGA_CONFIGURE+=--enable-ripd
33 ifndef QUAGGA_TARGET_BINARY
34 QUAGGA_TARGET_BINARY=ripd
35 QUAGGA_BINARY=$(QUAGGA_DIR)/ripd/.libs/ripd
36 endif
37 else
38 QUAGGA_CONFIGURE+=--disable-ripd
39 endif
40 ifeq ($(BR2_PACKAGE_QUAGGA_RIPNGD),y)
41 QUAGGA_CONFIGURE+=--enable-ripngd
42 ifndef QUAGGA_TARGET_BINARY
43 QUAGGA_TARGET_BINARY=ripngd
44 QUAGGA_BINARY=$(QUAGGA_DIR)/ripngd/.libs/ripngd
45 endif
46 else
47 QUAGGA_CONFIGURE+=--disable-ripngd
48 endif
49 ifeq ($(BR2_PACKAGE_QUAGGA_OSPFD),y)
50 QUAGGA_CONFIGURE+=--enable-ospfd
51 ifndef QUAGGA_TARGET_BINARY
52 QUAGGA_TARGET_BINARY=ospfd
53 QUAGGA_BINARY=$(QUAGGA_DIR)/ospfd/.libs/ospfd
54 endif
55 else
56 QUAGGA_CONFIGURE+=--disable-ospfd
57 endif
58 ifeq ($(BR2_PACKAGE_QUAGGA_OSPF6D),y)
59 QUAGGA_CONFIGURE+=--enable-ospf6d
60 ifndef QUAGGA_TARGET_BINARY
61 QUAGGA_TARGET_BINARY=ospf6d
62 QUAGGA_BINARY=$(QUAGGA_DIR)/ospf6d/.libs/ospf6d
63 endif
64 else
65 QUAGGA_CONFIGURE+=--disable-ospf6d
66 endif
67 ifeq ($(BR2_PACKAGE_QUAGGA_WATCHQUAGGA),y)
68 QUAGGA_CONFIGURE+=--enable-watchquagga
69 ifndef QUAGGA_TARGET_BINARY
70 QUAGGA_TARGET_BINARY=watchquagga
71 QUAGGA_BINARY=$(QUAGGA_DIR)/watchquagga/.libs/watchquagga
72 endif
73 else
74 QUAGGA_CONFIGURE+=--disable-watchquagga
75 endif
76 ifeq ($(BR2_PACKAGE_QUAGGA_ISISD),y)
77 QUAGGA_CONFIGURE+=--enable-isisd
78 ifndef QUAGGA_TARGET_BINARY
79 QUAGGA_TARGET_BINARY=isisd
80 QUAGGA_BINARY=$(QUAGGA_DIR)/isisd/.libs/isisd
81 endif
82 else
83 QUAGGA_CONFIGURE+=--disable-isisd
84 endif
87 ifeq ($(BR2_PACKAGE_QUAGGA_BGP_ANNOUNCE),y)
88 QUAGGA_CONFIGURE+=--enable-bgp-announce
89 else
90 QUAGGA_CONFIGURE+=--disable-bgp-announce
91 endif
92 ifeq ($(BR2_PACKAGE_QUAGGA_NETLINK),y)
93 QUAGGA_CONFIGURE+=--enable-netlink
94 else
95 QUAGGA_CONFIGURE+=--disable-netlink
96 endif
97 ifeq ($(BR2_PACKAGE_QUAGGA_SNMP),y)
98 QUAGGA_CONFIGURE+=--enable-snmp
99 else
100 QUAGGA_CONFIGURE+=--disable-snmp
101 endif
102 ifeq ($(BR2_PACKAGE_QUAGGA_TCP_ZEBRA),y)
103 QUAGGA_CONFIGURE+=--enable-tcp-zebra
104 else
105 QUAGGA_CONFIGURE+=--disable-tcp-zebra
106 endif
107 ifeq ($(BR2_PACKAGE_QUAGGA_OPAGUE_LSA),y)
108 QUAGGA_CONFIGURE+=--enable-opaque-lsa
109 else
110 QUAGGA_CONFIGURE+=--disable-opaque-lsa
111 endif
113 QUAGGA_CONFIGURE+=$(subst ",,$(BR2_PACKAGE_QUAGGA_CONFIGURE))
114 # ")
116 $(DL_DIR)/$(QUAGGA_SOURCE):
117 $(WGET) -P $(DL_DIR) $(QUAGGA_SITE)/$(QUAGGA_SOURCE)
119 ifneq ($(QUAGGA_PATCH),)
120 QUAGGA_PATCH_FILE=$(DL_DIR)/$(QUAGGA_PATCH)
121 $(DL_DIR)/$(QUAGGA_PATCH):
122 $(WGET) -P $(DL_DIR) $(QUAGGA_SITE)/$(QUAGGA_PATCH)
123 endif
124 quagga-source: $(DL_DIR)/$(QUAGGA_SOURCE) $(QUAGGA_PATCH_FILE)
126 $(QUAGGA_DIR)/.unpacked: $(DL_DIR)/$(QUAGGA_SOURCE) $(DL_DIR)/$(QUAGGA_PATCH)
127 $(QUAGGA_CAT) $(DL_DIR)/$(QUAGGA_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
128 toolchain/patch-kernel.sh $(QUAGGA_DIR) package/quagga/ quagga\*.patch
129 ifneq ($(QUAGGA_PATCH),)
130 (cd $(QUAGGA_DIR) && $(QUAGGA_CAT) $(DL_DIR)/$(QUAGGA_PATCH) | patch -p1)
131 if [ -d $(QUAGGA_DIR)/debian/patches ]; then \
132 toolchain/patch-kernel.sh $(QUAGGA_DIR) $(QUAGGA_DIR)/debian/patches \*.patch; \
134 endif
135 touch $@
137 $(QUAGGA_DIR)/.configured: $(QUAGGA_DIR)/.unpacked
138 (cd $(QUAGGA_DIR); rm -rf config.cache; \
139 $(TARGET_CONFIGURE_OPTS) \
140 $(TARGET_CONFIGURE_ARGS) \
141 ./configure \
142 --target=$(GNU_TARGET_NAME) \
143 --host=$(GNU_TARGET_NAME) \
144 --build=$(GNU_HOST_NAME) \
145 --prefix=/usr \
146 --sysconfdir=/etc \
147 $(DISABLE_LARGEFILE) \
148 $(DISABLE_IPV6) \
149 $(QUAGGA_CONFIGURE) \
150 --program-transform-name='' \
152 touch $@
154 $(QUAGGA_BINARY): $(QUAGGA_DIR)/.configured
155 $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(QUAGGA_DIR)
157 $(TARGET_DIR)/usr/sbin/$(QUAGGA_TARGET_BINARY): $(QUAGGA_BINARY)
158 $(MAKE) DESTDIR=$(TARGET_DIR) -C $(QUAGGA_DIR) install
159 ifneq ($(BR2_PACKAGE_QUAGGA_HEADERS),y)
160 rm -rf $(TARGET_DIR)/usr/include/quagga
161 endif
162 ifneq ($(BR2_HAVE_MANPAGES),y)
163 rm -rf $(TARGET_DIR)/usr/share/man
164 endif
165 ifneq ($(BR2_HAVE_INFOPAGES),y)
166 rm -rf $(TARGET_DIR)/usr/share/info
167 endif
169 quagga: $(TARGET_DIR)/usr/sbin/$(QUAGGA_TARGET_BINARY)
171 quagga-clean:
172 -$(MAKE) DESTDIR=$(TARGET_DIR) -C $(QUAGGA_DIR) uninstall
173 -$(MAKE) -C $(QUAGGA_DIR) clean
175 quagga-dirclean:
176 rm -rf $(QUAGGA_DIR)
177 #############################################################
179 # Toplevel Makefile options
181 #############################################################
182 ifeq ($(BR2_PACKAGE_QUAGGA),y)
183 TARGETS+=quagga
184 endif