From 914a5daa3faf6e4a84d1a55d129b9b206ab1eba4 Mon Sep 17 00:00:00 2001 From: brad Date: Mon, 26 Feb 2001 02:55:34 +0000 Subject: [PATCH] create a shared library for libnet --- net/libnet/Makefile | 6 +++- net/libnet/patches/patch-Makefile_in | 54 +++++++++++++++++++++++++--- net/libnet/pkg/PFRAG.shared | 3 ++ net/libnet/pkg/PLIST | 3 +- 4 files changed, 60 insertions(+), 6 deletions(-) create mode 100644 net/libnet/pkg/PFRAG.shared diff --git a/net/libnet/Makefile b/net/libnet/Makefile index 8240762c381..f2bb8c48cce 100644 --- a/net/libnet/Makefile +++ b/net/libnet/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.20 2001/02/26 02:47:41 brad Exp $ +# $OpenBSD: Makefile,v 1.21 2001/02/26 02:55:34 brad Exp $ DISTNAME= libnet-1.0.2a CATEGORIES= net @@ -19,3 +19,7 @@ CONFIGURE_STYLE= gnu WRKDIST= ${WRKDIR}/Libnet-1.0.2a .include + +.if defined(NO_SHARED_LIBS) && ${NO_SHARED_LIBS:L} == "yes" +MAKE_ENV= NO_SHARED_LIBS=Yes +.endif diff --git a/net/libnet/patches/patch-Makefile_in b/net/libnet/patches/patch-Makefile_in index 560bb1e8e7b..98f68365eee 100644 --- a/net/libnet/patches/patch-Makefile_in +++ b/net/libnet/patches/patch-Makefile_in @@ -1,6 +1,6 @@ ---- Makefile.in.orig Mon Feb 19 00:50:09 2001 -+++ Makefile.in Mon Feb 19 00:52:07 2001 -@@ -36,7 +36,7 @@ AR = @AR@ +--- Makefile.in.orig Mon Feb 5 12:51:41 2001 ++++ Makefile.in Sun Feb 25 05:21:28 2001 +@@ -36,7 +36,7 @@ LN = @LN@ CC = @CC@ ENSUREDIR = $(srcdir)/ensure-dir.sh @@ -9,7 +9,50 @@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ OBJECTS = src/libnet_resolve.o\ -@@ -98,18 +98,18 @@ install: libnet +@@ -66,17 +66,28 @@ + src/libnet_hex_dump.o\ + src/libnet_if_addr.o\ + src/libnet_port_list.o ++SHOBJECTS= $(OBJECTS:S/.o/.so/) ++ ++PICFLAG= -fpic ++SHLIB= $(LIBNET).so.0.0 ++ ++.SUFFIXES: .o .so + + .c.o: + $(CC) $(CFLAGS) $(CPPFLAGS) $(DEFINES) -c $< -o $@ + +-all: libnet ++.c.so: ++ $(CC) $(CFLAGS) $(CPPFLAGS) $(DEFINES) $(PICFLAG) -DPIC -c $< -o $@ ++ + supp: test example + + libnet: version.h $(OBJECTS) + $(AR) -cr $(LIB) $(OBJECTS) + $(RANLIB) $(LIB) + ++$(SHLIB): version.h $(SHOBJECTS) ++ $(CC) -shared $(PICFLAG) -o $(SHLIB) $(SHOBJECTS) ++ + version.o: version.h + version.h: ./VERSION + @rm -f $@ +@@ -91,25 +102,34 @@ + example: libnet install + cd example; make + ++.if defined(NO_SHARED_LIBS) && ${NO_SHARED_LIBS:L} == "yes" ++all: libnet + install: libnet ++.else ++all: libnet $(SHLIB) ++install: libnet $(SHLIB) ++.endif + $(ENSUREDIR) $(DESTDIR)$(prefix) 755 + $(ENSUREDIR) $(DESTDIR)$(LIB_PREFIX) 755 + $(ENSUREDIR) $(DESTDIR)$(INC_PREFIX)$(LIBNET) 755 $(ENSUREDIR) $(DESTDIR)$(INC_PREFIX) 755 $(ENSUREDIR) $(DESTDIR)$(MAN_PREFIX) 755 $(ENSUREDIR) $(DESTDIR)$(BIN_PREFIX) 755 @@ -26,6 +69,9 @@ - $(INSTALL_DATA) $(INCLUDE-O) $(DESTDIR)$(INC_PREFIX)$(LIBNET) - $(INSTALL_DATA) $(MAN) $(DESTDIR)$(MAN_PREFIX) - $(INSTALL_DATA) $(CONFIG) $(DESTDIR)$(BIN_PREFIX) ++ @if [ -f $(SHLIB) ]; then \ ++ $(INSTALL_DATA) -m 0644 $(SHLIB) $(DESTDIR)$(LIB_PREFIX) ;\ ++ fi + $(INSTALL_DATA) -m 0644 $(INCLUDE) $(DESTDIR)$(INC_PREFIX) + $(INSTALL_DATA) -m 0644 $(INCLUDE-H) $(DESTDIR)$(INC_PREFIX)$(LIBNET) + $(INSTALL_DATA) -m 0644 $(INCLUDE-F) $(DESTDIR)$(INC_PREFIX)$(LIBNET) diff --git a/net/libnet/pkg/PFRAG.shared b/net/libnet/pkg/PFRAG.shared new file mode 100644 index 00000000000..6e1836e379c --- /dev/null +++ b/net/libnet/pkg/PFRAG.shared @@ -0,0 +1,3 @@ +@comment $OpenBSD: PFRAG.shared,v 1.1 2001/02/26 02:55:35 brad Exp $ +lib/libnet.so.0.0 +DYNLIBDIR(%B) diff --git a/net/libnet/pkg/PLIST b/net/libnet/pkg/PLIST index 5073cf3453b..fc59559bf8a 100644 --- a/net/libnet/pkg/PLIST +++ b/net/libnet/pkg/PLIST @@ -1,6 +1,7 @@ -@comment $OpenBSD: PLIST,v 1.6 2000/06/25 00:32:59 brad Exp $ +@comment $OpenBSD: PLIST,v 1.7 2001/02/26 02:55:35 brad Exp $ bin/libnet-config lib/libnet.a +%%SHARED%% include/libnet.h include/libnet/libnet-asn1.h include/libnet/libnet-functions.h