Use known SRCTOP if possible to determine SYSDIR.

Suggested by:	sjg
Sponsored by:	Dell EMC
This commit is contained in:
bdrewery 2018-04-12 20:48:17 +00:00
parent eda1e69e06
commit 913eb46519
3 changed files with 6 additions and 3 deletions

View File

@ -3,7 +3,8 @@
# Search for kernel source tree in standard places.
.if empty(KERNBUILDDIR)
.if !defined(SYSDIR)
.for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. ${.CURDIR}/../../../.. \
.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}

View File

@ -3,7 +3,8 @@
# Search for kernel source tree in standard places.
.if empty(KERNBUILDDIR)
.if !defined(SYSDIR)
.for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. ${.CURDIR}/../../../.. \
.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}

View File

@ -83,7 +83,8 @@ OBJCOPY?= objcopy
# Search for kernel source tree in standard places.
.if empty(KERNBUILDDIR)
.if !defined(SYSDIR)
.for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. /sys /usr/src/sys
.for _dir in ${SRCTOP:D${SRCTOP}/sys} \
${.CURDIR}/../.. ${.CURDIR}/../../.. /sys /usr/src/sys
.if !defined(SYSDIR) && exists(${_dir}/kern/)
SYSDIR= ${_dir:tA}
.endif