aboutsummaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorKyle Evans <kevans@FreeBSD.org>2020-01-25 05:17:44 +0000
committerKyle Evans <kevans@FreeBSD.org>2020-01-25 05:17:44 +0000
commitae1e9493abbe9029862ad79cd835bfc586b57e1d (patch)
tree034ebc9fe134275a8aa6baaf6908a78cfe2afbc5 /share
parent83b70cfa35f13f69f7d74e9796978206b9e29f22 (diff)
MFC r354968, r354976: Introduce, but do not use, bsd.sysdir.mk
[Some sysent bits use bsd.sysdir.mk now, but I don't see a point in converting existing stuff] MFC r354968: Introduce bsd.sysdir.mk to consolidate looking for the kernel. MFC r354976: Install bsd.sysdir.mk
Notes
svn path=/stable/11/; revision=357107
Diffstat (limited to 'share')
-rw-r--r--share/mk/Makefile1
-rw-r--r--share/mk/bsd.sysdir.mk16
2 files changed, 17 insertions, 0 deletions
diff --git a/share/mk/Makefile b/share/mk/Makefile
index 9b4eec8511bf..ebe59daa2757 100644
--- a/share/mk/Makefile
+++ b/share/mk/Makefile
@@ -52,6 +52,7 @@ FILES= \
bsd.subdir.mk \
bsd.symver.mk \
bsd.sys.mk \
+ bsd.sysdir.mk \
bsd.test.mk \
dirdeps.mk \
gendirdeps.mk \
diff --git a/share/mk/bsd.sysdir.mk b/share/mk/bsd.sysdir.mk
new file mode 100644
index 000000000000..665905e1d537
--- /dev/null
+++ b/share/mk/bsd.sysdir.mk
@@ -0,0 +1,16 @@
+# $FreeBSD$
+
+# Search for kernel source tree in standard places.
+.if !defined(SYSDIR)
+.for _dir in ${SRCTOP:D${SRCTOP}/sys} \
+ ${.CURDIR}/../.. ${.CURDIR}/../../.. ${.CURDIR}/../../../.. \
+ ${.CURDIR}/../../../../.. /sys /usr/src/sys
+.if !defined(SYSDIR) && exists(${_dir}/kern/) && exists(${_dir}/conf/kmod.mk)
+SYSDIR= ${_dir:tA}
+.endif
+.endfor
+.endif
+.if !defined(SYSDIR) || !exists(${SYSDIR}/kern/) || \
+ !exists(${SYSDIR}/conf/kmod.mk)
+.error Unable to locate the kernel source tree. Set SYSDIR to override.
+.endif