- make a libbz2 shared lib

This commit is contained in:
brad 1999-05-09 01:40:06 +00:00
parent 0e6c6b9e8f
commit 51b1591bff
5 changed files with 117 additions and 7 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.9 1999/04/20 00:13:48 brad Exp $
# $OpenBSD: Makefile,v 1.10 1999/05/09 01:40:06 brad Exp $
DISTNAME= bzip2-0.9.0c
PKGNAME= bzip2-0.9.0c
@ -9,7 +9,15 @@ MAINTAINER= angelos@openbsd.org
MASTER_SITES= http://www.digistar.com/bzip2/ \
http://www.muraroa.demon.co.uk/
USE_GMAKE= yes
VER=0.9
MAKE_ENV= VER=${VER}
# post-patch must be defined before bsd.port.mk is included so it will
# be called. However, we need to have the body of the target after
# bsd.port.mk is included so NO_SHARED_LIBS is defined.
# Define the target twice, using :
post-patch:
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/bzip2 ${PREFIX}/bin
@ -18,9 +26,21 @@ do-install:
${INSTALL_PROGRAM} ${WRKSRC}/bzip2recover ${PREFIX}/bin
${INSTALL_DATA} ${WRKSRC}/bzlib.h ${PREFIX}/include
${INSTALL_DATA} ${WRKSRC}/libbz2.a ${PREFIX}/lib
@if [ -f ${WRKSRC}/libbz2.so.${VER} ]; then \
${INSTALL_DATA} ${WRKSRC}/libbz2.so.${VER} ${PREFIX}/lib; \
fi
${INSTALL_MAN} ${WRKSRC}/bzip2.1 ${PREFIX}/man/man1
ln -f ${PREFIX}/man/man1/bzip2.1 ${PREFIX}/man/man1/bunzip2.1
ln -f ${PREFIX}/man/man1/bzip2.1 ${PREFIX}/man/man1/bzcat.1
ln -f ${PREFIX}/man/man1/bzip2.1 ${PREFIX}/man/man1/bzip2recover.1
${LDCONFIG} -m ${PREFIX}/lib
.include <bsd.port.mk>
# The patches assumed shared libs would be build. If building
# on a host that does not support shared libs, e.g. the alpha,
# apply one more patch.
post-patch:
.if defined(NO_SHARED_LIBS)
@(cd ${DISTDIR}; ${PATCH} ${PATCH_DIST_ARGS} < ${FILESDIR}/patch)
.endif

View File

@ -0,0 +1,42 @@
--- Makefile.orig2 Sat May 8 21:26:10 1999
+++ Makefile Sat May 8 21:27:11 1999
@@ -10,11 +10,9 @@
decompress.o \
bzlib.o
-.SUFFIXES: .c .so .o
+all: lib bzip2
-all: lib lib.so.${VER} bzip2
-
-bzip2: lib lib.so.${VER}
+bzip2: lib
$(CC) $(CFLAGS) -c bzip2.c
$(CC) $(CFLAGS) -o bzip2 bzip2.o -L. -lbz2
$(CC) $(CFLAGS) -o bzip2recover bzip2recover.c
@@ -24,10 +22,6 @@
ar clq libbz2.a $(OBJS)
ranlib libbz2.a
-lib.so.${VER}: $(OBJS:S/o$/so/g)
- rm -f libbz2.so.${VER}
- ld -Bshareable -o libbz2.so.${VER} $(OBJS:S/o$/so/g)
-
test: bzip2
@cat words1
./bzip2 -1 < sample1.ref > sample1.rb2
@@ -42,13 +36,10 @@
@cat words3
clean:
- rm -f *.o *.so libbz2.a libbz2.so.${VER} bzip2 bzip2recover sample1.rb2 sample2.rb2 sample1.tst sample2.tst
+ rm -f *.o libbz2.a bzip2 bzip2recover sample1.rb2 sample2.rb2 sample1.tst sample2.tst
.c.o: bzlib.h bzlib_private.h
$(CC) $(CFLAGS) -c $*.c -o $*.o
-
-.c.so:
- $(CC) -fPIC -DPIC $(CFLAGS) -c $*.c -o $*.so
tarfile:
tar cvf interim.tar *.c *.h Makefile manual.texi manual.ps LICENSE bzip2.1 bzip2.1.preformatted bzip2.txt words1 words2 words3 sample1.ref sample2.ref sample1.bz2 sample2.bz2 *.html README CHANGES libbz2.def libbz2.dsp dlltest.dsp

View File

@ -1,19 +1,55 @@
--- Makefile.orig Thu Oct 22 21:27:22 1998
+++ Makefile Wed Oct 28 10:25:29 1998
@@ -20,6 +20,7 @@
--- Makefile.orig Thu Oct 22 15:27:22 1998
+++ Makefile Sat May 8 21:10:38 1999
@@ -1,6 +1,6 @@
-CC=gcc
-CFLAGS=-Wall -O2 -fomit-frame-pointer -fno-strength-reduce
+#CC=gcc
+CFLAGS+=-Wall -fomit-frame-pointer -fno-strength-reduce
OBJS= blocksort.o \
huffman.o \
@@ -10,9 +10,11 @@
decompress.o \
bzlib.o
-all: lib bzip2 test
+.SUFFIXES: .c .so .o
-bzip2: lib
+all: lib lib.so.${VER} bzip2
+
+bzip2: lib lib.so.${VER}
$(CC) $(CFLAGS) -c bzip2.c
$(CC) $(CFLAGS) -o bzip2 bzip2.o -L. -lbz2
$(CC) $(CFLAGS) -o bzip2recover bzip2recover.c
@@ -20,6 +22,11 @@
lib: $(OBJS)
rm -f libbz2.a
ar clq libbz2.a $(OBJS)
+ ranlib libbz2.a
+
+lib.so.${VER}: $(OBJS:S/o$/so/g)
+ rm -f libbz2.so.${VER}
+ ld -Bshareable -o libbz2.so.${VER} $(OBJS:S/o$/so/g)
test: bzip2
@cat words1
@@ -38,7 +39,7 @@
@@ -34,12 +41,14 @@
cmp sample2.tst sample2.ref
@cat words3
-
clean:
rm -f *.o libbz2.a bzip2 bzip2recover sample1.rb2 sample2.rb2 sample1.tst sample2.tst
- rm -f *.o libbz2.a bzip2 bzip2recover sample1.rb2 sample2.rb2 sample1.tst sample2.tst
+ rm -f *.o *.so libbz2.a libbz2.so.${VER} bzip2 bzip2recover sample1.rb2 sample2.rb2 sample1.tst sample2.tst
-.c.o: $*.o bzlib.h bzlib_private.h
+.c.o: bzlib.h bzlib_private.h
$(CC) $(CFLAGS) -c $*.c -o $*.o
+
+.c.so:
+ $(CC) -fPIC -DPIC $(CFLAGS) -c $*.c -o $*.so
tarfile:
tar cvf interim.tar *.c *.h Makefile manual.texi manual.ps LICENSE bzip2.1 bzip2.1.preformatted bzip2.txt words1 words2 words3 sample1.ref sample2.ref sample1.bz2 sample2.bz2 *.html README CHANGES libbz2.def libbz2.dsp dlltest.dsp

View File

@ -4,6 +4,8 @@ bin/bzip2recover
bin/bzcat
include/bzlib.h
lib/libbz2.a
lib/libbz2.so.0.9
@exec /sbin/ldconfig -m %B
man/man1/bzip2.1
man/man1/bunzip2.1
man/man1/bzip2recover.1

View File

@ -0,0 +1,10 @@
bin/bzip2
bin/bunzip2
bin/bzip2recover
bin/bzcat
include/bzlib.h
lib/libbz2.a
man/man1/bzip2.1
man/man1/bunzip2.1
man/man1/bzip2recover.1
man/man1/bzcat.1