use "cc -shared" to create shared libraries

This commit is contained in:
brad 2000-09-24 02:38:01 +00:00
parent 09dac822c0
commit 1aa85f4f1a
3 changed files with 15 additions and 25 deletions

View File

@ -1,9 +1,9 @@
# $OpenBSD: Makefile,v 1.17 2000/07/04 02:09:24 krw Exp $
# $OpenBSD: Makefile,v 1.18 2000/09/24 02:38:01 brad Exp $
# $FreeBSD: Makefile,v 1.5 1998/09/14 22:19:05 smace Exp $
DISTNAME= jbigkit-1.2
CATEGORIES= graphics
NEED_VERSION= 1.310
NEED_VERSION= 1.330
MASTER_SITES= ftp://ftp.informatik.uni-erlangen.de/local/cip/mskuhn/ISO/JBIG/ \
http://www.cl.cam.ac.uk/~mgk25/download/
@ -15,6 +15,7 @@ PERMIT_DISTFILES_CDROM= Yes
PERMIT_DISTFILES_FTP= Yes
MAKE_FLAGS= CC="${CC}" CCFLAGS="${CFLAGS} -Wall"
FAKE_FLAGS+= ${MAKE_FLAGS}
WRKDIST= ${WRKDIR}/jbigkit
@ -27,6 +28,6 @@ test: build
.include <bsd.port.mk>
.if defined(NO_SHARED_LIBS) && ${NO_SHARED_LIBS:U} == YES
.if defined(NO_SHARED_LIBS) && ${NO_SHARED_LIBS:L} == "yes"
MAKE_ENV= NO_SHARED_LIBS=Yes
.endif

View File

@ -1,20 +1,15 @@
--- Makefile.orig Sat Apr 8 07:19:41 2000
+++ Makefile Tue Jun 20 15:21:53 2000
@@ -16,7 +16,12 @@
+++ Makefile Sat Sep 23 22:23:53 2000
@@ -16,7 +16,7 @@
@echo "Enter 'make test' in order to start some automatic tests."
lib:
- (cd libjbig; make "CC=$(CC)" "CFLAGS=$(CFLAGS)")
+.if defined(NO_SHARED_LIBS) && ${NO_SHARED_LIBS:U} == YES
+ (cd libjbig; make "CC=$(CC)" "CFLAGS=$(CFLAGS)" "VERSION=$(VERSION)" "NO_SHARED_LIBS=Yes")
+.else
+ (cd libjbig; make "CC=$(CC)" "CFLAGS=$(CFLAGS)" "VERSION=$(VERSION)")
+.endif
+
pbm: lib
(cd pbmtools; make "CC=$(CC)" "CFLAGS=$(CFLAGS)")
@@ -45,3 +50,16 @@
@@ -45,3 +45,16 @@
scp ANNOUNCE \
$(DISTUID)@$(DISTHOST):$(DISTPATH)/jbigkit-$(VERSION)-announce.txt
mv ../jbigkit-$(VERSION).tar.gz $(HOME)/.www/download/
@ -29,5 +24,5 @@
+ ${BSD_INSTALL_DATA} libjbig/jbig.h ${PREFIX}/include
+ ${BSD_INSTALL_DATA} libjbig/libjbig.a ${PREFIX}/lib
+ @if [ -f libjbig/libjbig.so.$(VERSION) ]; then \
+ ${BSD_INSTALL_DATA} libjbig/libjbig.so.$(VERSION) ${PREFIX}/lib;\
+ ${BSD_INSTALL_DATA} libjbig/libjbig.so.$(VERSION) ${PREFIX}/lib; \
+ fi

View File

@ -1,11 +1,11 @@
--- libjbig/Makefile.orig Fri Apr 10 21:33:27 1998
+++ libjbig/Makefile Wed Mar 22 20:31:42 2000
@@ -7,21 +7,40 @@
--- libjbig/Makefile.orig Sat Apr 8 07:15:46 2000
+++ libjbig/Makefile Sat Sep 23 22:21:30 2000
@@ -7,16 +7,29 @@
# Options for the compiler: A high optimization level is suggested
CFLAGS = -O -Wall -ansi -pedantic
-all: libjbig.a tstcodec
+.if defined(NO_SHARED_LIBS) && ${NO_SHARED_LIBS:U} == YES
+.if defined(NO_SHARED_LIBS) && ${NO_SHARED_LIBS:L} == "yes"
+all: libjbig.a
+.else
+all: libjbig.a libjbig.so.$(VERSION)
@ -25,22 +25,16 @@
+
+libjbig.so.$(VERSION): jbig.so jbig_tab.so
+ rm -f ${.TARGET}
+ ld -Bshareable -Bforcearchive -o ${.TARGET} ${.ALLSRC}
+ ${CC} -shared -o ${.TARGET} ${.ALLSRC}
+
+.SUFFIXES: .c .o .so
+
+.c.o:
+ ${CC} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
+.SUFFIXES: .o .so
+
+.c.so:
+ ${CC} ${CFLAGS} -fpic -DPIC -c ${.IMPSRC} -o ${.TARGET}
jbig.o: jbig.c jbig.h
+jbig_tab.o: jbig_tab.c jbig.h
+jbig.so: jbig.c jbig.h
+jbig_tab.so: jbig_tab.c jbig.h
test: tstcodec
@@ -24,4 +37,4 @@
./tstcodec
clean: