diff -ru bzip2-1.0.1/Makefile bzip2-1.0.1-patched/Makefile --- bzip2-1.0.1/Makefile Fri Jun 23 22:34:47 2000 +++ bzip2-1.0.1-patched/Makefile Tue Mar 27 10:15:21 2001 @@ -1,8 +1,14 @@ +# This Makefile builds a shared version of the library, +# libbz2.1.0.1.dylib, with install_name .../libbz2.1.dylib, +# on Darwin and Mac OS X. + +PREFIX=/usr + SHELL=/bin/sh -CC=gcc +CC=cc BIGFILES=-D_FILE_OFFSET_BITS=64 -CFLAGS=-Wall -Winline -O2 -fomit-frame-pointer -fno-strength-reduce $(BIGFILES) +CFLAGS=-fno-common -Wall -Winline -O2 -fomit-frame-pointer -fno-strength-reduce $(BIGFILES) OBJS= blocksort.o \ huffman.o \ @@ -12,31 +18,28 @@ decompress.o \ bzlib.o -all: libbz2.a bzip2 bzip2recover test +all: libbz2.dylib bzip2 bzip2recover test -bzip2: libbz2.a bzip2.o +bzip2: libbz2.dylib bzip2.o $(CC) $(CFLAGS) -o bzip2 bzip2.o -L. -lbz2 bzip2recover: bzip2recover.o $(CC) $(CFLAGS) -o bzip2recover bzip2recover.o -libbz2.a: $(OBJS) - rm -f libbz2.a - ar cq libbz2.a $(OBJS) - @if ( test -f /usr/bin/ranlib -o -f /bin/ranlib -o \ - -f /usr/ccs/bin/ranlib ) ; then \ - echo ranlib libbz2.a ; \ - ranlib libbz2.a ; \ - fi +libbz2.dylib: $(OBJS) + rm -f libbz2.dylib libbz2.*.dylib + $(CC) -dynamiclib -o libbz2.1.0.1.dylib $(OBJS) -install_name $(PREFIX)/lib/libbz2.1.dylib -compatibility_version 1.0.1 -current_version 1.0.1 + ln -s libbz2.1.0.1.dylib libbz2.1.dylib + ln -s libbz2.1.0.1.dylib libbz2.dylib test: bzip2 @cat words1 - ./bzip2 -1 < sample1.ref > sample1.rb2 - ./bzip2 -2 < sample2.ref > sample2.rb2 - ./bzip2 -3 < sample3.ref > sample3.rb2 - ./bzip2 -d < sample1.bz2 > sample1.tst - ./bzip2 -d < sample2.bz2 > sample2.tst - ./bzip2 -ds < sample3.bz2 > sample3.tst + DYLD_LIBRARY_PATH=. ./bzip2 -1 < sample1.ref > sample1.rb2 + DYLD_LIBRARY_PATH=. ./bzip2 -2 < sample2.ref > sample2.rb2 + DYLD_LIBRARY_PATH=. ./bzip2 -3 < sample3.ref > sample3.rb2 + DYLD_LIBRARY_PATH=. ./bzip2 -d < sample1.bz2 > sample1.tst + DYLD_LIBRARY_PATH=. ./bzip2 -d < sample2.bz2 > sample2.tst + DYLD_LIBRARY_PATH=. ./bzip2 -ds < sample3.bz2 > sample3.tst cmp sample1.bz2 sample1.rb2 cmp sample2.bz2 sample2.rb2 cmp sample3.bz2 sample3.rb2 @@ -45,8 +48,6 @@ cmp sample3.tst sample3.ref @cat words3 -PREFIX=/usr - install: bzip2 bzip2recover if ( test ! -d $(PREFIX)/bin ) ; then mkdir $(PREFIX)/bin ; fi if ( test ! -d $(PREFIX)/lib ) ; then mkdir $(PREFIX)/lib ; fi @@ -65,11 +66,13 @@ chmod a+r $(PREFIX)/man/man1/bzip2.1 cp -f bzlib.h $(PREFIX)/include chmod a+r $(PREFIX)/include/bzlib.h - cp -f libbz2.a $(PREFIX)/lib - chmod a+r $(PREFIX)/lib/libbz2.a + cp -f libbz2.1.0.1.dylib $(PREFIX)/lib + chmod a+rx $(PREFIX)/lib/libbz2.1.0.1.dylib + (cd $(PREFIX)/lib && rm -f libbz2.1.dylib && ln -s libbz2.1.0.1.dylib libbz2.1.dylib) + (cd $(PREFIX)/lib && rm -f libbz2.dylib && ln -s libbz2.1.0.1.dylib libbz2.dylib) clean: - rm -f *.o libbz2.a bzip2 bzip2recover \ + rm -f *.o libbz2.dylib bzip2 bzip2recover \ sample1.rb2 sample2.rb2 sample3.rb2 \ sample1.tst sample2.tst sample3.tst @@ -92,50 +95,3 @@ $(CC) $(CFLAGS) -c bzip2.c bzip2recover.o: bzip2recover.c $(CC) $(CFLAGS) -c bzip2recover.c - -DISTNAME=bzip2-1.0.1 -tarfile: - rm -f $(DISTNAME) - ln -sf . $(DISTNAME) - tar cvf $(DISTNAME).tar \ - $(DISTNAME)/blocksort.c \ - $(DISTNAME)/huffman.c \ - $(DISTNAME)/crctable.c \ - $(DISTNAME)/randtable.c \ - $(DISTNAME)/compress.c \ - $(DISTNAME)/decompress.c \ - $(DISTNAME)/bzlib.c \ - $(DISTNAME)/bzip2.c \ - $(DISTNAME)/bzip2recover.c \ - $(DISTNAME)/bzlib.h \ - $(DISTNAME)/bzlib_private.h \ - $(DISTNAME)/Makefile \ - $(DISTNAME)/manual.texi \ - $(DISTNAME)/manual.ps \ - $(DISTNAME)/LICENSE \ - $(DISTNAME)/bzip2.1 \ - $(DISTNAME)/bzip2.1.preformatted \ - $(DISTNAME)/bzip2.txt \ - $(DISTNAME)/words0 \ - $(DISTNAME)/words1 \ - $(DISTNAME)/words2 \ - $(DISTNAME)/words3 \ - $(DISTNAME)/sample1.ref \ - $(DISTNAME)/sample2.ref \ - $(DISTNAME)/sample3.ref \ - $(DISTNAME)/sample1.bz2 \ - $(DISTNAME)/sample2.bz2 \ - $(DISTNAME)/sample3.bz2 \ - $(DISTNAME)/dlltest.c \ - $(DISTNAME)/*.html \ - $(DISTNAME)/README \ - $(DISTNAME)/README.COMPILATION.PROBLEMS \ - $(DISTNAME)/CHANGES \ - $(DISTNAME)/libbz2.def \ - $(DISTNAME)/libbz2.dsp \ - $(DISTNAME)/dlltest.dsp \ - $(DISTNAME)/makefile.msc \ - $(DISTNAME)/Y2K_INFO \ - $(DISTNAME)/unzcrash.c \ - $(DISTNAME)/spewG.c \ - $(DISTNAME)/Makefile-libbz2_so