[vlc-devel] [PATCH 3/3] contrib: allow building contribs out of the source tree
Steve Lhomme
robux4 at ycbcr.xyz
Mon Jun 17 11:17:33 CEST 2019
On 2019-06-17 10:30, Rémi Denis-Courmont wrote:
> Hi,
>
> I don't think we should depend on Python, at least not until distros
> settle how it works post removal of Python 2.
We already depend on python for meson.
I originally did it for python3 and realised it wasn't working with
python2 (or the opposite). This version works with both.
> Le 17 juin 2019 10:26:37 GMT+03:00, Steve Lhomme <robux4 at ycbcr.xyz> a
> écrit :
>
> 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.
>
> change_prefix.sh is called from a contrib sub folder so we must use SRC_BUILT.
> ------------------------------------------------------------------------
> contrib/bootstrap | 20 ++++++++++----------
> contrib/src/main.mak | 2 +-
> 2 files changed, 11 insertions(+), 11 deletions(-)
>
> diff --git a/contrib/bootstrap b/contrib/bootstrap
> index 7ad8b33c67..eff9787465 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
> @@ -382,10 +376,16 @@ esac
> #
> # Results output
> #
> -add_make "TOPSRC = .."
> -add_make "TOPSRC_BUILT = ../.."
> -add_make "TOPDST = .."
> +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 $?
> diff --git a/contrib/src/main.mak b/contrib/src/main.mak
> index 9b9ebb33c4..58993ac44d 100644
> --- a/contrib/src/main.mak
> +++ b/contrib/src/main.mak
> @@ -476,7 +476,7 @@ prebuilt: vlc-contrib-$(HOST)-latest.tar.bz2
> $(RM) -r $(PREFIX)
> -$(UNPACK)
> mv -n $(HOST) $(TOPDST)
> - cd $(PREFIX) && $(SRC)/change_prefix.sh
> + cd $(PREFIX) && $(SRC_BUILT)/change_prefix.sh
> ifdef HAVE_WIN32
> ifndef HAVE_CROSS_COMPILE
> $(RM) `find $(PREFIX)/bin | file -f- | grep ELF | awk -F: '{print $$1}' | xargs`
>
>
> --
> Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser
> ma brièveté.
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
>
More information about the vlc-devel
mailing list