Re: [RFC PATCH] configure: Create sh.config based on Makefile.config data
[notmuch-archives.git] / af / 281943ef97e080d3bae61ba36aeec9670681f0
1 Return-Path: <jani@nikula.org>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 3AF82431FC7\r
6         for <notmuch@notmuchmail.org>; Sun, 25 May 2014 01:23:00 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id uW3pYebESL2a for <notmuch@notmuchmail.org>;\r
16         Sun, 25 May 2014 01:22:56 -0700 (PDT)\r
17 Received: from mail-we0-f176.google.com (mail-we0-f176.google.com\r
18         [74.125.82.176]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id C2B52431FC4\r
21         for <notmuch@notmuchmail.org>; Sun, 25 May 2014 01:22:55 -0700 (PDT)\r
22 Received: by mail-we0-f176.google.com with SMTP id q59so6507791wes.7\r
23         for <notmuch@notmuchmail.org>; Sun, 25 May 2014 01:22:52 -0700 (PDT)\r
24 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
25         d=1e100.net; s=20130820;\r
26         h=x-gm-message-state:from:to:cc:subject:in-reply-to:references\r
27         :user-agent:date:message-id:mime-version:content-type;\r
28         bh=O1C9HFKvVq1SZALij5ov63uiah2kWoE1NDJvph6AkK0=;\r
29         b=gLota+NZ/ozESr9emiPJ3Hoa2X+Vy9HgYR4nFo+yPXUkDdiJakJMsakoQkZPcGfJhT\r
30         QDY5PbnCVeiw+qxmuQRzg93n6GdC5NU8GTU65SyRpvYBmaFhhFRcScAbHpe0NlZhmWPa\r
31         /PJRuD8pYLIbwEiCki8kd3FurH2pv3oWgBK45vygOSMbR60yXoFol4pXQAl2xjqiB05b\r
32         vbINCrp1DAqL3MMDD/wcBy0N/NKyeu5TAZMl3wpzRciXw73djx9hLR9TavO565XsNJhx\r
33         JbPo88jW34aEPdXzDSDIOV58FQfMb5O+KPVFEnm/vl6OJJ3lbIZUe4Zy26Wf9P2AUlLi\r
34         VJXQ==\r
35 X-Gm-Message-State:\r
36  ALoCoQniDxtKcrayTL8wEagZh6/ZvNtGVDJSQM5sUMl/4nMuyR1Q1KQLke8MMfrK4DUMkmvb4g3e\r
37 X-Received: by 10.194.109.68 with SMTP id hq4mr19245467wjb.21.1401006171301;\r
38         Sun, 25 May 2014 01:22:51 -0700 (PDT)\r
39 Received: from localhost (dsl-hkibrasgw2-58c36f-91.dhcp.inet.fi.\r
40         [88.195.111.91])\r
41         by mx.google.com with ESMTPSA id ey3sm419964wib.18.2014.05.25.01.22.49\r
42         for <multiple recipients>\r
43         (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
44         Sun, 25 May 2014 01:22:50 -0700 (PDT)\r
45 From: Jani Nikula <jani@nikula.org>\r
46 To: Tomi Ollila <tomi.ollila@iki.fi>, notmuch@notmuchmail.org\r
47 Subject: Re: [RFC PATCH] configure: Create sh.config based on Makefile.config\r
48         data\r
49 In-Reply-To: <1399802816-29521-1-git-send-email-tomi.ollila@iki.fi>\r
50 References: <1399802816-29521-1-git-send-email-tomi.ollila@iki.fi>\r
51 User-Agent: Notmuch/0.18~rc0+2~gbc64cdc (http://notmuchmail.org) Emacs/24.3.1\r
52         (x86_64-pc-linux-gnu)\r
53 Date: Sun, 25 May 2014 11:22:48 +0300\r
54 Message-ID: <87tx8ei7xj.fsf@nikula.org>\r
55 MIME-Version: 1.0\r
56 Content-Type: text/plain\r
57 Cc: tomi.ollila@iki.fi\r
58 X-BeenThere: notmuch@notmuchmail.org\r
59 X-Mailman-Version: 2.1.13\r
60 Precedence: list\r
61 List-Id: "Use and development of the notmuch mail system."\r
62         <notmuch.notmuchmail.org>\r
63 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
64         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
65 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
66 List-Post: <mailto:notmuch@notmuchmail.org>\r
67 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
68 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
69         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
70 X-List-Received-Date: Sun, 25 May 2014 08:23:00 -0000\r
71 \r
72 On Sun, 11 May 2014, Tomi Ollila <tomi.ollila@iki.fi> wrote:\r
73 > Read Makefile.config and when line matches var = val assignment\r
74 > create _var='val' from it. var must match [a-zA-Z_][a-zA-Z0-9_]*\r
75 > and val [^'\]* ('\' usually meaning multiline assignments).\r
76 >\r
77 > Write these lines to sh.config.\r
78 >\r
79 > sh.config can then be used e.g. in test scripts.\r
80 \r
81 I like the general idea here much better than [1] or the symlinks that\r
82 we have now. However I'm wary of the sed magic and the various ways it\r
83 might trip over. The resulting file has way more info than we need, but\r
84 then it also misses the multiline settings (which we luckily don't\r
85 need).\r
86 \r
87 At the risk of duplicating stuff, I'd go with manually generated config\r
88 for shell with minimal amount of information. For now, we'd only need\r
89 this for HAVE_XAPIAN_COMPACT and HAVE_MAN (the latter of which could\r
90 also be dropped from Makefile.config).\r
91 \r
92 BR,\r
93 Jani.\r
94 \r
95 \r
96 [1] id:1399737224-79348-1-git-send-email-cceleri@cs.stanford.edu\r
97 \r
98 \r
99 \r
100 \r
101 > ---\r
102 >  configure | 5 +++++\r
103 >  1 file changed, 5 insertions(+)\r
104 >\r
105 > diff --git a/configure b/configure\r
106 > index 9bde2eb72b0e..feb0e480f86a 100755\r
107 > --- a/configure\r
108 > +++ b/configure\r
109 > @@ -935,3 +935,8 @@ CONFIGURE_CXXFLAGS = -DHAVE_GETLINE=\$(HAVE_GETLINE) \$(GMIME_CFLAGS)    \\\r
110 >  \r
111 >  CONFIGURE_LDFLAGS =  \$(GMIME_LDFLAGS) \$(TALLOC_LDFLAGS) \$(ZLIB_LDFLAGS) \$(XAPIAN_LDFLAGS)\r
112 >  EOF\r
113 > +\r
114 > +# Create sh.config based on Makefile.config values.\r
115 > +# Output will be _var='val', val not containing ' nor \ (skipping multiline).\r
116 > +sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\) *= *\([^\\'\'']*\)$/_\1='\''\2'\''/p' \\r
117 > +     Makefile.config > sh.config\r
118 > -- \r
119 > 1.8.0\r
120 >\r
121 > _______________________________________________\r
122 > notmuch mailing list\r
123 > notmuch@notmuchmail.org\r
124 > http://notmuchmail.org/mailman/listinfo/notmuch\r