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

Rémi Denis-Courmont remi at remlab.net
Mon Mar 23 17:20:43 CET 2020


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.

>  #
>  # 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.

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

> 
>  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.

> +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.

>  	@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/





More information about the vlc-devel mailing list