~ubuntu-branches/ubuntu/intrepid/libpng/intrepid-security

« back to all changes in this revision

Viewing changes to debian/patches/makefile.patch

  • Committer: Bazaar Package Importer
  • Author(s): Josselin Mouette
  • Date: 2005-10-03 20:18:43 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051003201843-cv2i5v7no1ff08tx
Tags: 1.2.8rel-5
* drop_pass_width.patch: don't export png_pass_width, it's absolutely 
  unnecessary.
* libpng12-0.shlibs: downgrade the shlibs accordingly
  (closes: #331383).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
--- scripts/makefile.linux.orig 2005-05-24 23:51:41.077680137 +0000
2
 
+++ scripts/makefile.linux      2005-05-24 23:52:30.185700068 +0000
3
 
@@ -3,12 +3,18 @@
 
1
--- scripts/makefile.elf.old    2005-09-25 13:05:56.000000000 +0200
 
2
+++ scripts/makefile.elf        2005-09-25 13:22:35.000000000 +0200
 
3
@@ -3,6 +3,12 @@
4
4
 # Copyright (C) 1996, 1997 Andreas Dilger
5
5
 # For conditions of distribution and use, see copyright notice in png.h
6
6
 
7
7
+# Modified for Debian by Junichi Uekawa and Josselin Mouette
8
8
+# Major modifications are:
9
9
+#    * link libpng explicitly with libz and libm
10
 
+#    * libpng.so.2 is a symlink rather than a different library
 
10
+#    * libpng.so.3 is a symlink rather than a different library
11
11
+#    * versioned symbols
12
12
+
13
 
 LIBNAME = libpng10
 
13
 LIBNAME = libpng12
14
14
 PNGMAJ = 0
15
 
 PNGMIN = 1.0.18
16
 
 PNGVER = $(PNGMAJ).$(PNGMIN)
17
 
 
18
 
-CC=gcc
19
 
+CC=gcc
20
 
 
21
 
 # where "make install" puts libpng10.a, libpng10.so*,
22
 
 # libpng10/png.h and libpng10/pngconf.h
23
 
@@ -16,10 +22,10 @@
24
 
 prefix=/usr/local
25
 
 
26
 
 # Where the zlib library and include files are located.
27
 
-#ZLIBLIB=/usr/local/lib
28
 
-#ZLIBINC=/usr/local/include
29
 
-ZLIBLIB=../zlib
30
 
-ZLIBINC=../zlib
31
 
+#ZLIBLIB=/usr/lib
32
 
+#ZLIBINC=/usr/include
33
 
+#ZLIBLIB=../zlib
34
 
+#ZLIBINC=../zlib
35
 
 
36
 
 ALIGN=
37
 
 # for i386:
 
15
 PNGMIN = 1.2.8
38
16
@@ -31,11 +37,12 @@
39
17
 
40
18
 # for pgcc version 2.95.1, -O3 is buggy; don't use it.
41
19
 
42
20
-CFLAGS=-I$(ZLIBINC) -Wall -O3 -funroll-loops \
43
21
-       $(ALIGN) # $(WARNMORE) -g -DPNG_DEBUG=5
44
 
+CFLAGS= -Wall -D_REENTRANT \
 
22
+CFLAGS=-Wall -D_REENTRANT \
45
23
+       $(ALIGN) $(DEBCFLAGS) # $(WARNMORE) -g -DPNG_DEBUG=5
46
24
 
47
 
-LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng10 -lz -lm
 
25
-LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng12 -lz -lm
48
26
-LDFLAGS_A=-L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) libpng.a -lz -lm
49
 
+LDFLAGS=-L. -lpng10
50
 
+LDFLAGS_A=$(LIBNAME).a -lz -lm
 
27
+LDFLAGS=-L. -lpng12
 
28
+LDFLAGS_A=libpng.a -lz -lm
51
29
+LIBADDFLAGS=-lz -lm
52
30
 
53
31
 RANLIB=ranlib
54
32
 #RANLIB=echo
55
 
@@ -71,52 +78,69 @@
56
 
 .c.pic.o:
57
 
        $(CC) -c $(CFLAGS) -fPIC -o $@ $*.c
58
 
 
59
 
-all: libpng.a $(LIBNAME).so pngtest pngtest-static libpng.pc libpng-config
60
 
+all: libpng.a libpng.so libpng.so.2 pngtest pngtest-static libpng.pc libpng-config
61
 
 
62
 
-libpng.a: $(OBJS)
63
 
+$(LIBNAME).a: $(OBJS)
64
 
        ar rc $@ $(OBJS)
65
 
        $(RANLIB) $@
66
 
 
67
 
-libpng.pc:
68
 
-       cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
69
 
+libpng.a: $(LIBNAME).a
70
 
+       ln -sf $^ $@
71
 
+
72
 
+$(LIBNAME).pc:
73
 
+       cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > $@
74
 
 
75
 
-libpng-config:
76
 
+libpng.pc: $(LIBNAME).pc
77
 
+       ln -sf $^ $@
78
 
+
79
 
+$(LIBNAME)-config:
 
33
@@ -81,8 +88,8 @@
 
34
        cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
 
35
 
 
36
 libpng.syms: png.h pngconf.h
 
37
-       $(CC) $(CFLAGS) -E -DPNG_BUILDSYMS png.h |\
 
38
-       awk -F '[\t [\]();]' 'BEGIN{print "{global:"}\
 
39
+       $(CC) $(CFLAGS) -E -DPNG_BUILDSYMS -DPNG_INTERNAL png.h |\
 
40
+       mawk -F '[\t [\]();]' -v PNGMAJ=$(PNGMAJ) 'BEGIN{printf("PNG12_%s {global:\n",PNGMAJ)}\
 
41
        { for (i=1;i+2<=NF;++i)\
 
42
                if ($$(i)=="PNG_FUNCTION_EXPORT" && $$(i+2)=="END")\
 
43
                        print $$(i+1) ";";\
 
44
@@ -97,9 +104,10 @@
80
45
        ( cat scripts/libpng-config-head.in; \
81
46
        echo prefix=\"$(prefix)\"; \
82
47
        echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
83
48
-       echo L_opts=\"-L$(LIBPATH)\"; \
84
49
-       echo R_opts=\"-Wl,-rpath,$(LIBPATH)\"; \
85
 
-       echo libs=\"-lpng10 -lz -lm\"; \
86
 
-       cat scripts/libpng-config-body.in ) > libpng-config
87
 
-       chmod +x libpng-config
 
50
-       echo libs=\"-lpng12 -lz -lm\"; \
88
51
+       echo L_opts=\"\"; \
89
52
+       echo R_opts=\"\"; \
90
 
+       echo libs=\"-lpng10\"; \
91
 
+       echo all_libs=\"-lpng10 $(LIBADDFLAGS)\"; \
92
 
+       cat scripts/libpng-config-body.in ) > $@
93
 
+       chmod +x $@
94
 
+
95
 
+libpng-config: $(LIBNAME)-config
96
 
+       ln -sf $^ $@
97
 
 
98
 
 $(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ)
99
 
-       ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so
100
 
+       ln -sf $^ $@
101
 
 
102
 
 $(LIBNAME).so.$(PNGMAJ): $(LIBNAME).so.$(PNGVER)
103
 
-       ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ)
104
 
+       ln -sf $^ $@
105
 
 
106
 
-$(LIBNAME).so.$(PNGVER): $(OBJSDLL)
 
53
+       echo libs=\"-lpng12\"; \
 
54
+       echo all_libs=\"-lpng12 $(LIBADDFLAGS)\"; \
 
55
        cat scripts/libpng-config-body.in ) > libpng-config
 
56
        chmod +x libpng-config
 
57
 
 
58
@@ -110,17 +118,11 @@
 
59
        ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ)
 
60
 
 
61
 $(LIBNAME).so.$(PNGVER): $(OBJSDLL) libpng.syms
107
62
-       $(CC) -shared -Wl,-soname,$(LIBNAME).so.$(PNGMAJ) \
108
 
-       -o $(LIBNAME).so.$(PNGVER) \
109
 
+$(LIBNAME).so.$(PNGVER): $(OBJSDLL) Versions
110
63
+       $(CC) -shared $(LIBADDFLAGS) -Wl,-soname,$(LIBNAME).so.$(PNGMAJ) \
111
 
+       -Wl,--version-script=Versions \
112
 
+       -o $@ \
 
64
        -Wl,-version-script,libpng.syms \
 
65
        -o $(LIBNAME).so.$(PNGVER) \
113
66
        $(OBJSDLL)
114
67
 
115
 
-libpng.so.2.$(PNGMIN): $(OBJSDLL)
116
 
-       $(CC) -shared -Wl,-soname,libpng.so.2 \
117
 
-       -o libpng.so.2.$(PNGMIN) \
 
68
-libpng.so.3.$(PNGMIN): $(OBJSDLL) libpng.syms
 
69
-       $(CC) -shared -Wl,-soname,libpng.so.3 \
 
70
-       -Wl,-version-script,libpng.syms \
 
71
-       -o libpng.so.3.$(PNGMIN) \
118
72
-       $(OBJSDLL)
119
 
+Versions: $(OBJSDLL)
120
 
+       echo 'PNG10_$(PNGMAJ) {' > $@
121
 
+       nm $(OBJSDLL) | grep " [TtR] " | cut -d" " -f3 | sed -e 's/$$/;/' >> $@
122
 
+       echo '};' >> $@
123
 
+
124
 
+libpng.so.2: $(LIBNAME).so.$(PNGMAJ)
125
 
+       ln -sf $^ $@
126
 
+
127
 
+libpng.so: $(LIBNAME).so
128
 
+       ln -sf $^ $@
129
 
 
 
73
-
130
74
 pngtest: pngtest.o $(LIBNAME).so
131
 
-       $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
132
 
+       $(CC) -o $@ $(CFLAGS) pngtest.o $(LDFLAGS)
133
 
 
134
 
 pngtest-static: pngtest.o libpng.a
135
 
-       $(CC) -o pngtest-static $(CFLAGS) pngtest.o $(LDFLAGS_A)
136
 
+       $(CC) -o $@ $(CFLAGS) pngtest.o $(LDFLAGS_A)
137
 
 
138
 
 test: pngtest pngtest-static
 
75
        $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
 
76
 
 
77
@@ -131,14 +133,14 @@
139
78
        @echo ""
140
79
        @echo "   Running pngtest dynamically linked with $(LIBNAME).so:"
141
80
        @echo ""
144
83
        @echo ""
145
84
        @echo "   Running pngtest statically linked with libpng.a:"
146
85
        @echo ""
147
 
@@ -133,13 +157,12 @@
 
86
        ./pngtest-static
 
87
 
 
88
 install-headers: png.h pngconf.h
 
89
-       -@if [ ! -d $(DI) ]; then mkdir $(DI); fi
 
90
+       -@if [ ! -d $(DI) ]; then mkdir -p $(DI); fi
 
91
        -@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi
 
92
        cp png.h pngconf.h $(DI)/$(LIBNAME)
 
93
        chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h
 
94
@@ -147,27 +149,24 @@
 
95
        (cd $(DI); ln -sf $(LIBNAME) libpng; ln -sf $(LIBNAME)/* .)
148
96
 
149
97
 install-static: install-headers libpng.a
150
 
        -@if [ ! -d $(DL) ]; then mkdir $(DL); fi
151
 
-       cp libpng.a $(DL)/$(LIBNAME).a
152
 
+       cp $(LIBNAME).a $(DL)
 
98
-       -@if [ ! -d $(DL) ]; then mkdir $(DL); fi
 
99
+       -@if [ ! -d $(DL) ]; then mkdir -p $(DL); fi
 
100
        cp libpng.a $(DL)/$(LIBNAME).a
153
101
        chmod 644 $(DL)/$(LIBNAME).a
154
102
        -@/bin/rm -f $(DL)/libpng.a
155
103
        (cd $(DL); ln -sf $(LIBNAME).a libpng.a)
156
104
 
157
105
-install-shared: install-headers $(LIBNAME).so.$(PNGVER) libpng.pc \
158
 
-       libpng.so.2.$(PNGMIN)
 
106
-       libpng.so.3.$(PNGMIN)
 
107
-       -@if [ ! -d $(DL) ]; then mkdir $(DL); fi
159
108
+install-shared: install-headers $(LIBNAME).so.$(PNGVER) libpng.pc
160
 
        -@if [ ! -d $(DL) ]; then mkdir $(DL); fi
 
109
+       -@if [ ! -d $(DL) ]; then mkdir -p $(DL); fi
161
110
        -@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGVER)* $(DL)/$(LIBNAME).so
162
111
        -@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGMAJ)
163
 
@@ -151,10 +174,10 @@
 
112
        -@/bin/rm -f $(DL)/libpng.so
 
113
        -@/bin/rm -f $(DL)/libpng.so.3
 
114
        -@/bin/rm -f $(DL)/libpng.so.3.$(PNGMIN)*
 
115
        cp $(LIBNAME).so.$(PNGVER) $(DL)
 
116
-       cp libpng.so.3.$(PNGMIN) $(DL)
164
117
        chmod 755 $(DL)/$(LIBNAME).so.$(PNGVER)
165
 
        chmod 755 $(DL)/libpng.so.2.$(PNGMIN)
 
118
-       chmod 755 $(DL)/libpng.so.3.$(PNGMIN)
166
119
        (cd $(DL); \
167
 
-       ln -sf libpng.so.2.$(PNGMIN) libpng.so.2; \
168
 
-       ln -sf libpng.so.2 libpng.so; \
169
 
+       ln -sf $(LIBNAME).so.$(PNGVER) libpng.so.2; \
 
120
-       ln -sf libpng.so.3.$(PNGMIN) libpng.so.3; \
 
121
-       ln -sf libpng.so.3 libpng.so; \
 
122
+       ln -sf $(LIBNAME).so.$(PNGMAJ) libpng.so.3; \
 
123
+       ln -sf $(LIBNAME).so libpng.so; \
170
124
        ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
171
 
-       ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
172
 
+       ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so; \
173
 
+       ln -sf $(LIBNAME).so libpng.so)
 
125
        ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
174
126
        -@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi
175
 
        -@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc
176
 
        -@/bin/rm -f $(DL)/pkgconfig/libpng.pc
177
 
@@ -177,7 +200,7 @@
178
 
        -@if [ ! -d $(DB) ]; then mkdir $(DB); fi
 
127
@@ -178,7 +177,7 @@
 
128
        (cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libpng.pc)
 
129
 
 
130
 install-man: libpng.3 libpngpf.3 png.5
 
131
-       -@if [ ! -d $(DM) ]; then mkdir $(DM); fi
 
132
+       -@if [ ! -d $(DM) ]; then mkdir -p $(DM); fi
 
133
        -@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi
 
134
        -@/bin/rm -f $(DM)/man3/libpng.3
 
135
        -@/bin/rm -f $(DM)/man3/libpngpf.3
 
136
@@ -189,7 +188,7 @@
 
137
        cp png.5 $(DM)/man5
 
138
 
 
139
 install-config: libpng-config
 
140
-       -@if [ ! -d $(DB) ]; then mkdir $(DB); fi
 
141
+       -@if [ ! -d $(DB) ]; then mkdir -p $(DB); fi
179
142
        -@/bin/rm -f $(DB)/libpng-config
180
143
        -@/bin/rm -f $(DB)/$(LIBNAME)-config
181
 
-       cp libpng-config $(DB)/$(LIBNAME)-config
182
 
+       cp $(LIBNAME)-config $(DB)
183
 
        chmod 755 $(DB)/$(LIBNAME)-config
184
 
        (cd $(DB); ln -sf $(LIBNAME)-config libpng-config)
185
 
 
186
 
@@ -197,17 +220,18 @@
187
 
        ./pngtestd pngtest.png
188
 
 
189
 
 test-installed:
190
 
-       $(CC) -I$(ZLIBINC) \
191
 
+       $(CC) \
192
 
           `$(BINPATH)/libpng10-config --cflags` pngtest.c \
193
 
-          -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) \
194
 
           -o pngtesti `$(BINPATH)/libpng10-config --ldflags`
195
 
        ./pngtesti pngtest.png
196
 
 
197
 
 clean:
198
 
        /bin/rm -f *.o libpng.a pngtest pngout.png libpng-config \
199
 
        $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* pngtest-static pngtesti \
200
 
-       libpng.so.2.$(PNGMIN) \
201
 
-       libpng.pc
202
 
+       libpng.so.2 libpng.so $(LIBNAME)-config $(LIBNAME).a $(LIBNAME).pc \
203
 
+       libpng.pc Versions
204
 
+
205
 
+.PHONY: writelock clean test-installed install install-static install-shared install-man install-config install-headers test
206
 
 
207
 
 DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
208
 
 writelock:
 
144
        cp libpng-config $(DB)/$(LIBNAME)-config