aboutsummaryrefslogtreecommitdiff
path: root/Makefile.inc1
diff options
context:
space:
mode:
authorBryan Drewery <bdrewery@FreeBSD.org>2018-02-20 21:48:16 +0000
committerBryan Drewery <bdrewery@FreeBSD.org>2018-02-20 21:48:16 +0000
commit49a1108ae72c35d3de6b9c98c9375cab6158ce8e (patch)
tree4dd17c0b47dd252df13d3d94420352804d29cdcb /Makefile.inc1
parent7cb7c6e37ae868a3a7f7cad1b065944a2d07016c (diff)
downloadsrc-49a1108ae72c35d3de6b9c98c9375cab6158ce8e.tar.gz
src-49a1108ae72c35d3de6b9c98c9375cab6158ce8e.zip
Move SVNVERSION_CMD into the one place that uses it.
This code, which is basically `svnversion || svnliteversion`, generates 2 fstatat(2) for every directory in PATH for every Makefile parsed that includes bsd.own.mk. This can add up for things like generating a Ports index (Poudriere) or building a dependency graph for base. Sponsored by: Dell EMC MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=329676
Diffstat (limited to 'Makefile.inc1')
-rw-r--r--Makefile.inc110
1 files changed, 10 insertions, 0 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1
index a242df17e69e..bcc46f2115e2 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -350,6 +350,16 @@ SVN= ${_P}/${_S}
.endif
SVNFLAGS?= -r HEAD
.if !defined(VCS_REVISION) && empty(VCS_REVISION)
+.if !defined(SVNVERSION_CMD) && empty(SVNVERSION_CMD)
+. for _D in ${PATH:S,:, ,g}
+. if exists(${_D}/svnversion)
+SVNVERSION_CMD?=${_D}/svnversion
+. endif
+. if exists(${_D}/svnliteversion)
+SVNVERSION_CMD?=${_D}/svnliteversion
+. endif
+. endfor
+.endif
_VCS_REVISION?= $$(eval ${SVNVERSION_CMD} ${SRCDIR})
. if !empty(_VCS_REVISION)
VCS_REVISION= $$(echo r${_VCS_REVISION})