From 38073bb7d762c6c5e35dda5d176c9dbee7b22a8b Mon Sep 17 00:00:00 2001
From: Nicola Fontana <ntd@entidi.it>
Date: Sat, 12 Jan 2013 13:27:00 +0100
Subject: [PATCH] distcheck: build under _build/_build

Proof of concept to avoid missing $srcdir/* files in the final tarball.
---
 lib/am/distdir.am | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/am/distdir.am b/lib/am/distdir.am
index e5d8d5e..3ae92d8 100644
--- a/lib/am/distdir.am
+++ b/lib/am/distdir.am
@@ -424,7 +424,7 @@ distcheck: dist
 ## can make our new subdirs.
 	chmod -R a-w $(distdir)
 	chmod u+w $(distdir)
-	mkdir $(distdir)/_build $(distdir)/_inst
+	mkdir $(distdir)/_build $(distdir)/_build/_build $(distdir)/_inst
 ## Undo the write access.
 	chmod a-w $(distdir)
 ## With GNU make, the following command will be executed even with "make -n",
@@ -445,8 +445,8 @@ distcheck: dist
 ## Parallel BSD make may not start a new shell for each command in a recipe,
 ## so be sure to 'cd' back to the original directory after this.
 	  && am__cwd=`pwd` \
-	  && $(am__cd) $(distdir)/_build \
-	  && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+	  && $(am__cd) $(distdir)/_build/_build \
+	  && ../../configure --srcdir=../.. --prefix="$$dc_install_base" \
 ?GETTEXT?	    --with-included-gettext \
 ## Additional flags for configure.  Keep this last in the configure
 ## invocation so the developer and user can override previous options,
-- 
1.8.1

