# bsd.port.mk | 12 +++++++++++- # 1 file changed, 11 insertions(+), 1 deletion(-) # svn status M share/mk/bsd.port.mk Index: share/mk/bsd.port.mk =================================================================== --- share/mk/bsd.port.mk (revision 272089) +++ share/mk/bsd.port.mk (working copy) @@ -1,6 +1,16 @@ # $FreeBSD$ -PORTSDIR?= /usr/ports +.if !defined(PORTSDIR) +PORTSDIR!= \ + until [ -e Mk/bsd.port.mk ]; do \ + if [ "$${PWD}" = "/" ]; then \ + echo /usr/ports; \ + exit 0; \ + fi; \ + cd ..; \ + done; \ + echo $${PWD}; +.endif BSDPORTMK?= ${PORTSDIR}/Mk/bsd.port.mk # Needed to keep bsd.own.mk from reading in /etc/src.conf