- correct patch filename

- create a shared library
This commit is contained in:
brad 2000-09-27 14:48:57 +00:00
parent f47b90ef75
commit bdfc3985d4
5 changed files with 77 additions and 28 deletions

View File

@ -1,10 +1,10 @@
# $OpenBSD: Makefile,v 1.6 2000/09/27 14:48:57 brad Exp $
# $FreeBSD: Makefile,v 1.2 1999/08/31 02:09:14 peter Exp $
# $OpenBSD: Makefile,v 1.5 2000/09/12 15:37:35 brad Exp $
DISTNAME= expat
PKGNAME= expat-1.1
CATEGORIES= textproc
NEED_VERSION= 1.328
NEED_VERSION= 1.330
MASTER_SITES= ftp://ftp.jclark.com/pub/xml/ \
http://www.physik.TU-Berlin.DE/~ibex/ports/distfiles/
EXTRACT_SUFX= .zip
@ -18,13 +18,24 @@ PERMIT_PACKAGE_FTP= Yes
PERMIT_DISTFILES_CDROM= Yes
PERMIT_DISTFILES_FTP= Yes
MAKE_FLAGS= CC="${CC}" CFLAGS="${CFLAGS} -Ixmltok -Ixmlparse -DXML_NS"
SHLIB= libexpat.so.1.0
SUBST_VARS= SHLIB
MAKE_FLAGS= CC="${CC}" CFLAGS="${CFLAGS} -Ixmltok -Ixmlparse -DXML_NS" \
SHLIB="$(SHLIB)"
do-install:
${INSTALL_DATA_DIR} ${PREFIX}/include/xml
${INSTALL_PROGRAM} ${WRKSRC}/xmlwf/xmlwf ${PREFIX}/bin
${INSTALL_PROGRAM} ${WRKBUILD}/xmlwf/xmlwf ${PREFIX}/bin
${INSTALL_DATA} ${WRKSRC}/xmlparse/xmlparse.h ${PREFIX}/include/xml
${INSTALL_DATA} ${WRKSRC}/xmltok/xmltok.h ${PREFIX}/include/xml
${INSTALL_DATA} ${WRKSRC}/libexpat.a ${PREFIX}/lib
${INSTALL_DATA} ${WRKBUILD}/libexpat.a ${PREFIX}/lib
@if [ ${WRKBUILD}/${SHLIB} ]; then \
${INSTALL_DATA} ${WRKBUILD}/${SHLIB} ${PREFIX}/lib; \
fi
.include <bsd.port.mk>
.if defined(NO_SHARED_LIBS) && ${NO_SHARED_LIBS:L} == "yes"
MAKE_ENV= NO_SHARED_LIBS= Yes
.endif

View File

@ -0,0 +1,56 @@
--- Makefile.orig Mon Mar 8 08:20:38 1999
+++ Makefile Wed Sep 27 10:23:50 2000
@@ -10,21 +10,26 @@
#FILEMAP_OBJ=xmlwf/readfilemap.o
OBJS=xmltok/xmltok.o \
xmltok/xmlrole.o \
- xmlwf/xmlwf.o \
- xmlwf/xmlfile.o \
- xmlwf/codepage.o \
xmlparse/xmlparse.o \
xmlparse/hashtable.o \
$(FILEMAP_OBJ)
+SHOBJS=$(OBJS:.o=.so)
+XOBJS=xmlwf/xmlwf.o \
+ xmlwf/xmlfile.o \
+ xmlwf/codepage.o
EXE=
-all: xmlwf/xmlwf$(EXE)
-
-xmlwf/xmlwf$(EXE): $(OBJS)
- $(CC) $(CFLAGS) -o $@ $(OBJS)
+.if defined(NO_SHARED_LIBS) && ${NO_SHARED_LIBS:L} == "yes"
+all: xmlwf/xmlwf$(EXE) libexpat.a
+xmlwf/xmlwf$(EXE): $(XOBJS) libexpat.a
+.else
+all: xmlwf/xmlwf$(EXE) libexpat.a $(SHLIB)
+xmlwf/xmlwf$(EXE): $(XOBJS) libexpat.a $(SHLIB)
+.endif
+ $(CC) $(CFLAGS) -o $@ $(XOBJS) -L. -lexpat
clean:
- rm -f $(OBJS) xmlwf/xmlwf$(EXE)
+ rm -f $(OBJS) $(SHOBJS) $(XOBJS) xmlwf/xmlwf$(EXE)
xmltok/nametab.h: gennmtab/gennmtab$(EXE)
rm -f $@
@@ -35,5 +40,18 @@
xmltok/xmltok.o: xmltok/nametab.h
+libexpat.a: $(OBJS)
+ ar -rc $@ $(OBJS)
+ ranlib $@
+
+$(SHLIB): $(SHOBJS)
+ $(CC) -shared -o $(SHLIB) $(SHOBJS)
+
+.SUFFIXES: .o .so
+
.c.o:
$(CC) $(CFLAGS) -c -o $@ $<
+
+.c.so:
+ $(CC) $(CFLAGS) -fpic -DPIC -c -o $@ $<
+

View File

@ -1,22 +0,0 @@
--- Makefile.orig Mon Mar 8 08:20:38 1999
+++ Makefile Sun Jul 16 04:26:32 2000
@@ -18,7 +18,7 @@
$(FILEMAP_OBJ)
EXE=
-all: xmlwf/xmlwf$(EXE)
+all: xmlwf/xmlwf$(EXE) libexpat.a
xmlwf/xmlwf$(EXE): $(OBJS)
$(CC) $(CFLAGS) -o $@ $(OBJS)
@@ -34,6 +34,10 @@
$(CC) $(CFLAGS) -o $@ gennmtab/gennmtab.c
xmltok/xmltok.o: xmltok/nametab.h
+
+libexpat.a: $(OBJS)
+ ar -rc $@ $(OBJS)
+ ranlib $@
.c.o:
$(CC) $(CFLAGS) -c -o $@ $<

View File

@ -0,0 +1,3 @@
@comment $OpenBSD: PFRAG.shared,v 1.1 2000/09/27 14:49:59 brad Exp $
lib/${SHLIB}
DYNLIBDIR(%B)

View File

@ -1,6 +1,7 @@
@comment $OpenBSD: PLIST,v 1.2 2000/07/16 08:46:20 brad Exp $
@comment $OpenBSD: PLIST,v 1.3 2000/09/27 14:48:57 brad Exp $
bin/xmlwf
include/xml/xmlparse.h
include/xml/xmltok.h
lib/libexpat.a
%%SHARED%%
@dirrm include/xml