Re: [RFC PATCH] test: add devel/test-in-docker.sh
[notmuch-archives.git] / 5f / 6453b412db4a78f1180c3663cf85e131082669
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 274616DE137E\r
6  for <notmuch@notmuchmail.org>; Tue, 19 May 2015 13:54:59 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0.3\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0.3 tagged_above=-999 required=5 tests=[AWL=0.290,\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 Uji9Xiw_BS80 for <notmuch@notmuchmail.org>;\r
16  Tue, 19 May 2015 13:54:57 -0700 (PDT)\r
17 Received: from mx.xen14.node3324.gplhost.com (gitolite.debian.net\r
18  [87.98.215.224])\r
19  by arlo.cworth.org (Postfix) with ESMTPS id 4230F6DE10F8\r
20  for <notmuch@notmuchmail.org>; Tue, 19 May 2015 13:54:56 -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 1YuoVn-0001Py-6M; Tue, 19 May 2015 20:53:15 +0000\r
24 Received: (nullmailer pid 26675 invoked by uid 1000); Tue, 19 May 2015\r
25  20:52:14 -0000\r
26 From: David Bremner <david@tethera.net>\r
27 To: Ronny Chevalier <chevalier.ronny@gmail.com>, David Bremner\r
28  <david@tethera.net>\r
29 Subject: [PATCH] configure: Add sanity checking for environment variables\r
30 Date: Tue, 19 May 2015 22:52:08 +0200\r
31 Message-Id: <1432068728-26587-1-git-send-email-david@tethera.net>\r
32 X-Mailer: git-send-email 2.1.4\r
33 In-Reply-To:\r
34  <CABPZE7+zDwFj7Y1OMU0DVwpwUedK6qUZLQcKEZTMNdRr0A=NeQ@mail.gmail.com>\r
35 References:\r
36  <CABPZE7+zDwFj7Y1OMU0DVwpwUedK6qUZLQcKEZTMNdRr0A=NeQ@mail.gmail.com>\r
37 Cc: notmuch@notmuchmail.org\r
38 X-BeenThere: notmuch@notmuchmail.org\r
39 X-Mailman-Version: 2.1.18\r
40 Precedence: list\r
41 List-Id: "Use and development of the notmuch mail system."\r
42  <notmuch.notmuchmail.org>\r
43 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
44  <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
45 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
46 List-Post: <mailto:notmuch@notmuchmail.org>\r
47 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
48 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
49  <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
50 X-List-Received-Date: Tue, 19 May 2015 20:54:59 -0000\r
51 \r
52 Passing in environment variables incompatible with the compiler may\r
53 cause other parts of the configure script to fail in hard to\r
54 understand ways, so we abort early.\r
55 ---\r
56 \r
57 This doesn't actually fix the problem Ronny points out, but a more\r
58 serious one where configure can actually fail when using gcc, if\r
59 e.g. nonsense is passed in CFLAGS.\r
60 \r
61  configure | 30 ++++++++++++++++++++++++++++--\r
62  1 file changed, 28 insertions(+), 2 deletions(-)\r
63 \r
64 diff --git a/configure b/configure\r
65 index 4af7ba9..cf618e8 100755\r
66 --- a/configure\r
67 +++ b/configure\r
68 @@ -269,6 +269,34 @@ dependencies are available:\r
69  EOF\r
70  \r
71  errors=0\r
72 +printf "int main(void){return 0;}\n" > minimal.c\r
73 +\r
74 +printf "Sanity checking C compilation environment... "\r
75 +if ${CC} ${CFLAGS} ${CPPFLAGS}  minimal.c ${LDFLAGS} -o minimal > /dev/null 2>&1\r
76 +then\r
77 +    printf "Ok.\n"\r
78 +else\r
79 +    printf "Fail.\n"\r
80 +    errors=$((errors + 1))\r
81 +fi\r
82 +\r
83 +printf "Sanity checking C++ compilation environment... "\r
84 +if ${CXX} ${CXXFLAGS} ${CPPFLAGS}  minimal.c ${LDFLAGS} -o minimal > /dev/null 2>&1\r
85 +then\r
86 +    printf "Ok.\n"\r
87 +else\r
88 +    printf "Fail.\n"\r
89 +    errors=$((errors + 1))\r
90 +fi\r
91 +\r
92 +if [ $errors -gt 0 ]; then\r
93 +    cat <<EOF\r
94 +*** Error: Initial sanity checking of environment failed.  Please try\r
95 +running configure in a clean environment, and if the problem persists,\r
96 +report a bug.\r
97 +EOF\r
98 +    exit 1\r
99 +fi\r
100  \r
101  if pkg-config --version > /dev/null 2>&1; then\r
102      have_pkg_config=1\r
103 @@ -690,8 +718,6 @@ else\r
104  fi\r
105  rm -f compat/check_asctime\r
106  \r
107 -printf "int main(void){return 0;}\n" > minimal.c\r
108 -\r
109  printf "Checking for rpath support... "\r
110  if ${CC} -Wl,--enable-new-dtags -Wl,-rpath,/tmp/ -o minimal minimal.c >/dev/null 2>&1\r
111  then\r
112 -- \r
113 2.1.4\r
114 \r