Date: Tue, 24 Nov 2015 04:15:05 +0100 From: Jan Beich <jbeich@vfemail.net> To: "Euan Thoms" <euan@potensol.com> Cc: "FreeBSD Ports Mailing List" <freebsd-ports@freebsd.org> Subject: Re: MAKEFLAGS caused temporary insanity Message-ID: <4mgc-ytom-wny@vfemail.net> In-Reply-To: <e011-56536680-21-6b8b4580@46103986> (Euan Thoms's message of "Tue, 24 Nov 2015 03:18:45 %2B0800") References: <e011-56536680-21-6b8b4580@46103986>
next in thread | previous in thread | raw e-mail | index | archive | help
--=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable "Euan Thoms" <euan@potensol.com> writes: > do-build: > cd ${WRKSRC} && unset MAKEFLAGS && ${OPENSIPS_MAKE_ENV} > ${GMAKE} ${_MAKE_JOBS} ${ALL_TARGET} Have you tried defining NOPRECIOUSMAKEVARS in the port's Makefile? MAKEFLAGS is used to propagate arguments to submake but the ports framework (ab)uses it to pass internal variables without making sure they do not poison vendors' Makefiles. For one, ffmpeg and anything that bundles it (e.g. handbrake, kodi) have to be careful ${ARCH} isn't overriden. $ make ARCH=3Damd64 $ cat BSDmakefile ARCH=3D amd64 .MAKEFLAGS: ARCH=3D${ARCH} all: @gmake --no-print-directory $ cat GNUmakefile ARCH=3D x86_64 all: @echo ARCH=3D${ARCH} which is the result of Mk/bsd.port.mk: (3) Serious speedup of bsd.port.mk startup. In particular, this helps cut down "make index" time from an hour and a half to 8 minutes on our system with a parallel make describe (see 2). Try to pass unchanged variables down from parent makes instead of rerunning commands to define them, etc. https://svnweb.freebsd.org/changeset/ports/20327 Why not follow PkgSrc in using MACHINE_ARCH? Index: Mk/bsd.port.mk =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- Mk/bsd.port.mk (revision 402341) +++ Mk/bsd.port.mk (working copy) @@ -1131,10 +1131,7 @@ makepatch: MAINTAINER?=3D ports@FreeBSD.org =20 # Get the architecture =2D.if !defined(ARCH) =2DARCH!=3D ${UNAME} -p =2D.endif =2D_EXPORTED_VARS+=3D ARCH +ARCH?=3D ${MACHINE_ARCH} =20 # Get the operating system type .if !defined(OPSYS) Once 9.x reaches EOL and the ports tree becomes bmake-only other variables can be (properly) fixed via .export. Index: Mk/bsd.port.mk =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- Mk/bsd.port.mk (revision 402341) +++ Mk/bsd.port.mk (working copy) @@ -5051,11 +5051,7 @@ ${_t}: =20 .if !defined(NOPRECIOUSMAKEVARS) # These won't change, so we can pass them through the environment =2D.for var in ${_EXPORTED_VARS} =2D.if empty(.MAKEFLAGS:M${var}=3D*) && !empty(${var}) =2D.MAKEFLAGS: ${var}=3D${${var}:Q} =2D.endif =2D.endfor +.export ${_EXPORTED_VARS} .endif =20 .if !target(pre-check-config) --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQF8BAEBCgBmBQJWU9Y5XxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXREQjQ0MzY3NEM3RDIzNTc4NkUxNDkyQ0VF NEM3Nzg4MzQ3OURCRERCAAoJEOTHeINHnb3bl2AIAMs5BOEG0hnGSMRJeCbiLjsn A84dcJW6t9Wocmj3JXy1oPC5q7xt+3KHwx/qY2phyNfkAsGn0PJqkWy9d92fwvTo S03kI83KTQ539tLR6ywHky0Jq0wTLiDM9NS/VaWPfQnoczeClyB5VYkqqgmL+7xe pGaDDsf0GS3Td2H14TSVroZ9gFmk7pXnh2uTQWbaRoY0deUBjJHtORVRUpuYov4h 6O2OQNu5+P9l8FPKuBLqUKVJzAIWAwjuBhAL4n8xQtrTSK5PqN0C5mXIgmMcIve3 N2k28CihGSDSG++Vg8Flcfa/aTrfgdg0P0Mq6ImFine7OrkBS3HPjZqqk0TRp+c= =Wnzv -----END PGP SIGNATURE----- --=-=-=--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4mgc-ytom-wny>