--- /dev/null
+Return-Path: <xico@atelo.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id 5C5FF431FC2\r
+ for <notmuch@notmuchmail.org>; Tue, 6 May 2014 12:47:15 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.001\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.001 tagged_above=-999 required=5\r
+ tests=[UNPARSEABLE_RELAY=0.001] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id oubayKaLdl25 for <notmuch@notmuchmail.org>;\r
+ Tue, 6 May 2014 12:47:08 -0700 (PDT)\r
+X-Greylist: delayed 395 seconds by postgrey-1.32 at olra;\r
+ Tue, 06 May 2014 12:47:07 PDT\r
+Received: from mail.atelo.org (atelo.org [192.95.27.91])\r
+ (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id EE09E431FAF\r
+ for <notmuch@notmuchmail.org>; Tue, 6 May 2014 12:47:07 -0700 (PDT)\r
+Received: from coyotlan.Tlalpan (ovo.atelo.org [192.168.1.7]);\r
+ by mail.atelo.org (OpenSMTPD) with ESMTP id f43138bf;\r
+ for <notmuch@notmuchmail.org>; Tue, 6 May 2014 19:40:08 +0000 (UTC)\r
+Received: from localhost (1001@localhost [local]);\r
+ by localhost (OpenSMTPD) with ESMTPA id 5c399ad2;\r
+ for <notmuch@notmuchmail.org>; Tue, 6 May 2014 12:40:25 -0700 (PDT)\r
+Date: Tue, 6 May 2014 12:40:25 -0700\r
+From: =?utf-8?B?WMSrY8Oy?= <xico@atelo.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: pkg-config zlib check in 3c13bc\r
+Message-ID: <20140506194025.GA17097@coyotlan.Tlalpan>\r
+MIME-Version: 1.0\r
+Content-Type: multipart/mixed; boundary="5vNYLRcllDrimb99"\r
+Content-Disposition: inline\r
+Content-Transfer-Encoding: 8bit\r
+User-Agent: Mutt/1.5.23 (2014-03-12)\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\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: Tue, 06 May 2014 19:47:15 -0000\r
+\r
+\r
+--5vNYLRcllDrimb99\r
+Content-Type: text/plain; charset=utf-8\r
+Content-Disposition: inline\r
+Content-Transfer-Encoding: 8bit\r
+\r
+Dear notmuch,\r
+\r
+Although notmuch was configuring fine on FreeBSD before 3c13bc, the pkg-config\r
+check introduced for zlib does not work. Indeed, zlib is part of the\r
+base system, and always assumed to be present.\r
+\r
+Proposed patch puts platform test before pkg-config checks, and add a\r
+special case for zlib on FreeBSD. uname -U is used to get (numeric) OS version,\r
+and compared to lowest release where at least zlib 1.2.5.2 was available\r
+(that’s FreeBSD 9.1, with zlib 1.2.7).\r
+\r
+Best,\r
+\r
+--\r
+Xīcò\r
+\r
+--5vNYLRcllDrimb99\r
+Content-Type: text/x-diff; charset=us-ascii\r
+Content-Disposition: attachment;\r
+ filename="0001-FreeBSD-check-for-zlib-version.patch"\r
+\r
+>From ca0b168ac01391b4137de504bea2845d39d0fff9 Mon Sep 17 00:00:00 2001\r
+From: =?UTF-8?q?X=C4=ABc=C3=B2?= <xico@atelo.org>\r
+Date: Tue, 6 May 2014 12:37:32 -0700\r
+Subject: [PATCH 1/1] FreeBSD check for zlib version.\r
+\r
+---\r
+ configure | 130 +++++++++++++++++++++++++++++++++-----------------------------\r
+ 1 file changed, 69 insertions(+), 61 deletions(-)\r
+\r
+diff --git a/configure b/configure\r
+index 9bde2eb..7204812 100755\r
+--- a/configure\r
++++ b/configure\r
+@@ -270,6 +270,62 @@ EOF\r
+ \r
+ errors=0\r
+ \r
++libdir_in_ldconfig=0\r
++\r
++printf "Checking which platform we are on... "\r
++uname=`uname`\r
++if [ $uname = "Darwin" ] ; then\r
++ printf "Mac OS X.\n"\r
++ platform=MACOSX\r
++ linker_resolves_library_dependencies=0\r
++elif [ $uname = "SunOS" ] ; then\r
++ printf "Solaris.\n"\r
++ platform=SOLARIS\r
++ linker_resolves_library_dependencies=0\r
++elif [ $uname = "FreeBSD" ] ; then\r
++ printf "FreeBSD.\n"\r
++ platform=FREEBSD\r
++ linker_resolves_library_dependencies=0\r
++elif [ $uname = "OpenBSD" ] ; then\r
++ printf "OpenBSD.\n"\r
++ platform=OPENBSD\r
++ linker_resolves_library_dependencies=0\r
++elif [ $uname = "Linux" ] || [ $uname = "GNU" ] ; then\r
++ printf "$uname\n"\r
++ platform="$uname"\r
++ linker_resolves_library_dependencies=1\r
++\r
++ printf "Checking for $libdir_expanded in ldconfig... "\r
++ ldconfig_paths=$(/sbin/ldconfig -N -X -v 2>/dev/null | sed -n -e 's,^\(/.*\):\( (.*)\)\?$,\1,p')\r
++ # Separate ldconfig_paths only on newline (not on any potential\r
++ # embedded space characters in any filenames). Note, we use a\r
++ # literal newline in the source here rather than something like:\r
++ #\r
++ # IFS=$(printf '\n')\r
++ #\r
++ # because the shell's command substitution deletes any trailing newlines.\r
++ IFS="\r
++"\r
++ for path in $ldconfig_paths; do\r
++ if [ "$path" = "$libdir_expanded" ]; then\r
++ libdir_in_ldconfig=1\r
++ fi\r
++ done\r
++ IFS=$DEFAULT_IFS\r
++ if [ "$libdir_in_ldconfig" = '0' ]; then\r
++ printf "No (will set RPATH)\n"\r
++ else\r
++ printf "Yes\n"\r
++ fi\r
++else\r
++ printf "Unknown.\n"\r
++ cat <<EOF\r
++\r
++*** Warning: Unknown platform. Notmuch might or might not build correctly.\r
++\r
++EOF\r
++fi\r
++\r
+ if pkg-config --version > /dev/null 2>&1; then\r
+ have_pkg_config=1\r
+ else\r
+@@ -342,14 +398,22 @@ fi\r
+ \r
+ printf "Checking for zlib (>= 1.2.5.2)... "\r
+ have_zlib=0\r
+-if pkg-config --atleast-version=1.2.5.2 zlib; then\r
++# zlib is part of base in FreeBSD. version 9.1 included 1.2.7\r
++if [ $platform = FREEBSD -a `uname -U` -ge 901000 ] ; then\r
+ printf "Yes.\n"\r
+ have_zlib=1\r
+- zlib_cflags=$(pkg-config --cflags zlib)\r
+- zlib_ldflags=$(pkg-config --libs zlib)\r
++ zlib_cflags=\r
++ zlib_ldflags=-lz\r
+ else\r
+- printf "No.\n"\r
+- errors=$((errors + 1))\r
++ if pkg-config --atleast-version=1.2.5.2 zlib; then\r
++ printf "Yes.\n"\r
++ have_zlib=1\r
++ zlib_cflags=$(pkg-config --cflags zlib)\r
++ zlib_ldflags=$(pkg-config --libs zlib)\r
++ else\r
++ printf "No.\n"\r
++ errors=$((errors + 1))\r
++ fi\r
+ fi\r
+ \r
+ printf "Checking for talloc development files... "\r
+@@ -427,62 +491,6 @@ else\r
+ fi\r
+ fi\r
+ \r
+-libdir_in_ldconfig=0\r
+-\r
+-printf "Checking which platform we are on... "\r
+-uname=`uname`\r
+-if [ $uname = "Darwin" ] ; then\r
+- printf "Mac OS X.\n"\r
+- platform=MACOSX\r
+- linker_resolves_library_dependencies=0\r
+-elif [ $uname = "SunOS" ] ; then\r
+- printf "Solaris.\n"\r
+- platform=SOLARIS\r
+- linker_resolves_library_dependencies=0\r
+-elif [ $uname = "FreeBSD" ] ; then\r
+- printf "FreeBSD.\n"\r
+- platform=FREEBSD\r
+- linker_resolves_library_dependencies=0\r
+-elif [ $uname = "OpenBSD" ] ; then\r
+- printf "OpenBSD.\n"\r
+- platform=OPENBSD\r
+- linker_resolves_library_dependencies=0\r
+-elif [ $uname = "Linux" ] || [ $uname = "GNU" ] ; then\r
+- printf "$uname\n"\r
+- platform="$uname"\r
+- linker_resolves_library_dependencies=1\r
+-\r
+- printf "Checking for $libdir_expanded in ldconfig... "\r
+- ldconfig_paths=$(/sbin/ldconfig -N -X -v 2>/dev/null | sed -n -e 's,^\(/.*\):\( (.*)\)\?$,\1,p')\r
+- # Separate ldconfig_paths only on newline (not on any potential\r
+- # embedded space characters in any filenames). Note, we use a\r
+- # literal newline in the source here rather than something like:\r
+- #\r
+- # IFS=$(printf '\n')\r
+- #\r
+- # because the shell's command substitution deletes any trailing newlines.\r
+- IFS="\r
+-"\r
+- for path in $ldconfig_paths; do\r
+- if [ "$path" = "$libdir_expanded" ]; then\r
+- libdir_in_ldconfig=1\r
+- fi\r
+- done\r
+- IFS=$DEFAULT_IFS\r
+- if [ "$libdir_in_ldconfig" = '0' ]; then\r
+- printf "No (will set RPATH)\n"\r
+- else\r
+- printf "Yes\n"\r
+- fi\r
+-else\r
+- printf "Unknown.\n"\r
+- cat <<EOF\r
+-\r
+-*** Warning: Unknown platform. Notmuch might or might not build correctly.\r
+-\r
+-EOF\r
+-fi\r
+-\r
+ printf "Checking byte order... "\r
+ cat> _byteorder.c <<EOF\r
+ #include <stdio.h>\r
+-- \r
+1.9.2\r
+\r
+\r
+--5vNYLRcllDrimb99--\r