Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Nov 2015 09:33:42 +0800
From:      "Euan Thoms" <euan@potensol.com>
To:        "Jan Beich" <jbeich@vfemail.net>
Cc:        "FreeBSD Ports Mailing List" <freebsd-ports@freebsd.org>
Subject:   =?utf-8?q?Re=3A_MAKEFLAGS_caused_temporary_insanity?=
Message-ID:  <b2e8-56551000-3-6b8b4580@1076099>
In-Reply-To: <4mgc-ytom-wny@vfemail.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Sorry, I only just noticed your email. I'll give it a try and report ba=
ck.

On Tuesday, November 24, 2015 11:15 SGT, Jan Beich <jbeich@vfemail.net>=
 wrote: 
 
> "Euan Thoms" <euan@potensol.com> writes:
> 
> > do-build:
> >         cd ${WRKSRC} && unset MAKEFLAGS && ${OPENSIPS=5FMAKE=5FENV}=

> > ${GMAKE} ${=5FMAKE=5FJOBS} ${ALL=5FTARGET}
> 
> Have you tried defining NOPRECIOUSMAKEVARS in the port's Makefile?
> 
> MAKEFLAGS is used to propagate arguments to submake but the ports fra=
mework
> (ab)uses it to pass internal variables without making sure they do no=
t
> 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=5F64
> 
>   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 he=
lps
>       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=5FARCH?
> 
> 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
> --- Mk/bsd.port.mk	(revision 402341)
> +++ Mk/bsd.port.mk	(working copy)
> @@ -1131,10 +1131,7 @@ makepatch:
>  MAINTAINER?=3D	ports@FreeBSD.org
>  
>  # Get the architecture
> -.if !defined(ARCH)
> -ARCH!=3D	${UNAME} -p
> -.endif
> -=5FEXPORTED=5FVARS+=3D	ARCH
> +ARCH?=3D			${MACHINE=5FARCH}
>  
>  # Get the operating system type
>  .if !defined(OPSYS)
> 
> Once 9.x reaches EOL and the ports tree becomes bmake-only other vari=
ables
> 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
> --- Mk/bsd.port.mk	(revision 402341)
> +++ Mk/bsd.port.mk	(working copy)
> @@ -5051,11 +5051,7 @@ ${=5Ft}:
>  
>  .if !defined(NOPRECIOUSMAKEVARS)
>  # These won't change, so we can pass them through the environment
> -.for var in ${=5FEXPORTED=5FVARS}
> -.if empty(.MAKEFLAGS:M${var}=3D*) && !empty(${var})
> -.MAKEFLAGS:	${var}=3D${${var}:Q}
> -.endif
> -.endfor
> +.export ${=5FEXPORTED=5FVARS}
>  .endif
>  
>  .if !target(pre-check-config)
 
 
 
-- 
Regards, Euan Thoms 





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?b2e8-56551000-3-6b8b4580>