504ec2ab8703d21ac1d9b948d92e0aafa74b0257
[openwrt/svn-archive/archive.git] / openwrt / package / zlib / patches / zlib.patch
1 --- zlib-1.2.3-orig/Makefile.in 2005-07-18 04:25:21.000000000 +0200
2 +++ zlib-1.2.3/Makefile.in 2006-01-13 15:31:04.000000000 +0100
3 @@ -25,20 +25,23 @@
4 # -Wstrict-prototypes -Wmissing-prototypes
5
6 LDFLAGS=libz.a
7 -LDSHARED=$(CC)
8 +LDSHARED=$(CC) -shared -Wl,-soname,$(SHAREDLIBM)
9 CPP=$(CC) -E
10
11 -LIBS=libz.a
12 +LIBS=
13 +STATICLIB=libz.a
14 SHAREDLIB=libz.so
15 SHAREDLIBV=libz.so.1.2.3
16 SHAREDLIBM=libz.so.1
17
18 -AR=ar rc
19 +AR=ar
20 RANLIB=ranlib
21 TAR=tar
22 SHELL=/bin/sh
23 EXE=
24
25 +DESTDIR =
26 +
27 prefix = /usr/local
28 exec_prefix = ${prefix}
29 libdir = ${exec_prefix}/lib
30 @@ -67,8 +70,8 @@
31 echo ' *** zlib test FAILED ***'; \
32 fi
33
34 -libz.a: $(OBJS) $(OBJA)
35 - $(AR) $@ $(OBJS) $(OBJA)
36 +$(STATICLIB): $(OBJS) $(OBJA)
37 + $(AR) rc $@ $(OBJS) $(OBJA)
38 -@ ($(RANLIB) $@ || true) >/dev/null 2>&1
39
40 match.o: match.S
41 @@ -77,8 +80,10 @@
42 mv _match.o match.o
43 rm -f _match.s
44
45 +$(SHAREDLIB): $(SHAREDLIBV)
46 +
47 $(SHAREDLIBV): $(OBJS)
48 - $(LDSHARED) -o $@ $(OBJS)
49 + $(LDSHARED) -lc -o $@ $(OBJS)
50 rm -f $(SHAREDLIB) $(SHAREDLIBM)
51 ln -s $@ $(SHAREDLIB)
52 ln -s $@ $(SHAREDLIBM)
53 @@ -90,23 +95,23 @@
54 $(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS)
55
56 install: $(LIBS)
57 - -@if [ ! -d $(exec_prefix) ]; then mkdir -p $(exec_prefix); fi
58 - -@if [ ! -d $(includedir) ]; then mkdir -p $(includedir); fi
59 - -@if [ ! -d $(libdir) ]; then mkdir -p $(libdir); fi
60 - -@if [ ! -d $(man3dir) ]; then mkdir -p $(man3dir); fi
61 - cp zlib.h zconf.h $(includedir)
62 - chmod 644 $(includedir)/zlib.h $(includedir)/zconf.h
63 - cp $(LIBS) $(libdir)
64 - cd $(libdir); chmod 755 $(LIBS)
65 - -@(cd $(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1
66 - cd $(libdir); if test -f $(SHAREDLIBV); then \
67 + -@if [ ! -d $(DESTDIR)$(exec_prefix) ]; then mkdir -p $(DESTDIR)$(exec_prefix); fi
68 + -@if [ ! -d $(DESTDIR)$(includedir) ]; then mkdir -p $(DESTDIR)$(includedir); fi
69 + -@if [ ! -d $(DESTDIR)$(libdir) ]; then mkdir -p $(DESTDIR)$(libdir); fi
70 + -@if [ ! -d $(DESTDIR)$(man3dir) ]; then mkdir -p $(DESTDIR)$(man3dir); fi
71 + cp zlib.h zconf.h $(DESTDIR)$(includedir)
72 + chmod 644 $(DESTDIR)$(includedir)/zlib.h $(DESTDIR)$(includedir)/zconf.h
73 + cp $(STATICLIB) $(SHAREDLIBV) $(DESTDIR)$(libdir)
74 + cd $(DESTDIR)$(libdir); chmod 755 $(LIBS)
75 + -@(cd $(DESTDIR)$(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1
76 + cd $(DESTDIR)$(libdir); if test -f $(SHAREDLIBV); then \
77 rm -f $(SHAREDLIB) $(SHAREDLIBM); \
78 ln -s $(SHAREDLIBV) $(SHAREDLIB); \
79 ln -s $(SHAREDLIBV) $(SHAREDLIBM); \
80 (ldconfig || true) >/dev/null 2>&1; \
81 fi
82 - cp zlib.3 $(man3dir)
83 - chmod 644 $(man3dir)/zlib.3
84 + cp zlib.3 $(DESTDIR)$(man3dir)
85 + chmod 644 $(DESTDIR)$(man3dir)/zlib.3
86 # The ranlib in install is needed on NeXTSTEP which checks file times
87 # ldconfig is for Linux
88