Date: Wed, 28 Mar 2018 16:28:24 +0000 (UTC) From: Bryan Drewery <bdrewery@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331683 - in head: share/mk sys/conf Message-ID: <201803281628.w2SGSOqN056705@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bdrewery Date: Wed Mar 28 16:28:24 2018 New Revision: 331683 URL: https://svnweb.freebsd.org/changeset/base/331683 Log: Avoid looping if SYSDIR already known. 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 Wed Mar 28 16:28:20 2018 (r331682) +++ head/share/mk/bsd.dtb.mk Wed Mar 28 16:28:24 2018 (r331683) @@ -2,12 +2,14 @@ # Search for kernel source tree in standard places. .if empty(KERNBUILDDIR) +.if !defined(SYSDIR) .for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. ${.CURDIR}/../../../.. \ ${.CURDIR}/../../../../.. /sys /usr/src/sys -.if !defined(SYSDIR) && exists(${_dir}/kern/) && exists(${_dir}/conf/kmod.mk) +.if exists(${_dir}/kern/) && exists(${_dir}/conf/kmod.mk) SYSDIR= ${_dir} .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. Modified: head/share/mk/bsd.kmod.mk ============================================================================== --- head/share/mk/bsd.kmod.mk Wed Mar 28 16:28:20 2018 (r331682) +++ head/share/mk/bsd.kmod.mk Wed Mar 28 16:28:24 2018 (r331683) @@ -2,12 +2,14 @@ # Search for kernel source tree in standard places. .if empty(KERNBUILDDIR) +.if !defined(SYSDIR) .for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. ${.CURDIR}/../../../.. \ ${.CURDIR}/../../../../.. /sys /usr/src/sys -.if !defined(SYSDIR) && exists(${_dir}/kern/) && exists(${_dir}/conf/kmod.mk) +.if 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. Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Wed Mar 28 16:28:20 2018 (r331682) +++ head/sys/conf/kmod.mk Wed Mar 28 16:28:24 2018 (r331683) @@ -82,11 +82,13 @@ 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 -.if !defined(SYSDIR) && exists(${_dir}/kern/) +.if exists(${_dir}/kern/) SYSDIR= ${_dir:tA} .endif .endfor +.endif .if !defined(SYSDIR) || !exists(${SYSDIR}/kern/) .error "can't find kernel source tree" .endif
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201803281628.w2SGSOqN056705>