unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Tomi Ollila <tomi.ollila@iki.fi>
To: notmuch@notmuchmail.org
Cc: tomi.ollila@iki.fi
Subject: [RFC PATCH] configure: Create sh.config based on Makefile.config data
Date: Sun, 11 May 2014 13:06:56 +0300	[thread overview]
Message-ID: <1399802816-29521-1-git-send-email-tomi.ollila@iki.fi> (raw)

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

             reply	other threads:[~2014-05-11 10:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-11 10:06 Tomi Ollila [this message]
2014-05-25  8:22 ` [RFC PATCH] configure: Create sh.config based on Makefile.config data Jani Nikula
2014-05-25 15:54   ` Tomi Ollila
2014-05-30  7:43     ` [PATCH 1/2] build: generate sh.config for feeding configure results to shell scripts Jani Nikula
2014-05-30  7:43       ` [PATCH 2/2] test: use sh.config for configuration Jani Nikula
2014-05-30 11:50       ` [PATCH 1/2] build: generate sh.config for feeding configure results to shell scripts Tomi Ollila
2014-05-30 15:42       ` W. Trevor King
2014-07-13 15:25         ` David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1399802816-29521-1-git-send-email-tomi.ollila@iki.fi \
    --to=tomi.ollila@iki.fi \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).