--- /dev/null
+Return-Path: <bremner@tethera.net>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id F1A28431FBF\r
+ for <notmuch@notmuchmail.org>; Tue, 25 Mar 2014 04:40:47 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+ autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id civBwo0zIRZn for <notmuch@notmuchmail.org>;\r
+ Tue, 25 Mar 2014 04:40:43 -0700 (PDT)\r
+Received: from yantan.tethera.net (yantan.tethera.net [199.188.72.155])\r
+ (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 42D81431FBD\r
+ for <notmuch@notmuchmail.org>; Tue, 25 Mar 2014 04:40:43 -0700 (PDT)\r
+Received: from remotemail by yantan.tethera.net with local (Exim 4.80)\r
+ (envelope-from <bremner@tethera.net>)\r
+ id 1WSPik-0005Ae-Hn; Tue, 25 Mar 2014 08:40:42 -0300\r
+Received: (nullmailer pid 4449 invoked by uid 1000); Tue, 25 Mar 2014\r
+ 11:40:38 -0000\r
+From: David Bremner <david@tethera.net>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] build: move canonical list of subdirectories to configure\r
+ script\r
+Date: Tue, 25 Mar 2014 08:40:24 -0300\r
+Message-Id: <1395747624-4411-1-git-send-email-david@tethera.net>\r
+X-Mailer: git-send-email 1.9.0\r
+In-Reply-To: <87d2hbhvnq.fsf@zancas.localnet>\r
+References: <87d2hbhvnq.fsf@zancas.localnet>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Tue, 25 Mar 2014 11:40:48 -0000\r
+\r
+The configure script needs this list for out of tree builds. Grabbing\r
+it from the Makefile via sed was fragile and broken.\r
+---\r
+ Makefile | 15 +++++----------\r
+ configure | 8 +++++++-\r
+ 2 files changed, 12 insertions(+), 11 deletions(-)\r
+\r
+diff --git a/Makefile b/Makefile\r
+index 061c55a..4c0e8c6 100644\r
+--- a/Makefile\r
++++ b/Makefile\r
+@@ -2,16 +2,6 @@\r
+ # given explicitly on the command line) so mention it first.\r
+ all:\r
+ \r
+-# List all subdirectories here. Each contains its own Makefile.local.\r
+-# Use of '=', without '+=', seems to be required for out-of-tree\r
+-# builds to work.\r
+-subdirs = compat completion doc emacs lib parse-time-string \\r
+- performance-test util test test/test-databases\r
+-\r
+-# We make all targets depend on the Makefiles themselves.\r
+-global_deps = Makefile Makefile.config Makefile.local \\r
+- $(subdirs:%=%/Makefile) $(subdirs:%=%/Makefile.local)\r
+-\r
+ # Sub-directory Makefile.local fragments can append to these variables\r
+ # to have directory-specific cflags as necessary.\r
+ \r
+@@ -27,6 +17,11 @@ extra_cxxflags :=\r
+ srcdir ?= .\r
+ \r
+ include Makefile.config\r
++\r
++# We make all targets depend on the Makefiles themselves.\r
++global_deps = Makefile Makefile.config Makefile.local \\r
++ $(subdirs:%=%/Makefile) $(subdirs:%=%/Makefile.local)\r
++\r
+ Makefile.config: $(srcdir)/configure\r
+ ifeq ($(configure_options),)\r
+ @echo ""\r
+diff --git a/configure b/configure\r
+index fb276f1..ab73317 100755\r
+--- a/configure\r
++++ b/configure\r
+@@ -19,11 +19,14 @@ readonly DEFAULT_IFS="$IFS"\r
+ \r
+ srcdir=$(dirname "$0")\r
+ \r
++subdirs="util compat lib parse-time-string completion doc emacs"\r
++subdirs="${subdirs} performance-test test test/test-databases"\r
++\r
+ # For a non-srcdir configure invocation (such as ../configure), create\r
+ # the directory structure and copy Makefiles.\r
+ if [ "$srcdir" != "." ]; then\r
+ \r
+- for dir in . $(grep "^subdirs *=" "$srcdir"/Makefile | sed -e "s/subdirs *= *//"); do\r
++ for dir in . ${subdirs}; do\r
+ mkdir -p "$dir"\r
+ cp "$srcdir"/"$dir"/Makefile.local "$dir"\r
+ cp "$srcdir"/"$dir"/Makefile "$dir"\r
+@@ -698,6 +701,9 @@ cat > Makefile.config <<EOF\r
+ # directory (the current directory at the time configure was run).\r
+ srcdir = ${srcdir}\r
+ \r
++# subdirectories to build\r
++subdirs = ${subdirs}\r
++\r
+ configure_options = $@\r
+ \r
+ # We use vpath directives (rather than the VPATH variable) since the\r
+-- \r
+1.9.0\r
+\r