On Wed, Oct 05, 2016 at 01:40:10AM +0200, Jan Klemkow wrote:
> Hi,
> 
> This diff adds a shared library build target to this port.  The upstream
> makefile builds only a static library.  I tested this diff with
> portcheck tools and build shared and static linked programs with this
> this library.
> 
> Bye,
> Jan

Simplify the diff and don't undo the 'honour CC/CFLAGS' change.

Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/libowfat/Makefile,v
retrieving revision 1.4
diff -u -p -r1.4 Makefile
--- Makefile    28 Sep 2015 16:52:49 -0000      1.4
+++ Makefile    4 Oct 2016 23:59:45 -0000
@@ -1,10 +1,13 @@
 # $OpenBSD: Makefile,v 1.4 2015/09/28 16:52:49 jca Exp $
 
 COMMENT =      library of general purpose APIs
-BROKEN-hppa=   missing atomic ops
+BROKEN-hppa =  missing atomic ops
+
+SO_VERSION =   0.0
+SHARED_LIBS += owfat ${SO_VERSION}
 
 DISTNAME =     libowfat-0.30
-REVISION =     0
+REVISION =     1
 CATEGORIES =   devel
 
 MAINTAINER =   Jan Klemkow <j.klem...@wemelug.de>
@@ -15,7 +18,8 @@ EXTRACT_SUFX =        .tar.xz
 USE_GMAKE =    Yes
 MAKE_FILE =    GNUmakefile
 
-MAKE_FLAGS =   CC="${CC}" COPTFLAGS="${CFLAGS}"
+MAKE_FLAGS =   CC="${CC}" COPTFLAGS="-fpic ${CFLAGS}" \
+               SO_VERSION="${SO_VERSION}"
 FAKE_FLAGS =   prefix=${DESTDIR}${PREFIX} \
                INCLUDEDIR=${DESTDIR}${PREFIX}/include/lowfat \
                MAN3DIR=${DESTDIR}${PREFIX}/share/lowfat/man
Index: patches/patch-GNUmakefile
===================================================================
RCS file: /cvs/ports/devel/libowfat/patches/patch-GNUmakefile,v
retrieving revision 1.3
diff -u -p -r1.3 patch-GNUmakefile
--- patches/patch-GNUmakefile   28 Sep 2015 16:52:49 -0000      1.3
+++ patches/patch-GNUmakefile   5 Oct 2016 00:03:57 -0000
@@ -1,7 +1,13 @@
 $OpenBSD: patch-GNUmakefile,v 1.3 2015/09/28 16:52:49 jca Exp $
---- GNUmakefile.orig   Sat Sep 19 00:13:11 2015
-+++ GNUmakefile        Sat Sep 19 00:23:26 2015
-@@ -18,8 +18,9 @@ all: ent $(LIBS) libowfat.a libsocket t
+--- GNUmakefile.orig   Fri Apr 10 22:54:57 2015
++++ GNUmakefile        Wed Oct  5 02:03:52 2016
+@@ -13,13 +13,14 @@ LIBS=byte.a fmt.a scan.a str.a uint.a open.a stralloc.
+ buffer.a mmap.a taia.a tai.a dns.a case.a mult.a array.a io.a \
+ textcode.a cdb.a critbit.a
+ 
+-all: ent $(LIBS) libowfat.a libsocket t
++all: ent $(LIBS) libowfat.a libowfat.so.$(SO_VERSION) libsocket t
+ 
  CROSS=
  #CROSS=i686-mingw-
  CC=$(CROSS)gcc
@@ -12,7 +18,25 @@ $OpenBSD: patch-GNUmakefile,v 1.3 2015/0
  
  ent: ent.c haveuint128.h
        gcc -g -o ent ent.c -I.
-@@ -317,7 +318,7 @@ dns_nd6.o fmt_xlong.o scan_xlong.o fmt_ip6_flat.o $(TE
+@@ -147,6 +148,9 @@ libowfat.a: $(ALL_OBJS)
+       $(CROSS)ar cru $@ $(ALL_OBJS)
+       -$(CROSS)ranlib $@
+ 
++libowfat.so.$(SO_VERSION): $(ALL_OBJS)
++      gcc -shared -fpic -o $@ $(ALL_OBJS)
++
+ CFLAGS+=-I.
+ 
+ %.o: %.c
+@@ -185,6 +189,7 @@ install-inc:
+ install-lib: libowfat.a
+       install -d $(LIBDIR)
+       install -m 644 libowfat.a $(LIBDIR)
++      install -m 644 libowfat.so.$(SO_VERSION) $(LIBDIR)
+ 
+ install-man:
+       install -d $(MAN3DIR)
+@@ -317,7 +322,7 @@ dns_nd6.o fmt_xlong.o scan_xlong.o fmt_ip6_flat.o $(TE
  iob_send.o scan_ip6if.o: havealloca.h
  
  dep: haveip6.h haven2i.h havesl.h haveinline.h iopause.h select.h haveepoll.h 
havekqueue.h havedevpoll.h havescope.h havesigio.h havebsdsf.h havesendfile.h 
havealloca.h haveuint128.h
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/devel/libowfat/pkg/PLIST,v
retrieving revision 1.2
diff -u -p -r1.2 PLIST
--- pkg/PLIST   28 Sep 2015 16:52:49 -0000      1.2
+++ pkg/PLIST   4 Oct 2016 21:35:16 -0000
@@ -38,6 +38,7 @@ include/lowfat/uint32.h
 include/lowfat/uint64.h
 include/lowfat/va_narg.h
 lib/libowfat.a
+@lib lib/libowfat.so.${LIBowfat_VERSION}
 share/lowfat/
 @mandir share/lowfat/man/
 share/lowfat/man/array.3

Reply via email to