Gentoo Archives: gentoo-commits

From: "Robin H. Johnson (robbat2)" <robbat2@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-libs/libmelf/files: libmelf-0.4.0-gcc-makefile-cleanup.patch
Date: Tue, 01 Jun 2010 03:12:35
Message-Id: 20100601031232.23A9E2CF39@corvid.gentoo.org
1 robbat2 10/06/01 03:12:31
2
3 Added: libmelf-0.4.0-gcc-makefile-cleanup.patch
4 Log:
5 Initial commit. Ebuild by Robin H. Johnson <robbat2@g.o>.
6 (Portage version: 2.2_rc67/cvs/Linux x86_64)
7
8 Revision Changes Path
9 1.1 dev-libs/libmelf/files/libmelf-0.4.0-gcc-makefile-cleanup.patch
10
11 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/libmelf/files/libmelf-0.4.0-gcc-makefile-cleanup.patch?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/libmelf/files/libmelf-0.4.0-gcc-makefile-cleanup.patch?rev=1.1&content-type=text/plain
13
14 Index: libmelf-0.4.0-gcc-makefile-cleanup.patch
15 ===================================================================
16 diff -Nuar --exclude '*~' libmelf-0.4.0.orig/example/Makefile.in libmelf-0.4.0/example/Makefile.in
17 --- libmelf-0.4.0.orig/example/Makefile.in 2003-03-24 00:48:22.000000000 -0800
18 +++ libmelf-0.4.0/example/Makefile.in 2010-05-31 19:56:43.546947560 -0700
19 @@ -1,7 +1,13 @@
20 cc=@CC@
21 DEFINES=@DEFINES@
22 +OPTFLAGS=-Wall -O3
23 +CFLAGS=${DEFINES} ${OPTFLAGS} -I..
24 +BINS = sign test new
25
26 -all:
27 - ${CC} ${DEFINES} -I.. -Wall -O3 sign.c -o sign ../libmelf.a
28 - ${CC} ${DEFINES} -I.. -Wall -O3 test.c -o test ../libmelf.a
29 - ${CC} ${DEFINES} -I.. -Wall -O3 new.c -o new ../libmelf.a
30 +%: %.c
31 + ${CC} $(CFLAGS) $^ -o $@ -L.. -lmelf
32 +
33 +all: sign test new
34 +
35 +clean:
36 + -rm -f $(BINS)
37 diff -Nuar --exclude '*~' libmelf-0.4.0.orig/Makefile.in libmelf-0.4.0/Makefile.in
38 --- libmelf-0.4.0.orig/Makefile.in 2003-11-07 22:09:10.000000000 -0800
39 +++ libmelf-0.4.0/Makefile.in 2010-05-31 19:58:12.172822406 -0700
40 @@ -6,35 +6,43 @@
41 DEFINES=@DEFINES@ -DMELF_COMP
42 INCLUDES=-I.
43 PREFIX=@PREFIX@
44 -CFLAGS=${DEBUG} ${DEFINES} ${INCLUDES} -Wall -O3
45 -LFLAGS=${DEBUG} ${DEFINES} ${INCLUDES} -Wall -O3 -o
46 +OPTFLAGS=-Wall -O3
47 +CFLAGS=${DEBUG} ${DEFINES} ${INCLUDES} ${OPTFLAGS}
48 +LFLAGS=${DEBUG} ${DEFINES} ${INCLUDES} ${OPTFLAGS} -o
49 +LIBDIR=lib
50 LIBS=
51 OBJS=melf.o melf_dynamic.o melf_elf.o melf_list.o melf_note.o melf_program.o melf_reloc.o \
52 melf_res.o melf_section.o melf_string.o melf_symbol.o melf_symbolTable.o
53
54 -all: ${OBJS}
55 - ar rc ${STATICBIN} ${OBJS} && ranlib ${STATICBIN}
56 - @SHAREDEXEC@
57 - cd example && make
58 - cd tools && make
59 +all: ${STATICBIN} ${DYNAMICBIN}
60 + cd example && $(MAKE)
61 + cd tools && $(MAKE)
62
63 *.c.${O}:
64 ${CC} ${CFLAGS} $*.c
65
66 +${STATICBIN}: ${OBJS}
67 + ar rc ${STATICBIN} ${OBJS} && ranlib ${STATICBIN}
68 +${DYNAMICBIN}: ${OBJS}
69 + @SHAREDEXEC@
70 +
71 clean:
72 rm -f *.o ${STATICBIN} ${DYNAMICBIN} example/test example/new example/sign tools/elfres config.*
73 - cd tools && make clean
74 + cd tools && $(MAKE) clean
75
76 -distclean:
77 - make clean
78 +distclean: clean
79 rm -f Makefile example/Makefile stdelf.h
80 - cd tools && make distclean
81 + cd tools && $(MAKE) distclean
82
83 install: ${OBJS} ${STATICBIN}
84 - cp libmelf.a ${PREFIX}/lib
85 - cp libmelf.so ${PREFIX}/lib
86 + cp ${STATICBIN} ${PREFIX}/$(LIBDIR)
87 + cp ${DYNAMICBIN} ${PREFIX}/$(LIBDIR)
88 cp melf.h ${PREFIX}/include
89 cp stdelf.h ${PREFIX}/include
90
91 uninstall:
92 - rm -f ${PREFIX}/lib/libmelf.a ${PREFIX}/lib/libmelf.so ${PREFIX}/include/melf.h ${PREFIX}/include/stdelf.h
93 + -rm -f \
94 + ${PREFIX}/$(LIBDIR)/${STATICBIN} \
95 + ${PREFIX}/$(LIBDIR)/${DYNAMICBIN} \
96 + ${PREFIX}/include/melf.h \
97 + ${PREFIX}/include/stdelf.h
98 diff -Nuar --exclude '*~' libmelf-0.4.0.orig/melf_dynamic.c libmelf-0.4.0/melf_dynamic.c
99 --- libmelf-0.4.0.orig/melf_dynamic.c 2004-01-08 23:25:32.000000000 -0800
100 +++ libmelf-0.4.0/melf_dynamic.c 2010-05-31 19:35:59.230823053 -0700
101 @@ -227,7 +227,7 @@
102 return NULL;
103
104 dynamic->content = (void *)base;
105 - (unsigned char *)base += dynamic->contentLength;
106 + /*(unsigned char *)*/ base += dynamic->contentLength;
107 dynamic->contentLength = newLength;
108
109 base->d_tag = DT_NULL;
110 diff -Nuar --exclude '*~' libmelf-0.4.0.orig/melf_note.c libmelf-0.4.0/melf_note.c
111 --- libmelf-0.4.0.orig/melf_note.c 2004-01-08 23:25:56.000000000 -0800
112 +++ libmelf-0.4.0/melf_note.c 2010-05-31 19:36:11.535947632 -0700
113 @@ -205,7 +205,7 @@
114 return NULL;
115
116 note->content = (void *)base;
117 - (unsigned char *)base += note->contentLength;
118 + /*(unsigned char *)*/ base += note->contentLength;
119
120 memset(base, 0, newLength - note->contentLength);
121
122 diff -Nuar --exclude '*~' libmelf-0.4.0.orig/tools/Makefile.in libmelf-0.4.0/tools/Makefile.in
123 --- libmelf-0.4.0.orig/tools/Makefile.in 2003-09-17 01:03:49.000000000 -0700
124 +++ libmelf-0.4.0/tools/Makefile.in 2010-05-31 19:57:55.126198024 -0700
125 @@ -1,11 +1,15 @@
126 cc=@CC@
127 DEFINES=@DEFINES@
128 +CFLAGS=${DEFINES} ${OPTFLAGS} -I..
129 +BINS=elfres
130
131 -all:
132 - ${CC} ${DEFINES} -I.. -Wall -O3 elfres.c -o elfres ../libmelf.a
133 +%: %.c
134 + ${CC} $(CFLAGS) $^ -o $@ -L.. -lmelf
135 +
136 +all: $(BINS)
137
138 clean:
139 - rm -f elfres
140 + -rm -f $(BINS)
141
142 distclean:
143 - rm -f elfres Makefile
144 + -rm -f $(BINS) Makefile