~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): Anibal Monsalve Salazar
  • Date: 2006-11-21 19:07:43 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20061121190743-wkt0yzs5uq2xoq10
Tags: 1.2.13-4
Removed drop_pass_width patch. Closes: #399499.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
 
 # Copyright (C) 1996, 1997 Andreas Dilger
5
 
 # For conditions of distribution and use, see copyright notice in png.h
6
 
 
7
 
+# Modified for Debian by Junichi Uekawa and Josselin Mouette
8
 
+# Major modifications are:
9
 
+#    * link libpng explicitly with libz and libm
10
 
+#    * libpng.so.3 is a symlink rather than a different library
11
 
+#    * versioned symbols
12
 
+
13
 
 LIBNAME = libpng12
14
 
 PNGMAJ = 0
15
 
 PNGMIN = 1.2.8
16
 
@@ -31,11 +37,12 @@
17
 
 
18
 
 # for pgcc version 2.95.1, -O3 is buggy; don't use it.
19
 
 
20
 
-CFLAGS=-I$(ZLIBINC) -Wall -O3 -funroll-loops \
21
 
-       $(ALIGN) # $(WARNMORE) -g -DPNG_DEBUG=5
22
 
+CFLAGS=-Wall -D_REENTRANT \
23
 
+       $(ALIGN) $(DEBCFLAGS) # $(WARNMORE) -g -DPNG_DEBUG=5
24
 
 
25
 
-LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng12 -lz -lm
26
 
-LDFLAGS_A=-L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) libpng.a -lz -lm
27
 
+LDFLAGS=-L. -lpng12
28
 
+LDFLAGS_A=libpng.a -lz -lm
29
 
+LIBADDFLAGS=-lz -lm
30
 
 
31
 
 RANLIB=ranlib
32
 
 #RANLIB=echo
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 @@
45
 
        ( cat scripts/libpng-config-head.in; \
46
 
        echo prefix=\"$(prefix)\"; \
47
 
        echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
48
 
-       echo L_opts=\"-L$(LIBPATH)\"; \
49
 
-       echo R_opts=\"-Wl,-rpath,$(LIBPATH)\"; \
50
 
-       echo libs=\"-lpng12 -lz -lm\"; \
51
 
+       echo L_opts=\"\"; \
52
 
+       echo R_opts=\"\"; \
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
62
 
-       $(CC) -shared -Wl,-soname,$(LIBNAME).so.$(PNGMAJ) \
63
 
+       $(CC) -shared $(LIBADDFLAGS) -Wl,-soname,$(LIBNAME).so.$(PNGMAJ) \
64
 
        -Wl,-version-script,libpng.syms \
65
 
        -o $(LIBNAME).so.$(PNGVER) \
66
 
        $(OBJSDLL)
67
 
 
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) \
72
 
-       $(OBJSDLL)
73
 
-
74
 
 pngtest: pngtest.o $(LIBNAME).so
75
 
        $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
76
 
 
77
 
@@ -131,14 +133,14 @@
78
 
        @echo ""
79
 
        @echo "   Running pngtest dynamically linked with $(LIBNAME).so:"
80
 
        @echo ""
81
 
-       ./pngtest
82
 
+       LD_LIBRARY_PATH=".:${LD_LIBRARY_PATH}" ./pngtest
83
 
        @echo ""
84
 
        @echo "   Running pngtest statically linked with libpng.a:"
85
 
        @echo ""
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)/* .)
96
 
 
97
 
 install-static: install-headers libpng.a
98
 
-       -@if [ ! -d $(DL) ]; then mkdir $(DL); fi
99
 
+       -@if [ ! -d $(DL) ]; then mkdir -p $(DL); fi
100
 
        cp libpng.a $(DL)/$(LIBNAME).a
101
 
        chmod 644 $(DL)/$(LIBNAME).a
102
 
        -@/bin/rm -f $(DL)/libpng.a
103
 
        (cd $(DL); ln -sf $(LIBNAME).a libpng.a)
104
 
 
105
 
-install-shared: install-headers $(LIBNAME).so.$(PNGVER) libpng.pc \
106
 
-       libpng.so.3.$(PNGMIN)
107
 
-       -@if [ ! -d $(DL) ]; then mkdir $(DL); fi
108
 
+install-shared: install-headers $(LIBNAME).so.$(PNGVER) libpng.pc
109
 
+       -@if [ ! -d $(DL) ]; then mkdir -p $(DL); fi
110
 
        -@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGVER)* $(DL)/$(LIBNAME).so
111
 
        -@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGMAJ)
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)
117
 
        chmod 755 $(DL)/$(LIBNAME).so.$(PNGVER)
118
 
-       chmod 755 $(DL)/libpng.so.3.$(PNGMIN)
119
 
        (cd $(DL); \
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; \
124
 
        ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
125
 
        ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
126
 
        -@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; 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
142
 
        -@/bin/rm -f $(DB)/libpng-config
143
 
        -@/bin/rm -f $(DB)/$(LIBNAME)-config
144
 
        cp libpng-config $(DB)/$(LIBNAME)-config