xref: /freebsd/share/mk/bsd.port.mk (revision 880c41ba36ca36dc6bd932f6a263eb589ee1fd28)
1e36a59f7SPeter Wemm# $FreeBSD$
2e36a59f7SPeter Wemm
3a0dec793SWill Andrews.if !defined(PORTSDIR)
4a0dec793SWill Andrews# Autodetect if the command is being run in a ports tree that's not rooted
5a0dec793SWill Andrews# in the default /usr/ports.  The ../../.. case is in case ports ever grows
6a0dec793SWill Andrews# a third level.
76cc777bfSWill Andrews.for RELPATH in . .. ../.. ../../..
86cc777bfSWill Andrews.if !defined(_PORTSDIR) && exists(${.CURDIR}/${RELPATH}/Mk/bsd.port.mk)
96cc777bfSWill Andrews_PORTSDIR=	${.CURDIR}/${RELPATH}
10a0dec793SWill Andrews.endif
116cc777bfSWill Andrews.endfor
126cc777bfSWill Andrews_PORTSDIR?=	/usr/ports
13*880c41baSBryan Drewery.if defined(.PARSEDIR)
14*880c41baSBryan DreweryPORTSDIR=	${_PORTSDIR:tA}
15*880c41baSBryan Drewery.else # fmake doesn't have :tA
166cc777bfSWill AndrewsPORTSDIR!=	realpath ${_PORTSDIR}
17a0dec793SWill Andrews.endif
18*880c41baSBryan Drewery.endif
19a0dec793SWill Andrews
204a209e39SOliver EikemeierBSDPORTMK?=	${PORTSDIR}/Mk/bsd.port.mk
21abd41f7dSRuslan Ermilov
228ef03c79SRuslan Ermilov# Needed to keep bsd.own.mk from reading in /etc/src.conf
238ef03c79SRuslan Ermilov# and setting MK_* variables when building ports.
248ef03c79SRuslan Ermilov_WITHOUT_SRCCONF=
25489ffb71SDavid E. O'Brien
2621edb039SAlexander Leidinger# Enable CTF conversion on request.
2721edb039SAlexander Leidinger.if defined(WITH_CTF)
2821edb039SAlexander Leidinger.undef NO_CTF
2921edb039SAlexander Leidinger.endif
3021edb039SAlexander Leidinger
31abd41f7dSRuslan Ermilov.include <bsd.own.mk>
324a209e39SOliver Eikemeier.include "${BSDPORTMK}"
33