Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tools/libprop Fix building libprop as a host tool library on...
details: https://anonhg.NetBSD.org/src/rev/6322b8a8c2fe
branches: trunk
changeset: 998915:6322b8a8c2fe
user: thorpej <thorpej%NetBSD.org@localhost>
date: Wed May 08 02:25:50 2019 +0000
description:
Fix building libprop as a host tool library on platforms that don't have
the Matt Thomas rbtree:
- Include rb.c in libnbcompat, and provide a nbcompat sys/rbtree.h
header.
- Make sure libprop's source file include prop_object_impl.h before
anything else, and pull in nbtool_config.h from there.
Tested by simulating such a host system by renaming the host's
<sys/rbtree.h> out of the way (which reproduced the build failure)
and verifying that the host-tool installboot contained the rb_*
functions in its own .text segment.
diffstat:
common/lib/libprop/prop_bool.c | 4 ++--
common/lib/libprop/prop_data.c | 4 ++--
common/lib/libprop/prop_number.c | 6 +++---
common/lib/libprop/prop_object_impl.h | 6 +++++-
common/lib/libprop/prop_stack.c | 4 ++--
common/lib/libprop/prop_string.c | 4 ++--
tools/compat/Makefile | 5 +++--
tools/compat/sys/rbtree.h | 4 ++++
tools/libprop/Makefile | 3 ++-
9 files changed, 25 insertions(+), 15 deletions(-)
diffs (168 lines):
diff -r 8bdf9e5ce8e5 -r 6322b8a8c2fe common/lib/libprop/prop_bool.c
--- a/common/lib/libprop/prop_bool.c Wed May 08 01:08:18 2019 +0000
+++ b/common/lib/libprop/prop_bool.c Wed May 08 02:25:50 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: prop_bool.c,v 1.17 2009/01/03 18:31:33 pooka Exp $ */
+/* $NetBSD: prop_bool.c,v 1.18 2019/05/08 02:25:50 thorpej Exp $ */
/*-
* Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -29,8 +29,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include "prop_object_impl.h"
#include <prop/prop_bool.h>
-#include "prop_object_impl.h"
struct _prop_bool {
struct _prop_object pb_obj;
diff -r 8bdf9e5ce8e5 -r 6322b8a8c2fe common/lib/libprop/prop_data.c
--- a/common/lib/libprop/prop_data.c Wed May 08 01:08:18 2019 +0000
+++ b/common/lib/libprop/prop_data.c Wed May 08 02:25:50 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: prop_data.c,v 1.14 2009/01/25 06:59:35 cyber Exp $ */
+/* $NetBSD: prop_data.c,v 1.15 2019/05/08 02:25:50 thorpej Exp $ */
/*-
* Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -29,8 +29,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include "prop_object_impl.h"
#include <prop/prop_data.h>
-#include "prop_object_impl.h"
#if defined(_KERNEL)
#include <sys/systm.h>
diff -r 8bdf9e5ce8e5 -r 6322b8a8c2fe common/lib/libprop/prop_number.c
--- a/common/lib/libprop/prop_number.c Wed May 08 01:08:18 2019 +0000
+++ b/common/lib/libprop/prop_number.c Wed May 08 02:25:50 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: prop_number.c,v 1.30 2016/06/28 06:47:35 pgoyette Exp $ */
+/* $NetBSD: prop_number.c,v 1.31 2019/05/08 02:25:50 thorpej Exp $ */
/*-
* Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -29,9 +29,9 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/rbtree.h>
+#include "prop_object_impl.h"
#include <prop/prop_number.h>
-#include "prop_object_impl.h"
+#include <sys/rbtree.h>
#if defined(_KERNEL)
#include <sys/systm.h>
diff -r 8bdf9e5ce8e5 -r 6322b8a8c2fe common/lib/libprop/prop_object_impl.h
--- a/common/lib/libprop/prop_object_impl.h Wed May 08 01:08:18 2019 +0000
+++ b/common/lib/libprop/prop_object_impl.h Wed May 08 02:25:50 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: prop_object_impl.h,v 1.32 2015/05/11 16:50:35 christos Exp $ */
+/* $NetBSD: prop_object_impl.h,v 1.33 2019/05/08 02:25:50 thorpej Exp $ */
/*-
* Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -32,6 +32,10 @@
#ifndef _PROPLIB_PROP_OBJECT_IMPL_H_
#define _PROPLIB_PROP_OBJECT_IMPL_H_
+#if defined(HAVE_NBTOOL_CONFIG_H)
+#include "nbtool_config.h"
+#endif
+
#if defined(_KERNEL) || defined(_STANDALONE)
#include <lib/libkern/libkern.h>
#else
diff -r 8bdf9e5ce8e5 -r 6322b8a8c2fe common/lib/libprop/prop_stack.c
--- a/common/lib/libprop/prop_stack.c Wed May 08 01:08:18 2019 +0000
+++ b/common/lib/libprop/prop_stack.c Wed May 08 02:25:50 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: prop_stack.c,v 1.2 2007/08/30 12:23:54 joerg Exp $ */
+/* $NetBSD: prop_stack.c,v 1.3 2019/05/08 02:25:50 thorpej Exp $ */
/*-
* Copyright (c) 2007 Joerg Sonnenberger <joerg%NetBSD.org@localhost>.
@@ -29,8 +29,8 @@
* SUCH DAMAGE.
*/
+#include "prop_object_impl.h"
#include "prop_stack.h"
-#include "prop_object_impl.h"
void
_prop_stack_init(prop_stack_t stack)
diff -r 8bdf9e5ce8e5 -r 6322b8a8c2fe common/lib/libprop/prop_string.c
--- a/common/lib/libprop/prop_string.c Wed May 08 01:08:18 2019 +0000
+++ b/common/lib/libprop/prop_string.c Wed May 08 02:25:50 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: prop_string.c,v 1.12 2014/03/26 18:12:46 christos Exp $ */
+/* $NetBSD: prop_string.c,v 1.13 2019/05/08 02:25:50 thorpej Exp $ */
/*-
* Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -29,8 +29,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include "prop_object_impl.h"
#include <prop/prop_string.h>
-#include "prop_object_impl.h"
struct _prop_string {
struct _prop_object ps_obj;
diff -r 8bdf9e5ce8e5 -r 6322b8a8c2fe tools/compat/Makefile
--- a/tools/compat/Makefile Wed May 08 01:08:18 2019 +0000
+++ b/tools/compat/Makefile Wed May 08 02:25:50 2019 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.86 2018/08/30 12:05:34 christos Exp $
+# $NetBSD: Makefile,v 1.87 2019/05/08 02:25:50 thorpej Exp $
HOSTLIB= nbcompat
@@ -13,7 +13,7 @@
mi_vector_hash.c mkdtemp.c \
mkstemp.c pread.c putc_unlocked.c pwcache.c pwrite.c \
pw_scan.c \
- raise_default_signal.c reallocarr.c rmd160.c rmd160hl.c \
+ raise_default_signal.c rb.c reallocarr.c rmd160.c rmd160hl.c \
regcomp.c regerror.c regexec.c regfree.c \
setenv.c setgroupent.c \
setpassent.c setprogname.c sha1.c sha1hl.c sha2.c \
@@ -54,6 +54,7 @@
${.CURDIR}/../../lib/libc/string \
${.CURDIR}/../../lib/libutil \
${.CURDIR}/../../common/lib/libc/cdb \
+ ${.CURDIR}/../../common/lib/libc/gen \
${.CURDIR}/../../common/lib/libc/string \
${.CURDIR}/../../common/lib/libc/hash/rmd160 \
${.CURDIR}/../../common/lib/libc/hash/sha1 \
diff -r 8bdf9e5ce8e5 -r 6322b8a8c2fe tools/compat/sys/rbtree.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/compat/sys/rbtree.h Wed May 08 02:25:50 2019 +0000
@@ -0,0 +1,4 @@
+/* $NetBSD: rbtree.h,v 1.1 2019/05/08 02:25:50 thorpej Exp $ */
+
+/* We unconditionally use the NetBSD rbtree(3) in libnbcompat. */
+#include "../../../sys/sys/rbtree.h"
diff -r 8bdf9e5ce8e5 -r 6322b8a8c2fe tools/libprop/Makefile
--- a/tools/libprop/Makefile Wed May 08 01:08:18 2019 +0000
+++ b/tools/libprop/Makefile Wed May 08 02:25:50 2019 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2019/05/07 04:29:45 thorpej Exp $
+# $NetBSD: Makefile,v 1.2 2019/05/08 02:25:50 thorpej Exp $
HOSTLIB= prop
@@ -10,6 +10,7 @@
.include "${LIBPROP_DIR}/Makefile.inc"
CPPFLAGS+= -I${.CURDIR}/../compat -I${LIBPROP_INC}
+CPPFLAGS+= -I${TOOLDIR}/include/compat
CPPFLAGS+= -I${TOOLDIR}/include/nbinclude
.PATH: ${LIBPROP_DIR}
Home |
Main Index |
Thread Index |
Old Index