[vlc-devel] [PATCH 1/6] contrib: add a way to build native tools from contribs

Steve Lhomme robux4 at ycbcr.xyz
Tue Mar 24 10:18:51 CET 2020


On 2020-03-23 17:20, Rémi Denis-Courmont wrote:
> Le maanantaina 23. maaliskuuta 2020, 17.27.22 EET Steve Lhomme a écrit :
>> Add a tool to be built natively in PKGS_PROGS.
>>
>> Native tools are built automatically when using "make prebuilt" when cross
>> compiling as they are not part of the prebuilt package and needed for the
>> local platform.
>> ---
>>   contrib/src/main.mak | 12 ++++++++++--
>>   1 file changed, 10 insertions(+), 2 deletions(-)
>>
>> diff --git a/contrib/src/main.mak b/contrib/src/main.mak
>> index 18fb49cf658..fa7751da5a8 100644
>> --- a/contrib/src/main.mak
>> +++ b/contrib/src/main.mak
>> @@ -450,6 +450,9 @@ include $(SRC)/*/rules.mak
>>   ifeq ($(PKGS_DISABLE), all)
>>   PKGS :=
>>   endif
>> +ifndef HAVE_CROSS_COMPILE
>> +PKGS_PROGS :=
>> +endif
> 
> Implying? We still needs compilers even on native builds.

But they are automatically built and part of PKGS.

>>   #
>>   # Targets
>>   #
>> @@ -467,6 +470,7 @@ PKGS := $(sort $(PKGS_MANUAL) $(PKGS_DEPS))
>>   fetch: $(PKGS:%=.sum-%)
>>   fetch-all: $(PKGS_ALL:%=.sum-%)
>>   install: $(PKGS:%=.%)
>> +native-programs: $(PKGS_PROGS:%=.%)
> 
> We don't install things in non-install targets.

I don't understand what you mean.

> And you don't need this variable at all here. The PKGS variables are only
> there for the list and the secondary expansion.

I want to know which packages are built natively.

Now if you mean "native-programs" can be merged in "prebuilt" it's 
possible. I don't think we really need to ever call it manually.

>>
>>   mostlyclean:
>>   	-$(RM) $(foreach p,$(PKGS_ALL),.$(p) .sum-$(p) .dep-$(p))
>> @@ -493,8 +497,10 @@ prebuilt: vlc-contrib-$(HOST)-latest.tar.bz2
>>   	-$(UNPACK)
>>   	mv $(HOST) $(PREFIX)
>>   	cd $(PREFIX) && $(abspath $(SRC))/change_prefix.sh
>> +ifdef HAVE_CROSS_COMPILE
>> +	$(MAKE) native-programs
> 
> Same problems.

Same problem as what ? You want $(MAKE) $(PKGS_PROGS) instead ?

>> +else
>>   ifdef HAVE_WIN32
>> -ifndef HAVE_CROSS_COMPILE
>>   	$(RM) `find $(PREFIX)/bin | file -f- | grep ELF | awk -F: '{print $
> $1}' |
>> xargs` endif
>>   endif
>> @@ -520,6 +526,8 @@ list:
>>   	@echo '  $(PKGS_FOUND)' | tr " " "\n" | sort | tr "\n" " " |fmt
>>   	@echo Automatically selected packages:
>>   	@echo '  $(PKGS_AUTOMATIC)' | tr " " "\n" | sort | tr "\n" " " |
> fmt
>> +	@echo Native packages:
>> +	@echo '  $(PKGS_PROGS)' | tr " " "\n" | sort | tr "\n" " " |fmt
> 
> That's completely out of place. If you make list to see what to build or not,
> you don't give a damn what's in prebuilt and what's not. Plus it's confusing
> compared to the other categories, as it's an orthogonal characterisation.

It's not just prebuilt, it's native tools. And if by 'you' you mean me, 
I do care.

>>   	@echo Manually deselected packages:
>>   	@echo '  $(PKGS_DISABLE)' | tr " " "\n" | sort | tr "\n" " " |fmt
>>   	@echo Manually selected packages:
>> @@ -532,7 +540,7 @@ list:
>>   help:
>>   	@cat $(SRC)/help.txt
>>
>> -.PHONY: all fetch fetch-all install mostlyclean clean distclean package
>> list help prebuilt +.PHONY: all fetch fetch-all install mostlyclean clean
>> distclean package list help prebuilt native-programs
>>
>>   CMAKE_SYSTEM_NAME =
>>   ifdef HAVE_WIN32
> 
> 
> -- 
> 雷米‧德尼-库尔蒙
> 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