--- /dev/null
+Return-Path: <tomi.ollila@iki.fi>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by arlo.cworth.org (Postfix) with ESMTP id 99C6E6DE1A17\r
+ for <notmuch@notmuchmail.org>; Wed, 20 May 2015 03:45:34 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 1.03\r
+X-Spam-Level: *\r
+X-Spam-Status: No, score=1.03 tagged_above=-999 required=5 tests=[AWL=0.378,\r
+ SPF_NEUTRAL=0.652] autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id Of1qauYB3QPT for <notmuch@notmuchmail.org>;\r
+ Wed, 20 May 2015 03:45:32 -0700 (PDT)\r
+Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
+ by arlo.cworth.org (Postfix) with ESMTP id C7E5F6DE19F6\r
+ for <notmuch@notmuchmail.org>; Wed, 20 May 2015 03:45:31 -0700 (PDT)\r
+Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
+ by guru.guru-group.fi (Postfix) with ESMTP id 0F49A1000F2;\r
+ Wed, 20 May 2015 13:45:09 +0300 (EEST)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: David Bremner <david@tethera.net>\r
+Subject: Re: [PATCH] configure: Add sanity checking for environment variables\r
+In-Reply-To: <1432115106-15806-1-git-send-email-david@tethera.net>\r
+References: <m2pp5v7hyb.fsf@guru.guru-group.fi>\r
+ <1432115106-15806-1-git-send-email-david@tethera.net>\r
+User-Agent: Notmuch/0.19+115~g9a981cb (http://notmuchmail.org) Emacs/24.3.1\r
+ (x86_64-unknown-linux-gnu)\r
+X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
+ $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
+ !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
+Date: Wed, 20 May 2015 13:45:08 +0300\r
+Message-ID: <m2a8wz34uj.fsf@guru.guru-group.fi>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\r
+Cc: notmuch@notmuchmail.org\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.18\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Wed, 20 May 2015 10:45:34 -0000\r
+\r
+On Wed, May 20 2015, David Bremner <david@tethera.net> wrote:\r
+\r
+> Passing in environment variables incompatible with the compiler may\r
+> cause other parts of the configure script to fail in hard to\r
+> understand ways, so we abort early.\r
+> ---\r
+> Gah, I left out the one line I actually wanted feedback on.\r
+\r
+This version looks simplest and most readable to me (personally i don't\r
+like the variable naming but that is just (*))\r
+\r
+Just 's/${CPPFLAGS} minimal.c/${CPPFLAGS} minimal.c/\r
+\r
+Tomi\r
+\r
+(*) http://martinfowler.com/bliki/TwoHardThings.html\r
+\r
+\r
+>\r
+> configure | 32 ++++++++++++++++++++++++++++++--\r
+> 1 file changed, 30 insertions(+), 2 deletions(-)\r
+>\r
+> diff --git a/configure b/configure\r
+> index 4af7ba9..9b01025 100755\r
+> --- a/configure\r
+> +++ b/configure\r
+> @@ -47,6 +47,7 @@ CC=${CC:-cc}\r
+> CXX=${CXX:-c++}\r
+> CFLAGS=${CFLAGS:--g -O2}\r
+> CPPFLAGS=${CPPFLAGS:-}\r
+> +CXXFLAGS_for_sh=${CXXFLAGS:-${CFLAGS}}\r
+> CXXFLAGS=${CXXFLAGS:-\$(CFLAGS)}\r
+> LDFLAGS=${LDFLAGS:-}\r
+> XAPIAN_CONFIG=${XAPIAN_CONFIG:-xapian-config}\r
+> @@ -269,6 +270,35 @@ dependencies are available:\r
+> EOF\r
+> \r
+> errors=0\r
+> +printf "int main(void){return 0;}\n" > minimal.c\r
+> +\r
+> +printf "Sanity checking C compilation environment... "\r
+> +if ${CC} ${CFLAGS} ${CPPFLAGS} minimal.c ${LDFLAGS} -o minimal > /dev/null 2>&1\r
+> +then\r
+> + printf "OK.\n"\r
+> +else\r
+> + printf "Fail.\n"\r
+> + errors=$((errors + 1))\r
+> +fi\r
+> +\r
+> +printf "Sanity checking C++ compilation environment... "\r
+> +if ${CXX} ${CXXFLAGS_for_sh} ${CPPFLAGS} minimal.c ${LDFLAGS} -o minimal > /dev/null 2>&1\r
+> +then\r
+> + printf "OK.\n"\r
+> +else\r
+> + printf "Fail.\n"\r
+> + errors=$((errors + 1))\r
+> +fi\r
+> +\r
+> +if [ $errors -gt 0 ]; then\r
+> + cat <<EOF\r
+> +*** Error: Initial sanity checking of environment failed. Please try\r
+> +running configure in a clean environment, and if the problem persists,\r
+> +report a bug.\r
+> +EOF\r
+> + rm -f minimal minimal.c\r
+> + exit 1\r
+> +fi\r
+> \r
+> if pkg-config --version > /dev/null 2>&1; then\r
+> have_pkg_config=1\r
+> @@ -690,8 +720,6 @@ else\r
+> fi\r
+> rm -f compat/check_asctime\r
+> \r
+> -printf "int main(void){return 0;}\n" > minimal.c\r
+> -\r
+> printf "Checking for rpath support... "\r
+> if ${CC} -Wl,--enable-new-dtags -Wl,-rpath,/tmp/ -o minimal minimal.c >/dev/null 2>&1\r
+> then\r
+> -- \r
+> 2.1.4\r
+>\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r