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

Steve Lhomme robux4 at ycbcr.xyz
Mon Mar 23 16:27:22 CET 2020


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
 #
 # 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:%=.%)
 
 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
+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
 	@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
-- 
2.17.1



More information about the vlc-devel mailing list