1 Return-Path: <bremner@tesseract.cs.unb.ca>
\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 7DAF96DE19F6
\r
6 for <notmuch@notmuchmail.org>; Wed, 20 May 2015 02:46:59 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org
\r
11 X-Spam-Status: No, score=0.294 tagged_above=-999 required=5 tests=[AWL=0.284,
\r
12 T_HEADER_FROM_DIFFERENT_DOMAINS=0.01] 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 FcUrNwukgyGI for <notmuch@notmuchmail.org>;
\r
16 Wed, 20 May 2015 02:46:57 -0700 (PDT)
\r
17 Received: from mx.xen14.node3324.gplhost.com (gitolite.debian.net
\r
19 by arlo.cworth.org (Postfix) with ESMTPS id 64B3C6DE19E7
\r
20 for <notmuch@notmuchmail.org>; Wed, 20 May 2015 02:46:57 -0700 (PDT)
\r
21 Received: from remotemail by mx.xen14.node3324.gplhost.com with local (Exim
\r
22 4.80) (envelope-from <bremner@tesseract.cs.unb.ca>)
\r
23 id 1Yv0ZM-0003nh-H7; Wed, 20 May 2015 09:45:44 +0000
\r
24 Received: (nullmailer pid 15867 invoked by uid 1000); Wed, 20 May 2015
\r
26 From: David Bremner <david@tethera.net>
\r
27 To: Tomi Ollila <tomi.ollila@iki.fi>, David Bremner <david@tethera.net>
\r
28 Subject: [PATCH] configure: Add sanity checking for environment variables
\r
29 Date: Wed, 20 May 2015 11:45:06 +0200
\r
30 Message-Id: <1432115106-15806-1-git-send-email-david@tethera.net>
\r
31 X-Mailer: git-send-email 2.1.4
\r
32 In-Reply-To: <m2pp5v7hyb.fsf@guru.guru-group.fi>
\r
33 References: <m2pp5v7hyb.fsf@guru.guru-group.fi>
\r
34 Cc: notmuch@notmuchmail.org
\r
35 X-BeenThere: notmuch@notmuchmail.org
\r
36 X-Mailman-Version: 2.1.18
\r
38 List-Id: "Use and development of the notmuch mail system."
\r
39 <notmuch.notmuchmail.org>
\r
40 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
41 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
42 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>
\r
43 List-Post: <mailto:notmuch@notmuchmail.org>
\r
44 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
45 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
46 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
47 X-List-Received-Date: Wed, 20 May 2015 09:46:59 -0000
\r
49 Passing in environment variables incompatible with the compiler may
\r
50 cause other parts of the configure script to fail in hard to
\r
51 understand ways, so we abort early.
\r
53 Gah, I left out the one line I actually wanted feedback on.
\r
55 configure | 32 ++++++++++++++++++++++++++++++--
\r
56 1 file changed, 30 insertions(+), 2 deletions(-)
\r
58 diff --git a/configure b/configure
\r
59 index 4af7ba9..9b01025 100755
\r
62 @@ -47,6 +47,7 @@ CC=${CC:-cc}
\r
64 CFLAGS=${CFLAGS:--g -O2}
\r
65 CPPFLAGS=${CPPFLAGS:-}
\r
66 +CXXFLAGS_for_sh=${CXXFLAGS:-${CFLAGS}}
\r
67 CXXFLAGS=${CXXFLAGS:-\$(CFLAGS)}
\r
68 LDFLAGS=${LDFLAGS:-}
\r
69 XAPIAN_CONFIG=${XAPIAN_CONFIG:-xapian-config}
\r
70 @@ -269,6 +270,35 @@ dependencies are available:
\r
74 +printf "int main(void){return 0;}\n" > minimal.c
\r
76 +printf "Sanity checking C compilation environment... "
\r
77 +if ${CC} ${CFLAGS} ${CPPFLAGS} minimal.c ${LDFLAGS} -o minimal > /dev/null 2>&1
\r
82 + errors=$((errors + 1))
\r
85 +printf "Sanity checking C++ compilation environment... "
\r
86 +if ${CXX} ${CXXFLAGS_for_sh} ${CPPFLAGS} minimal.c ${LDFLAGS} -o minimal > /dev/null 2>&1
\r
91 + errors=$((errors + 1))
\r
94 +if [ $errors -gt 0 ]; then
\r
96 +*** Error: Initial sanity checking of environment failed. Please try
\r
97 +running configure in a clean environment, and if the problem persists,
\r
100 + rm -f minimal minimal.c
\r
104 if pkg-config --version > /dev/null 2>&1; then
\r
106 @@ -690,8 +720,6 @@ else
\r
108 rm -f compat/check_asctime
\r
110 -printf "int main(void){return 0;}\n" > minimal.c
\r
112 printf "Checking for rpath support... "
\r
113 if ${CC} -Wl,--enable-new-dtags -Wl,-rpath,/tmp/ -o minimal minimal.c >/dev/null 2>&1
\r