$NetBSD: patch-aa,v 1.10 2004/03/29 01:18:41 tv Exp $ --- Makefile.orig Fri Jan 25 18:34:53 2002 +++ Makefile Mon Mar 15 11:42:02 2004 @@ -2,43 +2,35 @@ SHELL=/bin/sh # To assist in cross-compiling -CC=gcc +CC=${LIBTOOL} --mode=compile ${REALCC} +LD=${LIBTOOL} --mode=link ${REALCC} AR=ar RANLIB=ranlib -LDFLAGS= # Suitably paranoid flags to avoid bugs in gcc-2.7 BIGFILES=-D_FILE_OFFSET_BITS=64 -CFLAGS=-Wall -Winline -O2 -fomit-frame-pointer -fno-strength-reduce $(BIGFILES) +CFLAGS+=$(BIGFILES) -# Where you want it installed when you do 'make install' -PREFIX=/usr +OBJS= blocksort.lo \ + huffman.lo \ + crctable.lo \ + randtable.lo \ + compress.lo \ + decompress.lo \ + bzlib.lo +all: libbz2.la bzip2 bzip2recover test -OBJS= blocksort.o \ - huffman.o \ - crctable.o \ - randtable.o \ - compress.o \ - decompress.o \ - bzlib.o - -all: libbz2.a bzip2 bzip2recover test - -bzip2: libbz2.a bzip2.o - $(CC) $(CFLAGS) $(LDFLAGS) -o bzip2 bzip2.o -L. -lbz2 +bzip2: libbz2.la bzip2.o + $(LD) $(CFLAGS) $(LDFLAGS) -static -o bzip2 bzip2.o libbz2.la bzip2recover: bzip2recover.o - $(CC) $(CFLAGS) $(LDFLAGS) -o bzip2recover bzip2recover.o + $(LD) $(CFLAGS) $(LDFLAGS) -static -o bzip2recover bzip2recover.o -libbz2.a: $(OBJS) - rm -f libbz2.a - $(AR) cq libbz2.a $(OBJS) - @if ( test -f $(RANLIB) -o -f /usr/bin/ranlib -o \ - -f /bin/ranlib -o -f /usr/ccs/bin/ranlib ) ; then \ - echo $(RANLIB) libbz2.a ; \ - $(RANLIB) libbz2.a ; \ - fi +libbz2.la: $(OBJS) + rm -f libbz2.la + $(LD) $(LDFLAGS) -o libbz2.la $(OBJS) -version-info 0:0 \ + -rpath $(PREFIX)/lib check: test test: bzip2 @@ -102,20 +94,20 @@ sample1.rb2 sample2.rb2 sample3.rb2 \ sample1.tst sample2.tst sample3.tst -blocksort.o: blocksort.c +blocksort.lo: blocksort.c @cat words0 $(CC) $(CFLAGS) -c blocksort.c -huffman.o: huffman.c +huffman.lo: huffman.c $(CC) $(CFLAGS) -c huffman.c -crctable.o: crctable.c +crctable.lo: crctable.c $(CC) $(CFLAGS) -c crctable.c -randtable.o: randtable.c +randtable.lo: randtable.c $(CC) $(CFLAGS) -c randtable.c -compress.o: compress.c +compress.lo: compress.c $(CC) $(CFLAGS) -c compress.c -decompress.o: decompress.c +decompress.lo: decompress.c $(CC) $(CFLAGS) -c decompress.c -bzlib.o: bzlib.c +bzlib.lo: bzlib.c $(CC) $(CFLAGS) -c bzlib.c bzip2.o: bzip2.c $(CC) $(CFLAGS) -c bzip2.c