Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 2E544431FC0 for ; Sun, 11 May 2014 03:07:09 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xBZfLSz9Y4d5 for ; Sun, 11 May 2014 03:07:04 -0700 (PDT) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by olra.theworths.org (Postfix) with ESMTP id 4F477431FBF for ; Sun, 11 May 2014 03:07:04 -0700 (PDT) Received: by guru.guru-group.fi (Postfix, from userid 501) id 96209100063; Sun, 11 May 2014 13:06:58 +0300 (EEST) From: Tomi Ollila To: notmuch@notmuchmail.org Subject: [RFC PATCH] configure: Create sh.config based on Makefile.config data Date: Sun, 11 May 2014 13:06:56 +0300 Message-Id: <1399802816-29521-1-git-send-email-tomi.ollila@iki.fi> X-Mailer: git-send-email 1.8.0 Cc: tomi.ollila@iki.fi X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 May 2014 10:07:09 -0000 Read Makefile.config and when line matches var = val assignment create _var='val' from it. var must match [a-zA-Z_][a-zA-Z0-9_]* and val [^'\]* ('\' usually meaning multiline assignments). Write these lines to sh.config. sh.config can then be used e.g. in test scripts. --- configure | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/configure b/configure index 9bde2eb72b0e..feb0e480f86a 100755 --- a/configure +++ b/configure @@ -935,3 +935,8 @@ CONFIGURE_CXXFLAGS = -DHAVE_GETLINE=\$(HAVE_GETLINE) \$(GMIME_CFLAGS) \\ CONFIGURE_LDFLAGS = \$(GMIME_LDFLAGS) \$(TALLOC_LDFLAGS) \$(ZLIB_LDFLAGS) \$(XAPIAN_LDFLAGS) EOF + +# Create sh.config based on Makefile.config values. +# Output will be _var='val', val not containing ' nor \ (skipping multiline). +sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\) *= *\([^\\'\'']*\)$/_\1='\''\2'\''/p' \ + Makefile.config > sh.config -- 1.8.0