--- zlib-1.0.4/configure.orig Tue May 21 13:32:19 1996 +++ zlib-1.0.4/configure Tue Jul 8 11:42:30 1997 @@ -9,8 +9,7 @@ # or for csh/tcsh users: # (setenv prefix $HOME; setenv CC cc; setenv CFLAGS "-O4"; ./configure) # LDSHARED is the command to be used to create a shared library - -LIBS=libz.a +LIBNAME=${LIBNAME-z} VER=`sed -n -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h` AR=${AR-"ar rc"} RANLIB=${RANLIB-"ranlib"} @@ -64,8 +63,7 @@ if test "`($CC -c $SFLAGS $test.c) 2>&1`" = "" && test "`($LDSHARED -o $test.so $test.o) 2>&1`" = ""; then CFLAGS="$SFLAGS" - LIBS='libz.so.$(VER)' - echo Building shared library libz.so.$VER with $CC. + echo Building shared library lib$LIBNAME.so.$VER with $CC. else LDSHARED="$CC" echo Building static library $LIBS version $VER with $CC. @@ -77,10 +75,10 @@ /^CC *=/s/=.*/=$CC/ /^CFLAGS *=/s/=.*/=$CFLAGS/ /^LDSHARED *=/s/=.*/=$LDSHARED/ -/^LIBS *=/s,=.*,=$LIBS, /^AR *=/s/=.*/=$AR/ /^RANLIB *=/s,=.*,=$RANLIB, /^VER *=/s/=.*/=$VER/ /^prefix *=/s,=.*,=$prefix, /^exec_prefix *=/s,=.*,=$exec_prefix, +/^LIBNAME *=/s,=.*,=$LIBNAME, " > Makefile --- zlib-1.0.4/Makefile.in.orig Wed Jul 24 08:57:03 1996 +++ zlib-1.0.4/Makefile.in Tue Jul 8 11:42:47 1997 @@ -18,13 +18,13 @@ #CFLAGS=-g -DDEBUG #CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \ # -Wstrict-prototypes -Wmissing-prototypes - -LDFLAGS=-L. -lz +LIBNAME=@LIBNAME@ +LDFLAGS=-L. -l$(LIBNAME) LDSHARED=$(CC) VER=1.0.4 -LIBS=libz.a - +MAJORVER=1 +LIBS=lib$(LIBNAME).a lib$(LIBNAME).so.$(VER) AR=ar rc RANLIB=ranlib TAR=tar @@ -46,13 +46,13 @@ ./example echo hello world | ./minigzip | ./minigzip -d -libz.a: $(OBJS) +lib$(LIBNAME).a: $(OBJS) $(AR) $@ $(OBJS) -@ ($(RANLIB) $@ || true) 2>/dev/null -libz.so.$(VER): $(OBJS) - $(LDSHARED) -o $@ $(OBJS) - rm -f libz.so; ln -s $@ libz.so +lib$(LIBNAME).so.$(VER): $(OBJS) + $(LDSHARED) -Wl,-soname,lib$(LIBNAME).so.$(MAJORVER) -o $@ $(OBJS) -lc + rm -f lib$(LIBNAME).so; ln -sf $@ lib$(LIBNAME).so example: example.o $(LIBS) $(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS) @@ -67,22 +67,22 @@ chmod 644 $(prefix)/include/zlib.h $(prefix)/include/zconf.h cp $(LIBS) $(exec_prefix)/lib cd $(exec_prefix)/lib; chmod 644 $(LIBS) - -@(cd $(exec_prefix)/lib; $(RANLIB) libz.a || true) >/dev/null 2>&1 - cd $(exec_prefix)/lib; if test -f libz.so.$(VER); then \ - ln -s libz.so.$(VER) libz.so; \ + -@(cd $(exec_prefix)/lib; $(RANLIB) lib$(LIBNAME).a || true) >/dev/null 2>&1 + cd $(exec_prefix)/lib; if test -f lib$(LIBNAME).so.$(VER); then \ + ln -sf lib$(LIBNAME).so.$(VER) lib$(LIBNAME).so; \ fi # The ranlib in install is needed on NeXTSTEP which checks file times uninstall: cd $(exec_prefix)/lib; rm -f $(LIBS); \ - if test -f libz.so; then \ + if test -f lib$(LIBNAME).so; then \ v=`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p'<$(prefix)/include/zlib.h`;\ - rm -f libz.so.$$v libz.so; \ + rm -f lib$(LIBNAME).so.$$v lib$(LIBNAME).so; \ fi cd $(prefix)/include; rm -f zlib.h zconf.h clean: - rm -f *.o *~ example minigzip libz.a libz.so* foo.gz + rm -f *.o *~ example minigzip lib$(LIBNAME).a lib$(LIBNAME).so* foo.gz zip: mv Makefile Makefile~; cp -p Makefile.in Makefile @@ -94,7 +94,7 @@ mv Makefile Makefile~; cp -p Makefile.in Makefile d=zlib-`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\ rm -f $$d.tar.gz; \ - if test ! -d ../$$d; then rm -f ../$$d; ln -s `pwd` ../$$d; fi; \ + if test ! -d ../$$d; then rm -f ../$$d; ln -sf `pwd` ../$$d; fi; \ files=""; \ for f in $(DISTFILES); do files="$$files $$d/$$f"; done; \ cd ..; \