Ticket #358: patch-shared.diff

File patch-shared.diff, 2.1 KB (added by ssen@…, 21 years ago)

patch to build shared

  • Makefile

    old new  
    2323      decompress.o \
    2424      bzlib.o
    2525
    26 all: libbz2.a bzip2 bzip2recover test
     26all: libbz2.a libbz2.dylib bzip2 bzip2recover test
    2727
    2828bzip2: libbz2.a bzip2.o
    2929        $(CC) $(CFLAGS) $(LDFLAGS) -o bzip2 bzip2.o -L. -lbz2
     
    4040                $(RANLIB) libbz2.a ; \
    4141        fi
    4242
     43libbz2.dylib: $(OBJS)
     44        rm -f libbz2.dylib
     45        libtool -dynamic $(OBJS) -lSystem -o libbz2.1.0.2.dylib \
     46                -install_name $(PREFIX)/lib/libbz2.1.0.dylib \
     47                -compatibility_version 1.0 -current_version 1.0.2
     48        ln -s libbz2.1.0.2.dylib libbz2.1.0.dylib
     49        ln -s libbz2.1.0.2.dylib libbz2.1.dylib
     50        ln -s libbz2.1.0.2.dylib libbz2.dylib
     51
    4352check: test
    4453test: bzip2
    4554        @cat words1
    46         ./bzip2 -1  < sample1.ref > sample1.rb2
    47         ./bzip2 -2  < sample2.ref > sample2.rb2
    48         ./bzip2 -3  < sample3.ref > sample3.rb2
    49         ./bzip2 -d  < sample1.bz2 > sample1.tst
    50         ./bzip2 -d  < sample2.bz2 > sample2.tst
    51         ./bzip2 -ds < sample3.bz2 > sample3.tst
     55        DYLD_LIBRARY_PATH=. ./bzip2 -1  < sample1.ref > sample1.rb2
     56        DYLD_LIBRARY_PATH=. ./bzip2 -2  < sample2.ref > sample2.rb2
     57        DYLD_LIBRARY_PATH=. ./bzip2 -3  < sample3.ref > sample3.rb2
     58        DYLD_LIBRARY_PATH=. ./bzip2 -d  < sample1.bz2 > sample1.tst
     59        DYLD_LIBRARY_PATH=. ./bzip2 -d  < sample2.bz2 > sample2.tst
     60        DYLD_LIBRARY_PATH=. ./bzip2 -ds < sample3.bz2 > sample3.tst
    5261        cmp sample1.bz2 sample1.rb2
    5362        cmp sample2.bz2 sample2.rb2
    5463        cmp sample3.bz2 sample3.rb2
     
    7786        chmod a+r $(PREFIX)/include/bzlib.h
    7887        cp -f libbz2.a $(PREFIX)/lib
    7988        chmod a+r $(PREFIX)/lib/libbz2.a
     89        cp -f libbz2.1.0.2.dylib $(PREFIX)/lib
     90        chmod a+r $(PREFIX)/lib/libbz2.a
     91        cp -f libbz2.1.0.dylib $(PREFIX)/lib
     92        cp -f libbz2.1.dylib $(PREFIX)/lib
     93        cp -f libbz2.dylib $(PREFIX)/lib
    8094        cp -f bzgrep $(PREFIX)/bin/bzgrep
    8195        ln $(PREFIX)/bin/bzgrep $(PREFIX)/bin/bzegrep
    8296        ln $(PREFIX)/bin/bzgrep $(PREFIX)/bin/bzfgrep
     
    98112
    99113distclean: clean
    100114clean:
    101         rm -f *.o libbz2.a bzip2 bzip2recover \
     115        rm -f *.o libbz2.a libbz2.*.dylib bzip2 bzip2recover \
    102116        sample1.rb2 sample2.rb2 sample3.rb2 \
    103117        sample1.tst sample2.tst sample3.tst
    104118