1 Return-Path: <tomi.ollila@iki.fi>
\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 arlo.cworth.org (Postfix) with ESMTP id 99C6E6DE1A17
\r
6 for <notmuch@notmuchmail.org>; Wed, 20 May 2015 03:45:34 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org
\r
11 X-Spam-Status: No, score=1.03 tagged_above=-999 required=5 tests=[AWL=0.378,
\r
12 SPF_NEUTRAL=0.652] autolearn=disabled
\r
13 Received: from arlo.cworth.org ([127.0.0.1])
\r
14 by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id Of1qauYB3QPT for <notmuch@notmuchmail.org>;
\r
16 Wed, 20 May 2015 03:45:32 -0700 (PDT)
\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])
\r
18 by arlo.cworth.org (Postfix) with ESMTP id C7E5F6DE19F6
\r
19 for <notmuch@notmuchmail.org>; Wed, 20 May 2015 03:45:31 -0700 (PDT)
\r
20 Received: from guru.guru-group.fi (localhost [IPv6:::1])
\r
21 by guru.guru-group.fi (Postfix) with ESMTP id 0F49A1000F2;
\r
22 Wed, 20 May 2015 13:45:09 +0300 (EEST)
\r
23 From: Tomi Ollila <tomi.ollila@iki.fi>
\r
24 To: David Bremner <david@tethera.net>
\r
25 Subject: Re: [PATCH] configure: Add sanity checking for environment variables
\r
26 In-Reply-To: <1432115106-15806-1-git-send-email-david@tethera.net>
\r
27 References: <m2pp5v7hyb.fsf@guru.guru-group.fi>
\r
28 <1432115106-15806-1-git-send-email-david@tethera.net>
\r
29 User-Agent: Notmuch/0.19+115~g9a981cb (http://notmuchmail.org) Emacs/24.3.1
\r
30 (x86_64-unknown-linux-gnu)
\r
31 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL
\r
32 $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F
\r
33 !)g;OY^,BjTbr)Np:%c_o'jj,Z
\r
34 Date: Wed, 20 May 2015 13:45:08 +0300
\r
35 Message-ID: <m2a8wz34uj.fsf@guru.guru-group.fi>
\r
37 Content-Type: text/plain
\r
38 Cc: notmuch@notmuchmail.org
\r
39 X-BeenThere: notmuch@notmuchmail.org
\r
40 X-Mailman-Version: 2.1.18
\r
42 List-Id: "Use and development of the notmuch mail system."
\r
43 <notmuch.notmuchmail.org>
\r
44 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
45 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
46 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>
\r
47 List-Post: <mailto:notmuch@notmuchmail.org>
\r
48 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
49 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
50 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
51 X-List-Received-Date: Wed, 20 May 2015 10:45:34 -0000
\r
53 On Wed, May 20 2015, David Bremner <david@tethera.net> wrote:
\r
55 > Passing in environment variables incompatible with the compiler may
\r
56 > cause other parts of the configure script to fail in hard to
\r
57 > understand ways, so we abort early.
\r
59 > Gah, I left out the one line I actually wanted feedback on.
\r
61 This version looks simplest and most readable to me (personally i don't
\r
62 like the variable naming but that is just (*))
\r
64 Just 's/${CPPFLAGS} minimal.c/${CPPFLAGS} minimal.c/
\r
68 (*) http://martinfowler.com/bliki/TwoHardThings.html
\r
72 > configure | 32 ++++++++++++++++++++++++++++++--
\r
73 > 1 file changed, 30 insertions(+), 2 deletions(-)
\r
75 > diff --git a/configure b/configure
\r
76 > index 4af7ba9..9b01025 100755
\r
79 > @@ -47,6 +47,7 @@ CC=${CC:-cc}
\r
81 > CFLAGS=${CFLAGS:--g -O2}
\r
82 > CPPFLAGS=${CPPFLAGS:-}
\r
83 > +CXXFLAGS_for_sh=${CXXFLAGS:-${CFLAGS}}
\r
84 > CXXFLAGS=${CXXFLAGS:-\$(CFLAGS)}
\r
85 > LDFLAGS=${LDFLAGS:-}
\r
86 > XAPIAN_CONFIG=${XAPIAN_CONFIG:-xapian-config}
\r
87 > @@ -269,6 +270,35 @@ dependencies are available:
\r
91 > +printf "int main(void){return 0;}\n" > minimal.c
\r
93 > +printf "Sanity checking C compilation environment... "
\r
94 > +if ${CC} ${CFLAGS} ${CPPFLAGS} minimal.c ${LDFLAGS} -o minimal > /dev/null 2>&1
\r
98 > + printf "Fail.\n"
\r
99 > + errors=$((errors + 1))
\r
102 > +printf "Sanity checking C++ compilation environment... "
\r
103 > +if ${CXX} ${CXXFLAGS_for_sh} ${CPPFLAGS} minimal.c ${LDFLAGS} -o minimal > /dev/null 2>&1
\r
107 > + printf "Fail.\n"
\r
108 > + errors=$((errors + 1))
\r
111 > +if [ $errors -gt 0 ]; then
\r
113 > +*** Error: Initial sanity checking of environment failed. Please try
\r
114 > +running configure in a clean environment, and if the problem persists,
\r
117 > + rm -f minimal minimal.c
\r
121 > if pkg-config --version > /dev/null 2>&1; then
\r
122 > have_pkg_config=1
\r
123 > @@ -690,8 +720,6 @@ else
\r
125 > rm -f compat/check_asctime
\r
127 > -printf "int main(void){return 0;}\n" > minimal.c
\r
129 > printf "Checking for rpath support... "
\r
130 > if ${CC} -Wl,--enable-new-dtags -Wl,-rpath,/tmp/ -o minimal minimal.c >/dev/null 2>&1
\r
135 > _______________________________________________
\r
136 > notmuch mailing list
\r
137 > notmuch@notmuchmail.org
\r
138 > http://notmuchmail.org/mailman/listinfo/notmuch
\r