[vlc-commits] tools: allow building tools out of the source tree

Steve Lhomme git at videolan.org
Thu Jun 18 13:10:14 CEST 2020


vlc/vlc-3.0 | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri May  3 12:52:43 2019 +0200| [42849464a1154f49e5b885971975eb3019c96e63] | committer: Steve Lhomme

tools: allow building tools out of the source tree

This is convenient when using one source tree with different compilers/OSes.
For example when C++ standard library differs between versions (since most of
the time we need to build protoc).
You can keep one set of tools per environment.

(cherry picked from commit 7febc3979f43575f987b4f2313248595a562878e)

Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=42849464a1154f49e5b885971975eb3019c96e63
---

 extras/tools/bootstrap | 11 ++++-------
 extras/tools/tools.mak | 27 ++++++++++++++-------------
 2 files changed, 18 insertions(+), 20 deletions(-)

diff --git a/extras/tools/bootstrap b/extras/tools/bootstrap
index c093399404..d2612ece55 100755
--- a/extras/tools/bootstrap
+++ b/extras/tools/bootstrap
@@ -19,12 +19,6 @@ export LC_ALL=
 NEEDED=
 FOUND=
 
-if [ ! -f tools.mak ]
-then
-	echo "You must run me in ./extras/tools !"
-	exit 1
-fi
-
 check_version() {
     gotver=$2
     gotmajor=`echo $gotver|cut -d. -f1`
@@ -176,7 +170,10 @@ case `uname` in
      ;;
 esac
 
+BOOTSTRAP_PATH="$( cd "$(dirname "$0")" ; pwd -P )"
+
 cat > Makefile << EOF
+TOOLS = $BOOTSTRAP_PATH
 MAKEFLAGS += -j$CPUS
 CMAKEFLAGS += --parallel=$CPUS
 PREFIX=\$(abspath ./build)
@@ -204,5 +201,5 @@ cat >> Makefile << EOF
 all: $TARGETS
 	@echo "You are ready to build VLC and its contribs"
 
-include tools.mak
+include \$(TOOLS)/tools.mak
 EOF
diff --git a/extras/tools/tools.mak b/extras/tools/tools.mak
index 929f83f4aa..94375c748c 100644
--- a/extras/tools/tools.mak
+++ b/extras/tools/tools.mak
@@ -2,7 +2,8 @@
 #
 # This file is under the same license as the vlc package.
 
-include packages.mak
+include $(TOOLS)/packages.mak
+TARBALLS := $(TOOLS)
 
 #
 # common rules
@@ -36,7 +37,7 @@ endif
 
 download_pkg = $(call download,$(VIDEOLAN)/$(2)/$(lastword $(subst /, ,$(@)))) || \
 	( $(call download,$(1)) && echo "Please upload package $(lastword $(subst /, ,$(@))) to our FTP" )  \
-	&& grep $(@) SHA512SUMS| $(SHA512SUM)
+	&& grep $(@) $(TOOLS)/SHA512SUMS| $(SHA512SUM)
 
 UNPACK = $(RM) -R $@ \
     $(foreach f,$(filter %.tar.gz %.tgz,$^), && tar xvzfo $(f)) \
@@ -91,7 +92,7 @@ cmake-$(CMAKE_VERSION).tar.gz:
 
 cmake: cmake-$(CMAKE_VERSION).tar.gz
 	$(UNPACK)
-	$(APPLY) cmake-msys-FindPkg.patch
+	$(APPLY) $(TOOLS)/cmake-msys-FindPkg.patch
 	$(MOVE)
 
 .buildcmake: cmake
@@ -126,10 +127,10 @@ libtool-$(LIBTOOL_VERSION).tar.gz:
 libtool: libtool-$(LIBTOOL_VERSION).tar.gz
 	$(UNPACK)
 	(cd $(UNPACK_DIR) && chmod u+w build-aux/ltmain.sh)
-	$(APPLY) libtool-2.4.6-bitcode.patch
-	$(APPLY) libtool-2.4.6-san.patch
-	$(APPLY) libtool-2.4.6-clang-libs.patch
-	$(APPLY) libtool-2.4.6-response-files.patch
+	$(APPLY) $(TOOLS)/libtool-2.4.6-bitcode.patch
+	$(APPLY) $(TOOLS)/libtool-2.4.6-san.patch
+	$(APPLY) $(TOOLS)/libtool-2.4.6-clang-libs.patch
+	$(APPLY) $(TOOLS)/libtool-2.4.6-response-files.patch
 	(cd $(UNPACK_DIR) && autoreconf)
 	$(MOVE)
 
@@ -201,7 +202,7 @@ automake-$(AUTOMAKE_VERSION).tar.gz:
 
 automake: automake-$(AUTOMAKE_VERSION).tar.gz
 	$(UNPACK)
-	$(APPLY) automake-clang.patch
+	$(APPLY) $(TOOLS)/automake-clang.patch
 	$(MOVE)
 
 .buildautomake: automake .autoconf
@@ -219,8 +220,8 @@ m4-$(M4_VERSION).tar.gz:
 
 m4: m4-$(M4_VERSION).tar.gz
 	$(UNPACK)
-	$(APPLY) bison-macOS-c41f233c.patch
-	$(APPLY) bison-macOS-7df04f9.patch
+	$(APPLY) $(TOOLS)/bison-macOS-c41f233c.patch
+	$(APPLY) $(TOOLS)/bison-macOS-7df04f9.patch
 	$(MOVE)
 
 .buildm4: m4
@@ -272,7 +273,7 @@ ragel-$(RAGEL_VERSION).tar.gz:
 
 ragel: ragel-$(RAGEL_VERSION).tar.gz
 	$(UNPACK)
-	$(APPLY) ragel-6.8-javacodegen.patch
+	$(APPLY) $(TOOLS)/ragel-6.8-javacodegen.patch
 	$(MOVE)
 
 
@@ -347,8 +348,8 @@ bison-$(BISON_VERSION).tar.xz:
 
 bison: bison-$(BISON_VERSION).tar.xz
 	$(UNPACK)
-	$(APPLY) bison-macOS-c41f233c.patch
-	$(APPLY) bison-macOS-7df04f9.patch
+	$(APPLY) $(TOOLS)/bison-macOS-c41f233c.patch
+	$(APPLY) $(TOOLS)/bison-macOS-7df04f9.patch
 	$(MOVE)
 
 .buildbison: bison



More information about the vlc-commits mailing list