[vlc-devel] [PATCH] contrib: Unexport env variables when cross-compiling

Marvin Scholz (ePirat) epirat07 at gmail.com
Thu Jun 6 18:19:05 CEST 2019



> Am 06.06.2019 um 17:49 schrieb Rémi Denis-Courmont <remi at remlab.net>:
> 
> Hi,
> 
> You can't have it both ways. It can't be exported to be used by children processes and not exported at the same time to not interfere with Meson assumptions.

I do not want to export those to be used by child processes, all I need is custom flags that contrib make uses, the contrib make already overrides the env variables of the scripts it calls using the HOSTVARS anyway?

Although it seems I completely overlooked that I can just use make variables and do not need to fiddle with the env at all, I guess.

> 
> (And I share Steve's concerns that this might break a lot of existing rules.)
> 
> Le 6 juin 2019 17:10:40 GMT+03:00, Marvin Scholz <epirat07 at gmail.com> a écrit :
>> 
>> 
>> 
>> On 6 Jun 2019, at 16:09, Rémi Denis-Courmont wrote:
>> 
>>>  Hi,
>>> 
>>>  Unexport sounds like a brittle hack to me. Don't export in the first 
>>>  place if you don't want to.
>>> 
>> 
>> How else would I set for example custom CFLAGS or the C compiler to use 
>> for contrib builds?
>> 
>>> Le 6 juin 2019 14:45:58 GMT+03:00, Marvin Scholz <epirat07 at gmail.com> 
>>> a écrit :
>>>>  Meson always interprets these env variables for the build compiler,
>>>>  even when cross-compiling, therefore we need to unset them,
>>>>  they are anyway included in HOSTVARS already for other build systems.
>>>>  contrib/src/main.mak | 22 +++++++++++++++++++---
>>>>  1 file changed, 19 insertions(+), 3 deletions(-)
>>>> 
>>>>  diff --git a/contrib/src/main.mak b/contrib/src/main.mak
>>>>  index 8944a5a1d7..b4da1b556e 100644
>>>>  --- a/contrib/src/main.mak
>>>>  +++ b/contrib/src/main.mak
>>>>  @@ -329,9 +329,25 @@ HOSTVARS_PIC := $(HOSTTOOLS) \
>>>>  	CXXFLAGS="$(CXXFLAGS) $(PIC)" \
>>>>  	LDFLAGS="$(LDFLAGS)"
>>>> 
>>>>  -# Keep a version of HOSTVARS without the tools, since meson requires
>>>>  the
>>>>  -# tools variables to point to the native ones
>>>>  -HOSTVARS_MESON := $(HOSTVARS)
>>>>  +# For cross-compilation with meson, we need to unset compiler and
>>>>  flags
>>>>  +# env variables as meson will always use them for the BUILD machine
>>>>  compiler!
>>>>  +ifdef HAVE_CROSS_COMPILE
>>>>  +HOSTVARS_MESON :=
>>>>  +unexport CC
>>>>  +unexport CXX
>>>>  +unexport LD
>>>>  +unexport AR
>>>>  +unexport CCAS
>>>>  +unexport RANLIB
>>>>  +unexport STRIP
>>>>  +unexport CPPFLAGS
>>>>  +unexport CFLAGS
>>>>  +unexport CXXFLAGS
>>>>  +unexport LDFLAGS
>>>>  +else
>>>>  +HOSTVARS_MESON := $(HOSTTOOLS) $(HOSTVARS)
>>>>  +endif
>>>>  +
>>>>  HOSTVARS := $(HOSTTOOLS) $(HOSTVARS)
>>>> 
>>>>  download_git = \
>>>>  -- 
>>>>  2.20.1 (Apple Git-117)
>>>>  vlc-devel mailing list
>>>>  To unsubscribe or modify your subscription options:
>>>>  https://mailman.videolan.org/listinfo/vlc-devel
>>> -- 
>>> Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez 
>>> excuser ma brièveté._______________________________________________
>>> vlc-devel mailing list
>>> To unsubscribe or modify your subscription options:
>>> https://mailman.videolan.org/listinfo/vlc-devel
>> vlc-devel mailing list
>> To unsubscribe or modify your subscription options:
>> https://mailman.videolan.org/listinfo/vlc-devel
> 
> -- 
> Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20190606/27a606a9/attachment-0001.html>


More information about the vlc-devel mailing list