Fix build on MirBSD.

Remove all "#define _XOPEN_SOURCE" lines, as they break things horribly on
MirBSD for some reason. Sprinkle a few <sys/types.h> includes. Add support for
generating shared libraries on MirBSD.
This commit is contained in:
bsiegert 2013-12-01 23:25:31 +00:00
parent c9d9a88c72
commit 312e8a5a62
4 changed files with 55 additions and 8 deletions

View file

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.34 2013/11/14 08:01:11 adam Exp $
# $NetBSD: Makefile,v 1.35 2013/12/01 23:25:31 bsiegert Exp $
DISTNAME= xmlrpc-c-1.25.26
# the "super stable" branch
@ -36,7 +36,25 @@ SUBST_FILES.pthread= xmlrpc-c-config.* xmlrpc-c-config.test.*
SUBST_SED.pthread= -e 's/-lpthread/${PTHREAD_LINKFLAGS:Q}/'
SUBST_SED.pthread+= -e 's/-L\(.\)libdir/-L\1libdir ${COMPILER_RPATH_FLAG}\1libdir/'
.include "../../mk/bsd.prefs.mk"
.if ${OPSYS} == "MirBSD"
SUBST_CLASSES+= xopen
SUBST_STAGE.xopen= pre-configure
SUBST_MESSAGE.xopen= Removing _XOPEN_SOURCE lines.
SUBST_FILES.xopen+= lib/abyss/src/data.c lib/abyss/src/response.c lib/abyss/src/conf.c
SUBST_FILES.xopen+= lib/abyss/src/http.c lib/abyss/src/server.c lib/abyss/src/handler.c
SUBST_FILES.xopen+= lib/curl_transport/curltransaction.c lib/curl_transport/curlmulti.c
SUBST_FILES.xopen+= lib/curl_transport/xmlrpc_curl_transport.c lib/libutil/select.c
SUBST_FILES.xopen+= lib/libutil/error.c lib/libutil/make_printable.c lib/libutil/asprintf.c
SUBST_FILES.xopen+= lib/util/cmdline_parser.c lib/expat/xmlwf/xmlfile.c src/xmlrpc_datetime.c
SUBST_FILES.xopen+= src/method.c src/xmlrpc_parse.c src/test/value_datetime.c src/xmlrpc_client.c
SUBST_FILES.xopen+= src/xmlrpc_server_info.c src/xmlrpc_server_abyss.c tools/lib/dumpvalue.c
SUBST_FILES.xopen+= tools/xmlrpc/xmlrpc.c tools/xmlrpc_transport/xmlrpc_transport.c
SUBST_SED.xopen= -e '/^\#define _XOPEN_SOURCE/d'
.endif
LDFLAGS.OpenBSD+= ${PTHREAD_LINKFLAGS}
LDFLAGS.MirBSD+= ${PTHREAD_LINKFLAGS}
.include "../../www/curl/buildlink3.mk"
.include "../../www/libwww/buildlink3.mk"

View file

@ -1,4 +1,4 @@
$NetBSD: distinfo,v 1.30 2013/11/14 08:01:11 adam Exp $
$NetBSD: distinfo,v 1.31 2013/12/01 23:25:31 bsiegert Exp $
SHA1 (xmlrpc-c-1.25.26.tgz) = 62b8b7b76b2937b2f3d51be045cbf17476302d39
RMD160 (xmlrpc-c-1.25.26.tgz) = 86096117f8e26321c38539eff83cdf0f64055e47
@ -9,4 +9,5 @@ SHA1 (patch-ae) = 52f826d292869be44886881c48aa7707a4af2df3
SHA1 (patch-ai) = 8d7ddc541779129de1e03a3cee81505ffbfb4171
SHA1 (patch-aj) = e65acd3d49be3486f70cda935a8b2aae3f8af3e8
SHA1 (patch-ak) = 4525977b51a25f115c1266dccf0e2cc754dc80d3
SHA1 (patch-config.mk.in) = ddb63b60b40fb739700e3808336199f848c25904
SHA1 (patch-config.mk.in) = e3eef60ab28b92d1e903ac84997617dfafe1689c
SHA1 (patch-src_cpp_server_pstream.cpp) = 2a6b2f30ab5f9df1953f874ede41b91bd60a005a

View file

@ -1,9 +1,11 @@
$NetBSD: patch-config.mk.in,v 1.3 2013/09/12 18:52:54 adam Exp $
$NetBSD: patch-config.mk.in,v 1.4 2013/12/01 23:25:31 bsiegert Exp $
Do not use -Bdynamic -G when using GCC on Solaris, it creates non-PIC
libraries.
--- config.mk.in.orig 2013-03-29 06:38:36.000000000 +0000
Support for shared libraries on OpenBSD and MirBSD.
--- config.mk.in.orig Fri Mar 29 06:38:11 2013
+++ config.mk.in
@@ -193,10 +193,15 @@ ifeq ($(patsubst solaris%,solaris,$(HOST
# linker, it's even more complicated: we need an rpath option of the
@ -25,10 +27,21 @@ libraries.
NEED_RPATH=yes
endif
@@ -242,6 +247,18 @@ ifeq ($(patsubst netbsd%,netbsd,$(HOST_O
NEED_WL_RPATH=yes
@@ -231,6 +236,30 @@ ifeq ($(patsubst osf%,osf,$(HOST_OS)),os
endif
ifeq ($(patsubst netbsd%,netbsd,$(HOST_OS)),netbsd)
+ SHARED_LIB_TYPE = unix
+ SHLIB_SUFFIX = so
+ MUST_BUILD_SHLIB = Y
+ MUST_BUILD_SHLIBLE = Y
+ shlibfn = $(1:%=%.$(SHLIB_SUFFIX).$(MAJ).$(MIN))
+ shliblefn = $(1:%=%.$(SHLIB_SUFFIX))
+ CFLAGS_SHLIB = -fpic
+ LDFLAGS_SHLIB = -shared -Wl,-soname,$(SONAME) $(SHLIB_CLIB)
+ NEED_WL_RPATH=yes
+endif
+
+ifeq ($(patsubst openbsd%,openbsd,$(HOST_OS)),openbsd)
+ SHARED_LIB_TYPE = unix
+ SHLIB_SUFFIX = so
@ -41,6 +54,7 @@ libraries.
+ NEED_WL_RPATH=yes
+endif
+
ifeq ($(patsubst freebsd%,freebsd,$(HOST_OS)),freebsd)
+ifeq ($(patsubst mirbsd%,mirbsd,$(HOST_OS)),mirbsd)
SHARED_LIB_TYPE = unix
SHLIB_SUFFIX = so
MUST_BUILD_SHLIB = Y

View file

@ -0,0 +1,14 @@
$NetBSD: patch-src_cpp_server_pstream.cpp,v 1.1 2013/12/01 23:25:31 bsiegert Exp $
Socket functions need sys/types.h on MirBSD.
--- src/cpp/server_pstream.cpp.orig Thu Sep 19 12:47:06 2013
+++ src/cpp/server_pstream.cpp
@@ -22,6 +22,7 @@
#include <winsock.h>
typedef int socklen_t;
#else
+#include <sys/types.h>
#include <sys/socket.h>
#endif
#include <errno.h>