Fix using wrong SYSDIR after r331683.

This was inadvertently overriding the first found SYSDIR with the last
of /usr/src which could result in the wrong headers being used if not
building from /usr/src.

SYSDIR?= is not used here to avoid evaluating the exists() when unneeded.

Reported by:	rgrimes, sjg, Mark Millard
Pointyhat to:	bdrewery
Sponsored by:	Dell EMC
This commit is contained in:
Bryan Drewery 2018-04-12 20:27:57 +00:00
parent e979979acf
commit 711c77093c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=332453
3 changed files with 3 additions and 3 deletions

View file

@ -5,7 +5,7 @@
.if !defined(SYSDIR)
.for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. ${.CURDIR}/../../../.. \
${.CURDIR}/../../../../.. /sys /usr/src/sys
.if exists(${_dir}/kern/) && exists(${_dir}/conf/kmod.mk)
.if !defined(SYSDIR) && exists(${_dir}/kern/) && exists(${_dir}/conf/kmod.mk)
SYSDIR= ${_dir}
.endif
.endfor

View file

@ -5,7 +5,7 @@
.if !defined(SYSDIR)
.for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. ${.CURDIR}/../../../.. \
${.CURDIR}/../../../../.. /sys /usr/src/sys
.if exists(${_dir}/kern/) && exists(${_dir}/conf/kmod.mk)
.if !defined(SYSDIR) && exists(${_dir}/kern/) && exists(${_dir}/conf/kmod.mk)
SYSDIR= ${_dir:tA}
.endif
.endfor

View file

@ -84,7 +84,7 @@ OBJCOPY?= objcopy
.if empty(KERNBUILDDIR)
.if !defined(SYSDIR)
.for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. /sys /usr/src/sys
.if exists(${_dir}/kern/)
.if !defined(SYSDIR) && exists(${_dir}/kern/)
SYSDIR= ${_dir:tA}
.endif
.endfor