Re: [PATCH 1/2] Add Google Inc. to AUTHORS as a contributor.
[notmuch-archives.git] / 8d / 434ad825499e29c62a4dfcd48659685e00f7f0
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
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0.294\r
10 X-Spam-Level: \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
18  [87.98.215.224])\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
25  09:45:09 -0000\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
37 Precedence: list\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
48 \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
52 ---\r
53 Gah, I left out the one line I actually wanted feedback on.\r
54 \r
55  configure | 32 ++++++++++++++++++++++++++++++--\r
56  1 file changed, 30 insertions(+), 2 deletions(-)\r
57 \r
58 diff --git a/configure b/configure\r
59 index 4af7ba9..9b01025 100755\r
60 --- a/configure\r
61 +++ b/configure\r
62 @@ -47,6 +47,7 @@ CC=${CC:-cc}\r
63  CXX=${CXX:-c++}\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
71  EOF\r
72  \r
73  errors=0\r
74 +printf "int main(void){return 0;}\n" > minimal.c\r
75 +\r
76 +printf "Sanity checking C compilation environment... "\r
77 +if ${CC} ${CFLAGS} ${CPPFLAGS}  minimal.c ${LDFLAGS} -o minimal > /dev/null 2>&1\r
78 +then\r
79 +    printf "OK.\n"\r
80 +else\r
81 +    printf "Fail.\n"\r
82 +    errors=$((errors + 1))\r
83 +fi\r
84 +\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
87 +then\r
88 +    printf "OK.\n"\r
89 +else\r
90 +    printf "Fail.\n"\r
91 +    errors=$((errors + 1))\r
92 +fi\r
93 +\r
94 +if [ $errors -gt 0 ]; then\r
95 +    cat <<EOF\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
98 +report a bug.\r
99 +EOF\r
100 +    rm -f minimal minimal.c\r
101 +    exit 1\r
102 +fi\r
103  \r
104  if pkg-config --version > /dev/null 2>&1; then\r
105      have_pkg_config=1\r
106 @@ -690,8 +720,6 @@ else\r
107  fi\r
108  rm -f compat/check_asctime\r
109  \r
110 -printf "int main(void){return 0;}\n" > minimal.c\r
111 -\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
114  then\r
115 -- \r
116 2.1.4\r
117 \r