From 735bb2af10edf4760d23e446b38e76c423bccca7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@gnu.org>
Date: Sat, 27 Oct 2012 22:37:49 +0200
Subject: [PATCH] build: Fix out-of-source-tree builds.

* Makefile.am (distro/packages/bootstrap/x86_64-linux/guile-bootstrap-2.0.6.tar.xz,
  distro/packages/bootstrap/i686-linux/guile-bootstrap-2.0.6.tar.xz):
  Make the target's parent directory.
* pre-inst-env.in (DISTRO_BOOTSTRAP_PATH): Add the builddir-relative
  directory.
---
 Makefile.am     | 2 ++
 pre-inst-env.in | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index d1f3547224f..cf3e16bbc63 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -98,8 +98,10 @@ DOWNLOAD_FILE =								\
            "$(top_srcdir)/build-aux/download.scm"
 
 distro/packages/bootstrap/x86_64-linux/guile-bootstrap-2.0.6.tar.xz: guix/utils.go
+	$(MKDIR_P) `dirname "$@"`
 	$(DOWNLOAD_FILE) "$@" "0467a82cbe4136f60a79eb4176011bf88cf28ea19c9ad9defa365811ff8e11cf"
 distro/packages/bootstrap/i686-linux/guile-bootstrap-2.0.6.tar.xz: guix/utils.go
+	$(MKDIR_P) `dirname "$@"`
 	$(DOWNLOAD_FILE) "$@" "93b537766dfab3ad287143523751e3ec02dd32d3ccaf88ad2d31c63158f342ee"
 
 nobase_nodist_guilemodule_DATA = $(GOBJECTS)
diff --git a/pre-inst-env.in b/pre-inst-env.in
index 0d1ca80b558..2fb60e2edda 100644
--- a/pre-inst-env.in
+++ b/pre-inst-env.in
@@ -24,7 +24,7 @@
 # "./pre-inst-env guix-build hello".
 
 DISTRO_PATCH_PATH="@abs_top_srcdir@/distro/packages/patches"
-DISTRO_BOOTSTRAP_PATH="@abs_top_srcdir@/distro/packages/bootstrap"
+DISTRO_BOOTSTRAP_PATH="@abs_top_srcdir@/distro/packages/bootstrap:@abs_top_builddir@/distro/packages/bootstrap"
 GUILE_LOAD_COMPILED_PATH="@abs_top_builddir@${GUILE_LOAD_COMPILED_PATH:+:}$GUILE_LOAD_COMPILED_PATH"
 GUILE_LOAD_PATH="@abs_top_srcdir@${GUILE_LOAD_PATH:+:}:$GUILE_LOAD_PATH"
 
-- 
GitLab