Author: bdrewery
Date: Thu Apr 12 20:27:57 2018
New Revision: 332453
URL: https://svnweb.freebsd.org/changeset/base/332453

Log:
  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

Modified:
  head/share/mk/bsd.dtb.mk
  head/share/mk/bsd.kmod.mk
  head/sys/conf/kmod.mk

Modified: head/share/mk/bsd.dtb.mk
==============================================================================
--- head/share/mk/bsd.dtb.mk    Thu Apr 12 20:21:04 2018        (r332452)
+++ head/share/mk/bsd.dtb.mk    Thu Apr 12 20:27:57 2018        (r332453)
@@ -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

Modified: head/share/mk/bsd.kmod.mk
==============================================================================
--- head/share/mk/bsd.kmod.mk   Thu Apr 12 20:21:04 2018        (r332452)
+++ head/share/mk/bsd.kmod.mk   Thu Apr 12 20:27:57 2018        (r332453)
@@ -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

Modified: head/sys/conf/kmod.mk
==============================================================================
--- head/sys/conf/kmod.mk       Thu Apr 12 20:21:04 2018        (r332452)
+++ head/sys/conf/kmod.mk       Thu Apr 12 20:27:57 2018        (r332453)
@@ -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
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to