[vlc-devel] [PATCH v2 02/13] contrib: share the environment to use to build native tools

Steve Lhomme robux4 at ycbcr.xyz
Tue Mar 24 16:55:48 CET 2020


On 2020-03-24 16:42, Rémi Denis-Courmont wrote:
> Le tiistaina 24. maaliskuuta 2020, 16.46.20 EET Steve Lhomme a écrit :
>> Unset the main environment variables that may affect basic
>> compilation/linking.
>>
>> When not cross-compiling we use the same environment as the rest of the
>> compiled contribs.
>> ---
>>   contrib/src/main.mak | 9 +++++++++
>>   1 file changed, 9 insertions(+)
>>
>> diff --git a/contrib/src/main.mak b/contrib/src/main.mak
>> index 708885cdec..7105dc508a 100644
>> --- a/contrib/src/main.mak
>> +++ b/contrib/src/main.mak
>> @@ -338,6 +338,15 @@ HOSTVARS_PIC := $(HOSTTOOLS) \
>>   	CXXFLAGS="$(CXXFLAGS) $(PIC)" \
>>   	LDFLAGS="$(LDFLAGS)"
>>
>> +# environment to use to build native programs (build, ie not the host)
>> +ifdef HAVE_CROSS_COMPILE
>> +BUILDVARS := env -u CC -u CFLAGS -u CPPFLAGS -u CXX -u CXXFLAGS -u LD -u
>> LDFLAGS -u AR -u CCAS -u RANLIB -u STRIP +BUILDCONF :=
>> --prefix="$(BUILDPREFIX)" --build="$(BUILD)" --host="$(BUILD)"
>> --target="$(HOST)" +else
>> +BUILDVARS := $(HOSTVARS)
>> +BUILDCONF := $(HOSTCONF)
>> +endif
>> +
> 
> This is rather dubious. Why do we use defaults in cross-builds, but bootstrap
> in native builds? I don't see why we would want to debug the cross tools any
> more or less (we probably don't want to debug them).

The default compiler might be gcc but for some reason the user want to 
build its native contribs with clang and some extra flags (maybe even 
sanitizers).

For BUILDCONF we want the fields set in HOSTCONF like --prefix.

>>   download_git = \
>>   	rm -Rf -- "$(@:.tar.xz=)" && \
>>   	$(GIT) init --bare "$(@:.tar.xz=)" && \
> 
> 
> -- 
> レミ・デニ-クールモン
> http://www.remlab.net/
> 
> 
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
> 


More information about the vlc-devel mailing list