[vlc-devel] [PATCH] contrib: add a bootstrap option to allow using prebuilt packages when cross-compiling

Steve Lhomme robux4 at ycbcr.xyz
Fri Jan 31 16:25:52 CET 2020


In the case of Raspbian there's a heavily patched libavcodec which we can
access through pre-built packages.
Qt cross compiling also a major PITA which we can avoid this way.
---
 contrib/bootstrap    | 6 ++++++
 contrib/src/main.mak | 7 +++++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/contrib/bootstrap b/contrib/bootstrap
index 5ed5f6f25d3..998bc6e34a2 100755
--- a/contrib/bootstrap
+++ b/contrib/bootstrap
@@ -36,6 +36,7 @@ usage()
 	echo "                   (USE AT YOUR OWN LEGAL RISKS)"
 	echo "  --disable-optim  disable optimization in libraries"
 	echo "  --enable-pdb     generate debug information in PDB format"
+	echo "  --enable-prebuilt use pre-compiled packages via pkg-config"
 }
 
 BUILD=
@@ -51,6 +52,7 @@ GNUV3="1"
 AD_CLAUSES=
 WITH_OPTIMIZATION="1"
 ENABLE_PDB=
+USE_BUILT_PKGS=
 
 while test -n "$1"
 do
@@ -95,6 +97,9 @@ do
 		--enable-ad-clauses)
 			AD_CLAUSES=1
 			;;
+		--enable-prebuilt)
+			USE_BUILT_PKGS=1
+			;;
 		--disable-*)
 			PKGS_DISABLE="${PKGS_DISABLE} ${1#--disable-}"
 			;;
@@ -256,6 +261,7 @@ test -z "$GNUV3" || add_make_enabled "GNUV3"
 test -z "$AD_CLAUSES" || add_make_enabled "AD_CLAUSES"
 test -z "$WITH_OPTIMIZATION" || add_make_enabled "WITH_OPTIMIZATION"
 test -z "$ENABLE_PDB" || add_make_enabled "ENABLE_PDB"
+test -z "$USE_BUILT_PKGS" || add_make_enabled "USE_BUILT_PKGS"
 test "`uname -o 2>/dev/null`" != "Msys" || add_make "CMAKE_GENERATOR := -G \"MSYS Makefiles\""
 
 #
diff --git a/contrib/src/main.mak b/contrib/src/main.mak
index 73d23d0018f..5b0d942bc1c 100644
--- a/contrib/src/main.mak
+++ b/contrib/src/main.mak
@@ -46,14 +46,17 @@ HAVE_WIN64 := 1
 endif
 
 ifdef HAVE_CROSS_COMPILE
-need_pkg = 1
+ifdef USE_BUILT_PKGS
+need_pkg = $(shell $(PKG_CONFIG) $(1) || echo 1)
 else
+need_pkg = 1
+endif
 ifeq ($(findstring mingw32,$(BUILD)),mingw32)
 need_pkg = $(shell PKG_CONFIG_LIBDIR="${PKG_CONFIG_PATH}" $(PKG_CONFIG) $(1) || echo 1)
+endif
 else
 need_pkg = $(shell $(PKG_CONFIG) $(1) || echo 1)
 endif
-endif
 
 ifeq ($(findstring mingw32,$(BUILD)),mingw32)
 MSYS_BUILD := 1
-- 
2.17.1



More information about the vlc-devel mailing list