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

« back to all changes in this revision

Viewing changes to scripts/makefile.darwin

  • 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
1
# makefile for libpng on Darwin / Mac OS X
2
 
# Copyright (C) 2002,2004 Glenn Randers-Pehrson
 
2
# Copyright (C) 2002, 2004, 2006 Glenn Randers-Pehrson
3
3
# Copyright (C) 2001 Christoph Pfisterer
4
4
# derived from makefile.linux:
5
5
#  Copyright (C) 1998, 1999 Greg Roelofs
8
8
 
9
9
# where "make install" puts libpng.a, libpng12.dylib, png.h and pngconf.h
10
10
prefix=/usr/local
 
11
exec_prefix=$(prefix)
11
12
 
12
13
# Where the zlib library and include files are located
13
14
#ZLIBLIB=/usr/local/lib
15
16
ZLIBLIB=../zlib
16
17
ZLIBINC=../zlib
17
18
 
 
19
# Library name:
 
20
LIBNAME = libpng12
 
21
PNGMAJ = 0
 
22
PNGMIN = 1.2.13
 
23
PNGVER = $(PNGMAJ).$(PNGMIN)
 
24
 
 
25
# Shared library names:
 
26
LIBSO=$(LIBNAME).dylib
 
27
LIBSOMAJ=$(LIBNAME).$(PNGMAJ).dylib
 
28
LIBSOVER=$(LIBNAME).$(PNGVER).dylib
 
29
OLDSO=libpng.dylib
 
30
OLDSOMAJ=libpng.3.dylib
 
31
OLDSOVER=libpng.3.$(PNGMIN).dylib
 
32
 
 
33
# Utilities:
18
34
CC=cc
 
35
AR_RC=ar rc
 
36
MKDIR_P=mkdir -p
 
37
LN_SF=ln -sf
 
38
RANLIB=ranlib
 
39
RM_F=/bin/rm -f
 
40
 
19
41
CFLAGS=-I$(ZLIBINC) -Wall -O3 -funroll-loops
20
42
LDFLAGS=-L. -L$(ZLIBLIB) -lpng12 -lz
21
43
 
22
 
#RANLIB=echo
23
 
RANLIB=ranlib
24
 
 
25
 
PNGMAJ = 0
26
 
PNGMIN = 1.2.8
27
 
PNGVER = $(PNGMAJ).$(PNGMIN)
28
 
LIBNAME = libpng12
29
 
 
30
44
INCPATH=$(prefix)/include
31
 
LIBPATH=$(prefix)/lib
 
45
LIBPATH=$(exec_prefix)/lib
32
46
MANPATH=$(prefix)/man
33
 
BINPATH=$(prefix)/bin
 
47
BINPATH=$(exec_prefix)/bin
34
48
 
35
49
# override DESTDIR= on the make install command line to easily support
36
50
# installing into a temporary location.  Example:
58
72
.c.pic.o:
59
73
        $(CC) -c $(CFLAGS) -fno-common -o $@ $*.c
60
74
 
61
 
all: libpng.a $(LIBNAME).dylib pngtest libpng.pc libpng-config
 
75
all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config
62
76
 
63
77
libpng.a: $(OBJS)
64
 
        ar rc $@ $(OBJS)
 
78
        $(AR_RC) $@ $(OBJS)
65
79
        $(RANLIB) $@
66
80
 
67
81
libpng.pc:
77
91
        cat scripts/libpng-config-body.in ) > libpng-config
78
92
        chmod +x libpng-config
79
93
 
80
 
$(LIBNAME).dylib: $(LIBNAME).$(PNGMAJ).dylib
81
 
        ln -sf $(LIBNAME).$(PNGMAJ).dylib $(LIBNAME).dylib
82
 
 
83
 
$(LIBNAME).$(PNGMAJ).dylib: $(LIBNAME).$(PNGVER).dylib
84
 
        ln -sf $(LIBNAME).$(PNGVER).dylib $(LIBNAME).$(PNGMAJ).dylib
85
 
 
86
 
$(LIBNAME).$(PNGVER).dylib: $(OBJSDLL)
 
94
$(LIBSO): $(LIBSOMAJ)
 
95
        $(LN_SF) $(LIBSOMAJ) $(LIBSO)
 
96
 
 
97
$(LIBSOMAJ): $(LIBSOVER)
 
98
        $(LN_SF) $(LIBSOVER) $(LIBSOMAJ)
 
99
 
 
100
$(LIBSOVER): $(OBJSDLL)
87
101
        $(CC) -dynamiclib \
88
 
         -install_name $(LIBPATH)/$(LIBNAME).$(PNGMAJ).dylib \
 
102
         -install_name $(LIBPATH)/$(LIBSOMAJ) \
89
103
         -current_version $(PNGVER) -compatibility_version $(PNGVER) \
90
 
         -o $(LIBNAME).$(PNGVER).dylib \
 
104
         -o $(LIBSOVER) \
91
105
         $(OBJSDLL) -L$(ZLIBLIB) -lz
92
106
 
93
 
libpng.3.$(PNGMIN).dylib: $(OBJSDLL)
 
107
$(OLDSOVER): $(OBJSDLL)
94
108
        $(CC) -dynamiclib \
95
 
         -install_name $(LIBPATH)/libpng.3.dylib \
 
109
         -install_name $(LIBPATH)/$(OLDSOMAJ) \
96
110
         -current_version 3 -compatibility_version 3 \
97
 
         -o libpng.3.$(PNGMIN).dylib \
 
111
         -o $(OLDSOVER) \
98
112
         $(OBJSDLL) -L$(ZLIBLIB) -lz
99
113
 
100
 
pngtest: pngtest.o $(LIBNAME).dylib
 
114
pngtest: pngtest.o $(LIBSO)
101
115
        $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
102
116
 
103
117
test: pngtest
104
118
        ./pngtest
105
119
 
106
120
install-headers: png.h pngconf.h
107
 
        -@if [ ! -d $(DI) ]; then mkdir $(DI); fi
108
 
        -@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi
 
121
        -@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi
 
122
        -@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi
109
123
        cp png.h pngconf.h $(DI)/$(LIBNAME)
110
124
        chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h
111
 
        -@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h
112
 
        -@/bin/rm -f $(DI)/libpng
113
 
        (cd $(DI); ln -sf $(LIBNAME) libpng; ln -sf $(LIBNAME)/* .)
 
125
        -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h
 
126
        -@$(RM_F) $(DI)/libpng
 
127
        (cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
114
128
 
115
129
install-static: install-headers libpng.a
116
 
        -@if [ ! -d $(DL) ]; then mkdir $(DL); fi
 
130
        -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
117
131
        cp libpng.a $(DL)/$(LIBNAME).a
118
132
        chmod 644 $(DL)/$(LIBNAME).a
119
133
        $(RANLIB) $(DL)/$(LIBNAME).a
120
 
        -@/bin/rm -f $(DL)/libpng.a
121
 
        (cd $(DL); ln -sf $(LIBNAME).a libpng.a)
 
134
        -@$(RM_F) $(DL)/libpng.a
 
135
        (cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a)
122
136
 
123
 
install-shared: install-headers $(LIBNAME).dylib libpng.pc \
124
 
        libpng.3.$(PNGMIN).dylib
125
 
        -@if [ ! -d $(DL) ]; then mkdir $(DL); fi
126
 
        -@/bin/rm -f $(DL)/$(LIBNAME).$(PNGVER)*.dylib
127
 
        -@/bin/rm -f $(DL)/$(LIBNAME).$(PNGMAJ)*.dylib
128
 
        -@/bin/rm -f $(DL)/$(LIBNAME).dylib
129
 
        -@/bin/rm -f $(DL)/libpng.dylib
130
 
        -@/bin/rm -f $(DL)/libpng.3.dylib
131
 
        -@/bin/rm -f $(DL)/libpng.3.$(PNGMIN)*.dylib
132
 
        cp $(LIBNAME).$(PNGVER).dylib $(DL)
133
 
        cp libpng.3.$(PNGMIN).dylib $(DL)
134
 
        chmod 755 $(DL)/$(LIBNAME).$(PNGVER).dylib
135
 
        chmod 755 $(DL)/libpng.3.$(PNGMIN).dylib
 
137
install-shared: install-headers $(LIBSO) libpng.pc \
 
138
        $(OLDSOVER)
 
139
        -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
 
140
        -@$(RM_F) $(DL)/$(LIBNAME).$(PNGVER)*.dylib
 
141
        -@$(RM_F) $(DL)/$(LIBNAME).$(PNGMAJ)*.dylib
 
142
        -@$(RM_F) $(DL)/$(LIBSO)
 
143
        -@$(RM_F) $(DL)/$(OLDSO)
 
144
        -@$(RM_F) $(DL)/$(OLDSOMAJ)
 
145
        -@$(RM_F) $(DL)/libpng.3.$(PNGMIN)*.dylib
 
146
        cp $(LIBSOVER) $(DL)
 
147
        cp $(OLDSOVER) $(DL)
 
148
        chmod 755 $(DL)/$(LIBSOVER)
 
149
        chmod 755 $(DL)/$(OLDSOVER)
136
150
        (cd $(DL); \
137
 
        ln -sf libpng.3.$(PNGMIN).dylib libpng.3.dylib; \
138
 
        ln -sf libpng.3.dylib libpng.dylib; \
139
 
        ln -sf $(LIBNAME).$(PNGVER).dylib $(LIBNAME).$(PNGMAJ).dylib; \
140
 
        ln -sf $(LIBNAME).$(PNGMAJ).dylib $(LIBNAME).dylib)
141
 
        -@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi
142
 
        -@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc
143
 
        -@/bin/rm -f $(DL)/pkgconfig/libpng.pc
 
151
        $(LN_SF) $(OLDSOVER) $(OLDSOMAJ); \
 
152
        $(LN_SF) $(OLDSOMAJ) $(OLDSO); \
 
153
        $(LN_SF) $(LIBSOVER) $(LIBSOMAJ); \
 
154
        $(LN_SF) $(LIBSOMAJ) $(LIBSO))
 
155
        -@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
 
156
        -@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
 
157
        -@$(RM_F) $(DL)/pkgconfig/libpng.pc
144
158
        cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
145
159
        chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
146
 
        (cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libpng.pc)
 
160
        (cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
147
161
 
148
162
install-man: libpng.3 libpngpf.3 png.5
149
 
        -@if [ ! -d $(DM) ]; then mkdir $(DM); fi
150
 
        -@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi
151
 
        -@/bin/rm -f $(DM)/man3/libpng.3
152
 
        -@/bin/rm -f $(DM)/man3/libpngpf.3
 
163
        -@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
 
164
        -@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
 
165
        -@$(RM_F) $(DM)/man3/libpng.3
 
166
        -@$(RM_F) $(DM)/man3/libpngpf.3
153
167
        cp libpng.3 $(DM)/man3
154
168
        cp libpngpf.3 $(DM)/man3
155
 
        -@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi
156
 
        -@/bin/rm -f $(DM)/man5/png.5
 
169
        -@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
 
170
        -@$(RM_F) $(DM)/man5/png.5
157
171
        cp png.5 $(DM)/man5
158
172
 
159
173
install-config: libpng-config
160
 
        -@if [ ! -d $(DB) ]; then mkdir $(DB); fi
161
 
        -@/bin/rm -f $(DB)/libpng-config
162
 
        -@/bin/rm -f $(DB)/$(LIBNAME)-config
 
174
        -@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
 
175
        -@$(RM_F) $(DB)/libpng-config
 
176
        -@$(RM_F) $(DB)/$(LIBNAME)-config
163
177
        cp libpng-config $(DB)/$(LIBNAME)-config
164
178
        chmod 755 $(DB)/$(LIBNAME)-config
165
 
        (cd $(DB); ln -sf $(LIBNAME)-config libpng-config)
 
179
        (cd $(DB); $(LN_SF) $(LIBNAME)-config libpng-config)
166
180
 
167
181
install: install-static install-shared install-man install-config
168
182
 
174
188
        echo
175
189
        echo Testing installed dynamic shared library in $(DL).
176
190
        $(CC) -I$(DI) -I$(ZLIBINC) \
177
 
           `$(BINPATH)/libpng12-config --cflags` pngtest.c \
 
191
           `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
178
192
           -L$(DL) -L$(ZLIBLIB) \
179
 
           -o pngtestd `$(BINPATH)/libpng12-config --ldflags`
 
193
           -o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags`
180
194
        ./pngtestd pngtest.png
181
195
 
182
196
test-installed:
183
197
        $(CC) $(CFLAGS) \
184
 
           `$(BINPATH)/libpng12-config --cflags` pngtest.c \
 
198
           `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
185
199
           -L$(ZLIBLIB) \
186
 
           -o pngtesti `$(BINPATH)/libpng12-config --ldflags`
 
200
           -o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags`
187
201
        ./pngtesti pngtest.png
188
202
 
189
203
clean:
190
 
        rm -f *.o libpng.a pngtest pngout.png libpng-config \
191
 
        libpng.3.$(PNGMIN).dylib \
 
204
        $(RM_F) *.o libpng.a pngtest pngout.png libpng-config \
 
205
        $(OLDSOVER) \
192
206
        libpng.pc $(LIBNAME).*dylib pngtesti
193
207
 
194
208
DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO