[vlc-commits] contrib: allow building contribs out of the source tree
Steve Lhomme
git at videolan.org
Thu Jun 18 18:31:58 CEST 2020
vlc/vlc-3.0 | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Jun 17 09:08:11 2019 +0200| [7f5b215826a31013b61dbe35154cf5e1c2de1a48] | committer: Steve Lhomme
contrib: allow building contribs out of the source tree
The resulting contrib can be used via --with-contrib in the configure script.
The local Makefile to build contribs is now specific to the build folder.
(cherry picked from commit 3e8c5e332882d1fed30e24a4dcc1747383e75b0e)
Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=7f5b215826a31013b61dbe35154cf5e1c2de1a48
---
contrib/bootstrap | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/contrib/bootstrap b/contrib/bootstrap
index 6047abbf49..1789e9a002 100755
--- a/contrib/bootstrap
+++ b/contrib/bootstrap
@@ -52,12 +52,6 @@ AD_CLAUSES=
WITH_OPTIMIZATION="1"
ENABLE_PDB=
-if test ! -f "../../contrib/src/main.mak"
-then
- echo "$0 must be run from a subdirectory"
- exit 1
-fi
-
while test -n "$1"
do
case "$1" in
@@ -400,10 +394,16 @@ esac
#
# Results output
#
-add_make "TOPSRC = .."
-add_make "TOPSRC_BUILT = ../.."
+BOOTSTRAP_PATH="$( cd "$(dirname "$0")" ; pwd -P )"
+CURRENT_PATH="$( pwd -P )"
+# location of the contrib/src folder from the root of the contrib build folder
+TOPSRC=$(python -c "import os; print(os.path.relpath('$BOOTSTRAP_PATH', '$CURRENT_PATH'))")
+# location of the contrib/src folder from a built library folder
+TOPSRC_BUILT=$(python -c "import os; print(os.path.relpath('$BOOTSTRAP_PATH', '$CURRENT_PATH/libfoo'))")
+add_make "TOPSRC = $TOPSRC"
+add_make "TOPSRC_BUILT = $TOPSRC_BUILT"
add_make "TOPDST = .."
add_make 'include $(TOPSRC)/src/main.mak'
echo "Bootstrap completed."
make help
-mkdir -p ../../contrib/tarballs || exit $?
+mkdir -p $BOOTSTRAP_PATH/tarballs || exit $?
More information about the vlc-commits
mailing list