source: patches/iproute2-2.6.16-060323-tc_libdir-1.patch@ 69b2a0a

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 69b2a0a was 749108a, checked in by Jim Gifford <clfs@…>, 18 years ago

Added: iproute2-2.6.16-060323-tc_libdir-1.patch

  • Property mode set to 100644
File size: 3.4 KB
RevLine 
[749108a]1Submitted By: Joe Ciccone <jciccone@linuxfromscratch.org>
2Date: 2006-09-04
3Upstream Status: Unknown
4Origin: Joe Ciccone
5Description: Defines the libdir that contains tc in the makefile and modifies the paths in the executables to use the libdir set in the makefile.
6
7diff -Naur iproute2-2.6.16-060323.orig/netem/Makefile iproute2-2.6.16-060323/netem/Makefile
8--- iproute2-2.6.16-060323.orig/netem/Makefile 2006-09-03 03:39:19.000000000 -0400
9+++ iproute2-2.6.16-060323/netem/Makefile 2006-09-03 03:46:33.000000000 -0400
10 -1,6 +1,8 @@
11 DISTGEN = maketable normal pareto paretonormal
12 DISTDATA = normal.dist pareto.dist paretonormal.dist experimental.dist
13
14+LIBDIR = /usr/lib
15+
16 HOSTCC ?= $(CC)
17 LDLIBS += -lm
18
19 -16,9 +18,9 @@
20 ./maketable experimental.dat > experimental.dist
21
22 install: all
23- mkdir -p $(DESTDIR)/usr/lib/tc
24+ mkdir -p $(DESTDIR)/$(LIBDIR)/tc
25 for i in $(DISTDATA); \
26- do install -m 755 $$i $(DESTDIR)/usr/lib/tc; \
27+ do install -m 755 $$i $(DESTDIR)/$(LIBDIR)/tc; \
28 done
29
30 clean:
31diff -Naur iproute2-2.6.16-060323.orig/tc/Makefile iproute2-2.6.16-060323/tc/Makefile
32--- iproute2-2.6.16-060323.orig/tc/Makefile 2006-09-03 03:39:19.000000000 -0400
33+++ iproute2-2.6.16-060323/tc/Makefile 2006-09-03 03:44:55.000000000 -0400
34 -42,7 +42,8 @@
35 TCLIB += tc_cbq.o
36 TCLIB += tc_estimator.o
37
38-CFLAGS += -DCONFIG_GACT -DCONFIG_GACT_PROB
39+LIBDIR = /usr/lib
40+CFLAGS += -DCONFIG_GACT -DCONFIG_GACT_PROB -DLIBDIR="\"$(LIBDIR)\""
41
42 TCSO :=
43 TCSO += q_netem.so
44 -69,10 +70,10 @@
45 $(AR) rcs $@ $(TCLIB)
46
47 install: all
48- mkdir -p $(DESTDIR)/usr/lib/tc
49+ mkdir -p $(DESTDIR)/$(LIBDIR)/tc
50 install -m 0755 -s tc $(DESTDIR)$(SBINDIR)
51 for i in $(TCSO); \
52- do install -m 755 -s $$i $(DESTDIR)/usr/lib/tc; \
53+ do install -m 755 -s $$i $(DESTDIR)/$(LIBDIR)/tc; \
54 done
55
56 clean:
57diff -Naur iproute2-2.6.16-060323.orig/tc/q_netem.c iproute2-2.6.16-060323/tc/q_netem.c
58--- iproute2-2.6.16-060323.orig/tc/q_netem.c 2006-09-03 03:39:19.000000000 -0400
59+++ iproute2-2.6.16-060323/tc/q_netem.c 2006-09-03 03:43:51.000000000 -0400
60 -60,7 +60,7 @@
61 char *line = NULL;
62 char name[128];
63
64- snprintf(name, sizeof(name), "/usr/lib/tc/%s.dist", type);
65+ snprintf(name, sizeof(name), LIBDIR "/tc/%s.dist", type);
66 if ((f = fopen(name, "r")) == NULL) {
67 fprintf(stderr, "No distribution data for %s (%s: %s)\n",
68 type, name, strerror(errno));
69diff -Naur iproute2-2.6.16-060323.orig/tc/tc.c iproute2-2.6.16-060323/tc/tc.c
70--- iproute2-2.6.16-060323.orig/tc/tc.c 2006-09-03 03:39:19.000000000 -0400
71+++ iproute2-2.6.16-060323/tc/tc.c 2006-09-03 03:43:30.000000000 -0400
72 -99,7 +99,7 @@
73 if (strcmp(q->id, str) == 0)
74 return q;
75
76- snprintf(buf, sizeof(buf), "/usr/lib/tc/q_%s.so", str);
77+ snprintf(buf, sizeof(buf), LIBDIR "/tc/q_%s.so", str);
78 dlh = dlopen(buf, RTLD_LAZY);
79 if (!dlh) {
80 /* look in current binary, only open once */
81 -144,8 +144,7 @@
82 for (q = filter_list; q; q = q->next)
83 if (strcmp(q->id, str) == 0)
84 return q;
85-
86- snprintf(buf, sizeof(buf), "/usr/lib/tc/f_%s.so", str);
87+ snprintf(buf, sizeof(buf), LIBDIR "/tc/f_%s.so", str);
88 dlh = dlopen(buf, RTLD_LAZY);
89 if (dlh == NULL) {
90 dlh = BODY;
Note: See TracBrowser for help on using the repository browser.