Patchwork dependencies: ensure that DESTDIR isn't set when running Buildroot

login
register
mail settings
Submitter Thomas Petazzoni
Date June 29, 2012, 10:14 a.m.
Message ID <1340964896-12899-1-git-send-email-thomas.petazzoni@free-electrons.com>
Download mbox | patch
Permalink /patch/168033/
State Accepted
Headers show

Comments

Thomas Petazzoni - June 29, 2012, 10:14 a.m.
Having DESTDIR set in the environment before running Buildroot creates
some funky problems in the build process. Prevent users from running
into this kind of troubles.

Cc: Michael Opdenacker <michael.opdenacker@free-electrons.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 support/dependencies/dependencies.sh |    6 ++++++
 1 file changed, 6 insertions(+)
Arnout Vandecappelle - June 30, 2012, 12:53 p.m.
On 06/29/12 12:14, Thomas Petazzoni wrote:
> Having DESTDIR set in the environment before running Buildroot creates
> some funky problems in the build process. Prevent users from running
> into this kind of troubles.
>
> Cc: Michael Opdenacker<michael.opdenacker@free-electrons.com>
> Signed-off-by: Thomas Petazzoni<thomas.petazzoni@free-electrons.com>
> ---
>   support/dependencies/dependencies.sh |    6 ++++++
>   1 file changed, 6 insertions(+)
>
> diff --git a/support/dependencies/dependencies.sh b/support/dependencies/dependencies.sh
> index c47ffcf..43ec3cc 100755
> --- a/support/dependencies/dependencies.sh
> +++ b/support/dependencies/dependencies.sh
> @@ -48,6 +48,12 @@ if test -n "$PERL_MM_OPT" ; then
>       exit 1
>   fi
>
> +if test -n "$DESTDIR" ; then
> +    /bin/echo -e "\nYou have the DESTDIR environment variable set. Please"
> +    /bin/echo -e "unset it so that Buildroot can work properly."
> +    exit 1
> +fi

  Why not just override and export DESTDIR from the top-level Makefile?

  Regards,
  Arnout

> +
>   # Verify that which is installed
>   if ! which which>  /dev/null ; then
>   	/bin/echo -e "\nYou must install 'which' on your build machine\n";
Peter Korsgaard - June 30, 2012, 9:53 p.m.
>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:

 Thomas> Having DESTDIR set in the environment before running Buildroot creates
 Thomas> some funky problems in the build process. Prevent users from running
 Thomas> into this kind of troubles.

Committed, thanks.

Patch

diff --git a/support/dependencies/dependencies.sh b/support/dependencies/dependencies.sh
index c47ffcf..43ec3cc 100755
--- a/support/dependencies/dependencies.sh
+++ b/support/dependencies/dependencies.sh
@@ -48,6 +48,12 @@  if test -n "$PERL_MM_OPT" ; then
     exit 1
 fi
 
+if test -n "$DESTDIR" ; then
+    /bin/echo -e "\nYou have the DESTDIR environment variable set. Please"
+    /bin/echo -e "unset it so that Buildroot can work properly."
+    exit 1
+fi
+
 # Verify that which is installed
 if ! which which > /dev/null ; then
 	/bin/echo -e "\nYou must install 'which' on your build machine\n";