1 diff -ruN zlib-1.2.3-orig/Makefile.in zlib-1.2.3-2/Makefile.in
2 --- zlib-1.2.3-orig/Makefile.in 2005-07-18 10:25:21.000000000 +0800
3 +++ zlib-1.2.3-2/Makefile.in 2006-10-16 21:23:27.000000000 +0800
5 # -Wstrict-prototypes -Wmissing-prototypes
9 +LDSHARED=$(CC) -shared -Wl,-soname,$(SHAREDLIBM)
16 SHAREDLIBV=libz.so.1.2.3
29 exec_prefix = ${prefix}
30 libdir = ${exec_prefix}/lib
32 echo ' *** zlib test FAILED ***'; \
35 -libz.a: $(OBJS) $(OBJA)
36 - $(AR) $@ $(OBJS) $(OBJA)
37 +$(STATICLIB): $(OBJS) $(OBJA)
38 + $(AR) rc $@ $(OBJS) $(OBJA)
39 -@ ($(RANLIB) $@ || true) >/dev/null 2>&1
46 +$(SHAREDLIB): $(SHAREDLIBV)
48 $(SHAREDLIBV): $(OBJS)
49 - $(LDSHARED) -o $@ $(OBJS)
50 + $(LDSHARED) -lc -o $@ $(OBJS)
51 rm -f $(SHAREDLIB) $(SHAREDLIBM)
53 ln -s $@ $(SHAREDLIBM)
55 $(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS)
58 - -@if [ ! -d $(exec_prefix) ]; then mkdir -p $(exec_prefix); fi
59 - -@if [ ! -d $(includedir) ]; then mkdir -p $(includedir); fi
60 - -@if [ ! -d $(libdir) ]; then mkdir -p $(libdir); fi
61 - -@if [ ! -d $(man3dir) ]; then mkdir -p $(man3dir); fi
62 - cp zlib.h zconf.h $(includedir)
63 - chmod 644 $(includedir)/zlib.h $(includedir)/zconf.h
64 - cp $(LIBS) $(libdir)
65 - cd $(libdir); chmod 755 $(LIBS)
66 - -@(cd $(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1
67 - cd $(libdir); if test -f $(SHAREDLIBV); then \
68 + -@if [ ! -d $(DESTDIR)$(exec_prefix) ]; then mkdir -p $(DESTDIR)$(exec_prefix); fi
69 + -@if [ ! -d $(DESTDIR)$(includedir) ]; then mkdir -p $(DESTDIR)$(includedir); fi
70 + -@if [ ! -d $(DESTDIR)$(libdir) ]; then mkdir -p $(DESTDIR)$(libdir); fi
71 + -@if [ ! -d $(DESTDIR)$(man3dir) ]; then mkdir -p $(DESTDIR)$(man3dir); fi
72 + cp zlib.h zconf.h $(DESTDIR)$(includedir)
73 + chmod 644 $(DESTDIR)$(includedir)/zlib.h $(DESTDIR)$(includedir)/zconf.h
74 + cp $(STATICLIB) $(SHAREDLIBV) $(DESTDIR)$(libdir)
75 + cd $(DESTDIR)$(libdir); chmod 755 $(LIBS)
76 + -@(cd $(DESTDIR)$(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1
77 + cd $(DESTDIR)$(libdir); if test -f $(SHAREDLIBV); then \
78 rm -f $(SHAREDLIB) $(SHAREDLIBM); \
79 ln -s $(SHAREDLIBV) $(SHAREDLIB); \
80 ln -s $(SHAREDLIBV) $(SHAREDLIBM); \
81 (ldconfig || true) >/dev/null 2>&1; \
83 - cp zlib.3 $(man3dir)
84 - chmod 644 $(man3dir)/zlib.3
85 + cp zlib.3 $(DESTDIR)$(man3dir)
86 + chmod 644 $(DESTDIR)$(man3dir)/zlib.3
87 # The ranlib in install is needed on NeXTSTEP which checks file times
88 # ldconfig is for Linux
90 diff -ruN zlib-1.2.3-orig/configure zlib-1.2.3-2/configure
91 --- zlib-1.2.3-orig/configure 2005-07-12 04:11:57.000000000 +0800
92 +++ zlib-1.2.3-2/configure 2006-10-16 21:25:38.000000000 +0800
94 VER=`sed -n -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`
95 VER2=`sed -n -e '/VERSION "/s/.*"\([0-9]*\\.[0-9]*\)\\..*/\1/p' < zlib.h`
96 VER1=`sed -n -e '/VERSION "/s/.*"\([0-9]*\)\\..*/\1/p' < zlib.h`
99 RANLIB=${RANLIB-"ranlib"}
100 prefix=${prefix-/usr/local}
101 exec_prefix=${exec_prefix-'${prefix}'}
104 if test "$gcc" -eq 1 && ($cc -c $cflags $test.c) 2>/dev/null; then
106 - SFLAGS=${CFLAGS-"-fPIC -O3"}
107 + SFLAGS=${CFLAGS-"-D_REENTRANT -fPIC -O3"}
109 - case `(uname -s || echo unknown) 2>/dev/null` in
110 - Linux | linux | GNU | GNU/*) LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1"};;
111 - CYGWIN* | Cygwin* | cygwin* | OS/2* )
113 - QNX*) # This is for QNX6. I suppose that the QNX rule below is for QNX2,QNX4
114 - # (alain.bonnefoy@icbt.com)
115 - LDSHARED=${LDSHARED-"$cc -shared -Wl,-hlibz.so.1"};;
117 - LDSHARED=${LDSHARED-"$cc -shared $SFLAGS"}
118 - case `(uname -m || echo unknown) 2>/dev/null` in
121 - SHAREDLIB='libz.so';;
124 - SHAREDLIB='libz.sl';;
126 - Darwin*) shared_ext='.dylib'
127 - SHAREDLIB=libz$shared_ext
128 - SHAREDLIBV=libz.$VER$shared_ext
129 - SHAREDLIBM=libz.$VER1$shared_ext
130 - LDSHARED=${LDSHARED-"$cc -dynamiclib -install_name $libdir/$SHAREDLIBM -compatibility_version $VER1 -current_version $VER"};;
131 - *) LDSHARED=${LDSHARED-"$cc -shared"};;
133 + LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1"}
135 # find system name and corresponding cc options
138 echo Checking for mmap support... No.
143 +int main() { char buf[10]; snprintf(buf, sizeof(buf), "%s", "F"); return 0; }
145 +if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
146 + echo "Checking for snprintf... Yes."
147 + CFLAGS="$CFLAGS -DHAS_snprintf"
149 + echo "Checking for snprintf.. No."
155 +int main(void) { va_list a; vsnprintf(0, 0, "", a); return 0; }
157 +if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
158 + echo "Checking for vsnprintf... Yes."
159 + CFLAGS="$CFLAGS -DHAS_vsnprintf"
161 + echo "Checking for vsnprintf.. No."
167 @@ -440,20 +440,21 @@
171 -/^CFLAGS *=/s#=.*#=$CFLAGS#
172 -/^CPP *=/s#=.*#=$CPP#
173 -/^LDSHARED *=/s#=.*#=$LDSHARED#
174 -/^LIBS *=/s#=.*#=$LIBS#
175 -/^SHAREDLIB *=/s#=.*#=$SHAREDLIB#
176 -/^SHAREDLIBV *=/s#=.*#=$SHAREDLIBV#
177 -/^SHAREDLIBM *=/s#=.*#=$SHAREDLIBM#
179 -/^RANLIB *=/s#=.*#=$RANLIB#
180 -/^EXE *=/s#=.*#=$EXE#
181 -/^prefix *=/s#=.*#=$prefix#
182 -/^exec_prefix *=/s#=.*#=$exec_prefix#
183 -/^libdir *=/s#=.*#=$libdir#
184 -/^includedir *=/s#=.*#=$includedir#
185 -/^mandir *=/s#=.*#=$mandir#
186 -/^LDFLAGS *=/s#=.*#=$LDFLAGS#
187 +/^CC *=/s%=.*%= $CC%
188 +/^CFLAGS *=/s%=.*%= $CFLAGS%
189 +/^CPP *=/s%=.*%= $CPP%
190 +/^LDSHARED *=/s%=.*%= $LDSHARED%
191 +/^LIBS *=/s%=.*%= $LIBS%
192 +/^SHAREDLIB *=/s%=.*%= $SHAREDLIB%
193 +/^SHAREDLIBV *=/s%=.*%= $SHAREDLIBV%
194 +/^SHAREDLIBM *=/s%=.*%= $SHAREDLIBM%
195 +/^AR *=/s%=.*%= $AR%
196 +/^RANLIB *=/s%=.*%= $RANLIB%
197 +/^EXE *=/s%=.*%= $EXE%
198 +/^prefix *=/s%=.*%= $prefix%
199 +/^exec_prefix *=/s%=.*%= $exec_prefix%
200 +/^libdir *=/s%=.*%= $libdir%
201 +/^includedir *=/s%=.*%= $includedir%
202 +/^mandir *=/s%=.*%= $mandir%
203 +/^LDFLAGS *=/s%=.*%= $LDFLAGS%
205 diff -ruN zlib-1.2.3-orig/contrib/minizip/Makefile zlib-1.2.3-2/contrib/minizip/Makefile
206 --- zlib-1.2.3-orig/contrib/minizip/Makefile 2005-07-13 02:08:40.000000000 +0800
207 +++ zlib-1.2.3-2/contrib/minizip/Makefile 2006-10-16 21:23:27.000000000 +0800
211 +CFLAGS=-O2 -g -I../.. -Dunix
213 -UNZ_OBJS = miniunz.o unzip.o ioapi.o ../../libz.a
214 -ZIP_OBJS = minizip.o zip.o ioapi.o ../../libz.a
215 +UNZ_OBJS = miniunz.o unzip.o ioapi.o
216 +ZIP_OBJS = minizip.o zip.o ioapi.o
219 $(CC) -c $(CFLAGS) $*.c
224 - $(CC) $(CFLAGS) -o $@ $(UNZ_OBJS)
225 + $(CC) $(CFLAGS) -o $@ $(UNZ_OBJS) -L ../.. -lz
228 - $(CC) $(CFLAGS) -o $@ $(ZIP_OBJS)
229 + $(CC) $(CFLAGS) -o $@ $(ZIP_OBJS) -L ../.. -lz
231 test: miniunz minizip
232 ./minizip test readme.txt