summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorthorpej <thorpej@NetBSD.org>2019-05-08 02:25:50 +0000
committerthorpej <thorpej@NetBSD.org>2019-05-08 02:25:50 +0000
commit1c3f2db6876c74927d7e82c29e3d51483e2eee1a (patch)
treeffa70428896c3c1190a50824276d33665762e4b4 /common
parent9b29e7f086b1f8083b1dbcff638e111810a618a0 (diff)
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 (limited to 'common')
-rw-r--r--common/lib/libprop/prop_bool.c4
-rw-r--r--common/lib/libprop/prop_data.c4
-rw-r--r--common/lib/libprop/prop_number.c6
-rw-r--r--common/lib/libprop/prop_object_impl.h6
-rw-r--r--common/lib/libprop/prop_stack.c4
-rw-r--r--common/lib/libprop/prop_string.c4
6 files changed, 16 insertions, 12 deletions
diff --git a/common/lib/libprop/prop_bool.c b/common/lib/libprop/prop_bool.c
index d9e912b2cc4..63753424b4b 100644
--- a/common/lib/libprop/prop_bool.c
+++ b/common/lib/libprop/prop_bool.c
@@ -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/prop_bool.h>
#include "prop_object_impl.h"
+#include <prop/prop_bool.h>
struct _prop_bool {
struct _prop_object pb_obj;
diff --git a/common/lib/libprop/prop_data.c b/common/lib/libprop/prop_data.c
index 5ef9e35e307..cfcc43e0729 100644
--- a/common/lib/libprop/prop_data.c
+++ b/common/lib/libprop/prop_data.c
@@ -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/prop_data.h>
#include "prop_object_impl.h"
+#include <prop/prop_data.h>
#if defined(_KERNEL)
#include <sys/systm.h>
diff --git a/common/lib/libprop/prop_number.c b/common/lib/libprop/prop_number.c
index 0d636dd0cf5..5df04ae688f 100644
--- a/common/lib/libprop/prop_number.c
+++ b/common/lib/libprop/prop_number.c
@@ -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/prop_number.h>
#include "prop_object_impl.h"
+#include <prop/prop_number.h>
+#include <sys/rbtree.h>
#if defined(_KERNEL)
#include <sys/systm.h>
diff --git a/common/lib/libprop/prop_object_impl.h b/common/lib/libprop/prop_object_impl.h
index 6b1630be0e2..7ffdcbe3a74 100644
--- a/common/lib/libprop/prop_object_impl.h
+++ b/common/lib/libprop/prop_object_impl.h
@@ -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 --git a/common/lib/libprop/prop_stack.c b/common/lib/libprop/prop_stack.c
index a08118c2a44..473dec4a5b6 100644
--- a/common/lib/libprop/prop_stack.c
+++ b/common/lib/libprop/prop_stack.c
@@ -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>.
@@ -29,8 +29,8 @@
* SUCH DAMAGE.
*/
-#include "prop_stack.h"
#include "prop_object_impl.h"
+#include "prop_stack.h"
void
_prop_stack_init(prop_stack_t stack)
diff --git a/common/lib/libprop/prop_string.c b/common/lib/libprop/prop_string.c
index a53128c818a..6adad1a06aa 100644
--- a/common/lib/libprop/prop_string.c
+++ b/common/lib/libprop/prop_string.c
@@ -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/prop_string.h>
#include "prop_object_impl.h"
+#include <prop/prop_string.h>
struct _prop_string {
struct _prop_object ps_obj;