summaryrefslogtreecommitdiffstats
path: root/patches/bzip2-1.0.5/bzip2-1.0.5_Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'patches/bzip2-1.0.5/bzip2-1.0.5_Makefile')
-rw-r--r--patches/bzip2-1.0.5/bzip2-1.0.5_Makefile173
1 files changed, 173 insertions, 0 deletions
diff --git a/patches/bzip2-1.0.5/bzip2-1.0.5_Makefile b/patches/bzip2-1.0.5/bzip2-1.0.5_Makefile
new file mode 100644
index 000000000..8f2fe0b42
--- /dev/null
+++ b/patches/bzip2-1.0.5/bzip2-1.0.5_Makefile
@@ -0,0 +1,173 @@
+Subject: various fixes in Makefile
+From: debian
+ This one fixes various problems in the makefile and disables compile time test.
+
+---
+ Makefile | 73 +++++++++++++++++++++++++++++++++++----------------------------
+ 1 file changed, 41 insertions(+), 32 deletions(-)
+
+Index: Makefile
+===================================================================
+--- Makefile.orig
++++ Makefile
+@@ -12,6 +12,8 @@
+ # in the file LICENSE.
+ # ------------------------------------------------------------------
+
++somajor=1.0
++sominor=$(somajor).4
+ SHELL=/bin/sh
+
+ # To assist in cross-compiling
+@@ -21,7 +23,7 @@ RANLIB=ranlib
+ LDFLAGS=
+
+ BIGFILES=-D_FILE_OFFSET_BITS=64
+-CFLAGS=-Wall -Winline -O2 -g $(BIGFILES)
++CFLAGS=-Wall -Winline -O2 -g $(BIGFILES) $(DEBCFLAGS)
+
+ # Where you want it installed when you do 'make install'
+ PREFIX=/usr/local
+@@ -35,9 +37,9 @@ OBJS= blocksort.o \
+ decompress.o \
+ bzlib.o
+
+-all: libbz2.a bzip2 bzip2recover test
++all: libbz2.a bzip2 bzip2recover # test
+
+-bzip2: libbz2.a bzip2.o
++bzip2: libbz2.so bzip2.o
+ $(CC) $(CFLAGS) $(LDFLAGS) -o bzip2 bzip2.o -L. -lbz2
+
+ bzip2recover: bzip2recover.o
+@@ -46,20 +48,42 @@ 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 \
++ @if ( test -f $(RANLIB) || test -f /usr/bin/ranlib || \
++ test -f /bin/ranlib || test -f /usr/ccs/bin/ranlib ) ; then \
+ echo $(RANLIB) libbz2.a ; \
+ $(RANLIB) libbz2.a ; \
+ fi
+
++libbz2.so: libbz2.so.$(somajor)
++ ln -sf $^ $@
++
++libbz2.so.$(somajor): libbz2.so.$(sominor)
++ ln -sf $^ $@
++
++libbz2.so.$(sominor): $(OBJS:%.o=%.sho)
++ $(CC) -o libbz2.so.$(sominor) -shared \
++ -Wl,-soname,libbz2.so.$(somajor) $^ -lc
++
++%.sho: %.c
++ $(CC) $(CFLAGS) -D_REENTRANT -fPIC -o $@ -c $<
++
++%.o: %.c
++ $(CC) $(CFLAGS) -D_REENTRANT -o $@ -c $<
++
+ check: test
+ test: bzip2
+ @cat words1
++ LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH \
+ ./bzip2 -1 < sample1.ref > sample1.rb2
++ LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH \
+ ./bzip2 -2 < sample2.ref > sample2.rb2
++ LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH \
+ ./bzip2 -3 < sample3.ref > sample3.rb2
++ LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH \
+ ./bzip2 -d < sample1.bz2 > sample1.tst
++ LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH \
+ ./bzip2 -d < sample2.bz2 > sample2.tst
++ LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH \
+ ./bzip2 -ds < sample3.bz2 > sample3.tst
+ cmp sample1.bz2 sample1.rb2
+ cmp sample2.bz2 sample2.rb2
+@@ -69,15 +93,15 @@ test: bzip2
+ cmp sample3.tst sample3.ref
+ @cat words3
+
+-install: bzip2 bzip2recover
++install: bzip2 bzip2recover libbz2.a
+ if ( test ! -d $(PREFIX)/bin ) ; then mkdir -p $(PREFIX)/bin ; fi
+ if ( test ! -d $(PREFIX)/lib ) ; then mkdir -p $(PREFIX)/lib ; fi
+ if ( test ! -d $(PREFIX)/man ) ; then mkdir -p $(PREFIX)/man ; fi
+ if ( test ! -d $(PREFIX)/man/man1 ) ; then mkdir -p $(PREFIX)/man/man1 ; fi
+ if ( test ! -d $(PREFIX)/include ) ; then mkdir -p $(PREFIX)/include ; fi
+ cp -f bzip2 $(PREFIX)/bin/bzip2
+- cp -f bzip2 $(PREFIX)/bin/bunzip2
+- cp -f bzip2 $(PREFIX)/bin/bzcat
++ ln $(PREFIX)/bin/bzip2 $(PREFIX)/bin/bunzip2
++ ln $(PREFIX)/bin/bzip2 $(PREFIX)/bin/bzcat
+ cp -f bzip2recover $(PREFIX)/bin/bzip2recover
+ chmod a+x $(PREFIX)/bin/bzip2
+ chmod a+x $(PREFIX)/bin/bunzip2
+@@ -87,8 +111,10 @@ install: bzip2 bzip2recover
+ 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
++ cp -fa libbz2.a libbz2.so* $(PREFIX)/lib
+ chmod a+r $(PREFIX)/lib/libbz2.a
++ cp -f bzexe $(PREFIX)/bin/bzexe
++ chmod a+x $(PREFIX)/bin/bzexe
+ cp -f bzgrep $(PREFIX)/bin/bzgrep
+ ln -s -f $(PREFIX)/bin/bzgrep $(PREFIX)/bin/bzegrep
+ ln -s -f $(PREFIX)/bin/bzgrep $(PREFIX)/bin/bzfgrep
+@@ -99,7 +125,8 @@ install: bzip2 bzip2recover
+ cp -f bzdiff $(PREFIX)/bin/bzdiff
+ ln -s -f $(PREFIX)/bin/bzdiff $(PREFIX)/bin/bzcmp
+ chmod a+x $(PREFIX)/bin/bzdiff
+- cp -f bzgrep.1 bzmore.1 bzdiff.1 $(PREFIX)/man/man1
++ cp -f bzexe.1 bzgrep.1 bzmore.1 bzdiff.1 $(PREFIX)/man/man1
++ chmod a+r $(PREFIX)/man/man1/bzexe.1
+ chmod a+r $(PREFIX)/man/man1/bzgrep.1
+ chmod a+r $(PREFIX)/man/man1/bzmore.1
+ chmod a+r $(PREFIX)/man/man1/bzdiff.1
+@@ -109,33 +136,13 @@ install: bzip2 bzip2recover
+ echo ".so man1/bzdiff.1" > $(PREFIX)/man/man1/bzcmp.1
+
+ clean:
+- rm -f *.o libbz2.a bzip2 bzip2recover \
++ rm -f *.o *.sho libbz2.a libbz2.so* bzip2 bzip2recover \
+ sample1.rb2 sample2.rb2 sample3.rb2 \
+ sample1.tst sample2.tst sample3.tst
+
+-blocksort.o: blocksort.c
+- @cat words0
+- $(CC) $(CFLAGS) -c blocksort.c
+-huffman.o: huffman.c
+- $(CC) $(CFLAGS) -c huffman.c
+-crctable.o: crctable.c
+- $(CC) $(CFLAGS) -c crctable.c
+-randtable.o: randtable.c
+- $(CC) $(CFLAGS) -c randtable.c
+-compress.o: compress.c
+- $(CC) $(CFLAGS) -c compress.c
+-decompress.o: decompress.c
+- $(CC) $(CFLAGS) -c decompress.c
+-bzlib.o: bzlib.c
+- $(CC) $(CFLAGS) -c bzlib.c
+-bzip2.o: bzip2.c
+- $(CC) $(CFLAGS) -c bzip2.c
+-bzip2recover.o: bzip2recover.c
+- $(CC) $(CFLAGS) -c bzip2recover.c
+-
+
+ distclean: clean
+- rm -f manual.ps manual.html manual.pdf
++ #rm -f manual.ps manual.html manual.pdf
+
+ DISTNAME=bzip2-1.0.5
+ dist: check manual
+@@ -187,6 +194,8 @@ dist: check manual
+ $(DISTNAME)/bzdiff.1 \
+ $(DISTNAME)/bzmore \
+ $(DISTNAME)/bzmore.1 \
++ $(DISTNAME)/bzexe \
++ $(DISTNAME)/bzexe.1 \
+ $(DISTNAME)/bzgrep \
+ $(DISTNAME)/bzgrep.1 \
+ $(DISTNAME)/Makefile-libbz2_so \