Add ndisc package, in its own menu to avoid breaking sort order
[openwrt.git] / obsolete-buildroot / make / iproute2.mk
1 #############################################################
2 #
3 # iproute2
4 #
5 #############################################################
6
7 IPROUTE2_DIR=$(BUILD_DIR)/iproute2
8 IP_IPK_DIR=$(BUILD_DIR)/ip-2.0-ipk
9 TC_IPK_DIR=$(BUILD_DIR)/tc-2.0-ipk
10
11 #IPROUTE2_SOURCE_URL=ftp://ftp.inr.ac.ru/ip-routing/
12 #IPROUTE2_SOURCE=iproute2-2.4.7-now-ss020116-try.tar.gz
13
14 #Use the debian source for now, as the .ru site has availability problems
15 IPROUTE2_SOURCE_URL=http://ftp.debian.org/debian/pool/main/i/iproute/
16 IPROUTE2_SOURCE=iproute_20010824.orig.tar.gz
17 IPROUTE2_PATCH:=iproute_20010824-8.diff.gz
18 IPROUTE2_PATCH_2:=iproute2-*.patch
19
20
21 $(DL_DIR)/$(IPROUTE2_SOURCE):
22 $(WGET) -P $(DL_DIR) $(IPROUTE2_SOURCE_URL)$(IPROUTE2_SOURCE)
23
24 $(DL_DIR)/$(IPROUTE2_PATCH):
25 $(WGET) -P $(DL_DIR) $(IPROUTE2_SOURCE_URL)/$(IPROUTE2_PATCH)
26
27
28 iproute2-source: $(DL_DIR)/$(IPROUTE2_SOURCE) #$(DL_DIR)/$(IPROUTE2_PATCH)
29
30 $(IPROUTE2_DIR)/.unpacked: $(DL_DIR)/$(IPROUTE2_SOURCE) #$(DL_DIR)/$(IPROUTE2_PATCH)
31 rm -rf $(IPROUTE2_DIR).orig $(IPROUTE2_DIR)
32 zcat $(DL_DIR)/$(IPROUTE2_SOURCE) | tar -C $(BUILD_DIR) -xvf -
33 #zcat $(DL_DIR)/$(IPROUTE2_PATCH) | patch -p1 -d $(IPROUTE2_DIR)
34 $(SOURCE_DIR)/patch-kernel.sh $(IPROUTE2_DIR) $(SOURCE_DIR) $(IPROUTE2_PATCH_2)
35 # fun sed hacks.
36 $(SED) "s:-O2:${TARGET_CFLAGS}:g" $(IPROUTE2_DIR)/Makefile
37 ifeq ($(ARCH),i386)
38 @# needed on atleast i386.. however breaks on mipsel
39 $(SED) 's:-I\.\./include-glibc::g' $(IPROUTE2_DIR)/Makefile
40 endif
41 touch $(IPROUTE2_DIR)/.unpacked
42
43 $(IPROUTE2_DIR)/.configured: $(IPROUTE2_DIR)/.unpacked
44 $(SED) "s,-I/usr/include/db3,," $(IPROUTE2_DIR)/Makefile
45 $(SED) "s,^KERNEL_INCLUDE.*,KERNEL_INCLUDE=$(LINUX_DIR)/include," \
46 $(IPROUTE2_DIR)/Makefile
47 $(SED) "s,^LIBC_INCLUDE.*,LIBC_INCLUDE=$(STAGING_DIR)/include," \
48 $(IPROUTE2_DIR)/Makefile
49 # For now disable compiling of the misc directory because it seems to fail
50 rm -rf $(IPROUTE2_DIR)/misc
51 $(SED) "s, misc,," $(IPROUTE2_DIR)/Makefile
52 touch $(IPROUTE2_DIR)/.configured
53
54 $(IPROUTE2_DIR)/tc/tc: $(IPROUTE2_DIR)/.configured
55 $(MAKE) -C $(IPROUTE2_DIR) $(TARGET_CONFIGURE_OPTS) KERNEL_INCLUDE=$(LINUX_DIR)/include
56
57 $(TARGET_DIR)/usr/sbin/tc: $(IPROUTE2_DIR)/tc/tc
58 @# Make sure our $(TARGET_DIR)/usr/sbin/ exists.
59 -mkdir -p $(TARGET_DIR)/usr/sbin/
60 @# Copy The tc binary
61 cp -af $(IPROUTE2_DIR)/tc/tc $(TARGET_DIR)/usr/sbin/ && \
62 $(STRIP) $(TARGET_DIR)/usr/sbin/tc
63
64 iproute2: $(TARGET_DIR)/usr/sbin/tc
65
66 iproute2-clean:
67 $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(IPROUTE2_DIR) uninstall
68 -$(MAKE) -C $(IPROUTE2_DIR) clean
69
70 iproute2-dirclean:
71 rm -rf $(IPROUTE2_DIR) $(IP_IPK_DIR) $(TC_IPK_DIR)
72
73
74 iproute2-ipk: $(IPROUTE2_DIR)/tc/tc
75 mkdir -p $(IP_IPK_DIR)
76 mkdir -p $(TC_IPK_DIR)
77 cp -a $(OPENWRT_IPK_DIR)/iproute/ip/CONTROL $(IP_IPK_DIR)/CONTROL
78 cp -a $(OPENWRT_IPK_DIR)/iproute/tc/CONTROL $(TC_IPK_DIR)/CONTROL
79 mkdir -p $(IP_IPK_DIR)/usr/sbin
80 mkdir -p $(TC_IPK_DIR)/usr/sbin
81 install -m 755 $(IPROUTE2_DIR)/ip/ip $(IP_IPK_DIR)/usr/sbin/
82 install -m 755 $(IPROUTE2_DIR)/tc/tc $(TC_IPK_DIR)/usr/sbin/
83 $(STRIP) $(IP_IPK_DIR)/usr/sbin/ip
84 $(STRIP) $(TC_IPK_DIR)/usr/sbin/tc
85 cd $(BUILD_DIR); $(IPKG_BUILD) $(IP_IPK_DIR)
86 cd $(BUILD_DIR); $(IPKG_BUILD) $(TC_IPK_DIR)
This page took 0.042674 seconds and 5 git commands to generate.