diff options
| author | thorpej <thorpej@NetBSD.org> | 2019-05-08 02:25:50 +0000 |
|---|---|---|
| committer | thorpej <thorpej@NetBSD.org> | 2019-05-08 02:25:50 +0000 |
| commit | 1c3f2db6876c74927d7e82c29e3d51483e2eee1a (patch) | |
| tree | ffa70428896c3c1190a50824276d33665762e4b4 /tools | |
| parent | 9b29e7f086b1f8083b1dbcff638e111810a618a0 (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 'tools')
| -rw-r--r-- | tools/compat/Makefile | 5 | ||||
| -rw-r--r-- | tools/compat/sys/rbtree.h | 4 | ||||
| -rw-r--r-- | tools/libprop/Makefile | 3 |
3 files changed, 9 insertions, 3 deletions
diff --git a/tools/compat/Makefile b/tools/compat/Makefile index 8291a752838..b5adb8a5f2e 100644 --- a/tools/compat/Makefile +++ b/tools/compat/Makefile @@ -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 @@ SRCS= atoll.c basename.c cdbr.c cdbw.c dirname.c \ 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 @@ CPPFLAGS+= -I. -I./include -I${.CURDIR} -I${.CURDIR}/sys \ ${.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 --git a/tools/compat/sys/rbtree.h b/tools/compat/sys/rbtree.h new file mode 100644 index 00000000000..39e92cb9b3a --- /dev/null +++ b/tools/compat/sys/rbtree.h @@ -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 --git a/tools/libprop/Makefile b/tools/libprop/Makefile index d1f03ab4aa4..58694b58da6 100644 --- a/tools/libprop/Makefile +++ b/tools/libprop/Makefile @@ -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 @@ LIBPROP_INC= ${.CURDIR}/../../common/include .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} |
