[vlc-devel] [PATCH 2/3] contrib: Add support for cross compilation with meson

Hugo Beauzée-Luyssen hugo at beauzee.fr
Tue Sep 25 18:29:04 CEST 2018


On Tue, Sep 25, 2018, at 6:17 PM, Rémi Denis-Courmont wrote:
> Le tiistaina 25. syyskuuta 2018, 19.11.06 EEST Hugo Beauzée-Luyssen a écrit :
> > ---
> >  contrib/src/main.mak | 36 +++++++++++++++++++++++++++++++++++-
> >  1 file changed, 35 insertions(+), 1 deletion(-)
> > 
> > diff --git a/contrib/src/main.mak b/contrib/src/main.mak
> > index 0f8b51088f..71972fc896 100644
> > --- a/contrib/src/main.mak
> > +++ b/contrib/src/main.mak
> > @@ -286,7 +286,7 @@ HOSTTOOLS := \
> >  	CC="$(CC)" CXX="$(CXX)" LD="$(LD)" \
> >  	AR="$(AR)" CCAS="$(CCAS)" RANLIB="$(RANLIB)" STRIP="$(STRIP)" \
> >  	PATH="$(PREFIX)/bin:$(PATH)"
> > -HOSTVARS := $(HOSTTOOLS) \
> > +HOSTVARS := \
> >  	CPPFLAGS="$(CPPFLAGS)" \
> >  	CFLAGS="$(CFLAGS)" \
> >  	CXXFLAGS="$(CXXFLAGS)" \
> > @@ -297,6 +297,11 @@ 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_NOTOOLS := $(HOSTVARS)
> > +HOSTVARS := $(HOSTTOOLS) $(HOSTVARS)
> 
> Can we please have something less kludgy?
> 

I don't really know a way to do that better, but my makefile/shell script skills are not that high, so I might be missing the idiomatic solution.
We could probably just remove the CC & all from HOSTVARS upon invocation (and possibly hide that in the $(MESON) variable, but that seems strange to add the tools to remove them afterward.
We could also have the HOSTTOOLS & HOSTVARS variable and add HOSTTOOLS to all autotools based contribs that we have (AFAICS those variables shouldn't be required when building with CMake), but the change is much more intrusive.

Regards,

-- 
  Hugo Beauzée-Luyssen
  hugo at beauzee.fr


More information about the vlc-devel mailing list