--- /dev/null
+Return-Path: <too@guru-group.fi>\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 2E544431FC0\r
+ for <notmuch@notmuchmail.org>; Sun, 11 May 2014 03:07:09 -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 xBZfLSz9Y4d5 for <notmuch@notmuchmail.org>;\r
+ Sun, 11 May 2014 03:07:04 -0700 (PDT)\r
+Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
+ by olra.theworths.org (Postfix) with ESMTP id 4F477431FBF\r
+ for <notmuch@notmuchmail.org>; Sun, 11 May 2014 03:07:04 -0700 (PDT)\r
+Received: by guru.guru-group.fi (Postfix, from userid 501)\r
+ id 96209100063; Sun, 11 May 2014 13:06:58 +0300 (EEST)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: notmuch@notmuchmail.org\r
+Subject: [RFC PATCH] configure: Create sh.config based on Makefile.config data\r
+Date: Sun, 11 May 2014 13:06:56 +0300\r
+Message-Id: <1399802816-29521-1-git-send-email-tomi.ollila@iki.fi>\r
+X-Mailer: git-send-email 1.8.0\r
+Cc: tomi.ollila@iki.fi\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: Sun, 11 May 2014 10:07:09 -0000\r
+\r
+Read Makefile.config and when line matches var = val assignment\r
+create _var='val' from it. var must match [a-zA-Z_][a-zA-Z0-9_]*\r
+and val [^'\]* ('\' usually meaning multiline assignments).\r
+\r
+Write these lines to sh.config.\r
+\r
+sh.config can then be used e.g. in test scripts.\r
+---\r
+ configure | 5 +++++\r
+ 1 file changed, 5 insertions(+)\r
+\r
+diff --git a/configure b/configure\r
+index 9bde2eb72b0e..feb0e480f86a 100755\r
+--- a/configure\r
++++ b/configure\r
+@@ -935,3 +935,8 @@ CONFIGURE_CXXFLAGS = -DHAVE_GETLINE=\$(HAVE_GETLINE) \$(GMIME_CFLAGS) \\\r
+ \r
+ CONFIGURE_LDFLAGS = \$(GMIME_LDFLAGS) \$(TALLOC_LDFLAGS) \$(ZLIB_LDFLAGS) \$(XAPIAN_LDFLAGS)\r
+ EOF\r
++\r
++# Create sh.config based on Makefile.config values.\r
++# Output will be _var='val', val not containing ' nor \ (skipping multiline).\r
++sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\) *= *\([^\\'\'']*\)$/_\1='\''\2'\''/p' \\r
++ Makefile.config > sh.config\r
+-- \r
+1.8.0\r
+\r