--- /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 olra.theworths.org (Postfix) with ESMTP id 24F39431FAF\r
+ for <notmuch@notmuchmail.org>; Tue, 6 May 2014 13:32:06 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+ 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 s9jBMqTcM1Mc for <notmuch@notmuchmail.org>;\r
+ Tue, 6 May 2014 13:31:58 -0700 (PDT)\r
+Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
+ by olra.theworths.org (Postfix) with ESMTP id 3B185431FC2\r
+ for <notmuch@notmuchmail.org>; Tue, 6 May 2014 13:31:58 -0700 (PDT)\r
+Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
+ by guru.guru-group.fi (Postfix) with ESMTP id 9DA691000E5;\r
+ Tue, 6 May 2014 23:31:53 +0300 (EEST)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: =?utf-8?B?WMSrY8Oy?= <xico@atelo.org>, notmuch@notmuchmail.org\r
+Subject: Re: pkg-config zlib check in 3c13bc\r
+In-Reply-To: <20140506194025.GA17097@coyotlan.Tlalpan>\r
+References: <20140506194025.GA17097@coyotlan.Tlalpan>\r
+User-Agent: Notmuch/0.18+12~gbfbd199 (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: Tue, 06 May 2014 23:31:53 +0300\r
+Message-ID: <m2mweuhcna.fsf@guru.guru-group.fi>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=utf-8\r
+Content-Transfer-Encoding: quoted-printable\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 20:32:06 -0000\r
+\r
+On Tue, May 06 2014, X=C4=ABc=C3=B2 <xico@atelo.org> wrote:\r
+\r
+> Dear notmuch,\r
+>\r
+> Although notmuch was configuring fine on FreeBSD before 3c13bc, the pkg-c=\r
+onfig\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 ve=\r
+rsion,\r
+> and compared to lowest release where at least zlib 1.2.5.2 was available\r
+> (that=E2=80=99s FreeBSD 9.1, with zlib 1.2.7).\r
+>\r
+> Best,\r
+\r
+This line:\r
+if [ $platform =3D FREEBSD -a `uname -U` -ge 901000 ] ; then\r
+\r
+fails on systems where uname does not have -U option\r
+as `uname -U` is executed always...\r
+\r
+if [ $platform =3D FREEBSD ] && [ "`uname -U`" -ge 901000 ] ; then\r
+\r
+would work better there...\r
+\r
+But, I'd like suggest alternate option to create a test c program\r
+and test whether it compiles (analogous to what there is already\r
+done with many other checks) -- this same would apply to fdatasync()\r
+case too.\r
+\r
+If we cared about cross-compilability one could also do\r
+\r
+zlib_vernum=3D$(printf '#include <zlib.h>\nZLIB_VERNUM' | gcc -E - | sed -n=\r
+ '$ s/^0x/0x/p')\r
+\r
+if [ $((${zlib_vernum:-0})) -ge 4690 ]; then # 4690 =3D=3D 0x1252\r
+ printf "Yes\n"\r
+ ...\r
+\r
+But that would be sooooo inconsistent what we have now\r
+(and possibly fragile?)\r
+\r
+> --\r
+> X=C4=ABc=C3=B2\r
+\r
+\r
+Tomi\r
+\r
+\r
+>>From ca0b168ac01391b4137de504bea2845d39d0fff9 Mon Sep 17 00:00:00 2001\r
+> From: =3D?UTF-8?q?X=3DC4=3DABc=3DC3=3DB2?=3D <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
+------\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
+>=20=20\r
+> errors=3D0\r
+>=20=20\r
+> +libdir_in_ldconfig=3D0\r
+> +\r
+> +printf "Checking which platform we are on... "\r
+> +uname=3D`uname`\r
+> +if [ $uname =3D "Darwin" ] ; then\r
+> + printf "Mac OS X.\n"\r
+> + platform=3DMACOSX\r
+> + linker_resolves_library_dependencies=3D0\r
+> +elif [ $uname =3D "SunOS" ] ; then\r
+> + printf "Solaris.\n"\r
+> + platform=3DSOLARIS\r
+> + linker_resolves_library_dependencies=3D0\r
+> +elif [ $uname =3D "FreeBSD" ] ; then\r
+> + printf "FreeBSD.\n"\r
+> + platform=3DFREEBSD\r
+> + linker_resolves_library_dependencies=3D0\r
+> +elif [ $uname =3D "OpenBSD" ] ; then\r
+> + printf "OpenBSD.\n"\r
+> + platform=3DOPENBSD\r
+> + linker_resolves_library_dependencies=3D0\r
+> +elif [ $uname =3D "Linux" ] || [ $uname =3D "GNU" ] ; then\r
+> + printf "$uname\n"\r
+> + platform=3D"$uname"\r
+> + linker_resolves_library_dependencies=3D1\r
+> +\r
+> + printf "Checking for $libdir_expanded in ldconfig... "\r
+> + ldconfig_paths=3D$(/sbin/ldconfig -N -X -v 2>/dev/null | sed -n -e '=\r
+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=3D$(printf '\n')\r
+> + #\r
+> + # because the shell's command substitution deletes any trailing newl=\r
+ines.\r
+> + IFS=3D"\r
+> +"\r
+> + for path in $ldconfig_paths; do\r
+> + if [ "$path" =3D "$libdir_expanded" ]; then\r
+> + libdir_in_ldconfig=3D1\r
+> + fi\r
+> + done\r
+> + IFS=3D$DEFAULT_IFS\r
+> + if [ "$libdir_in_ldconfig" =3D '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 correctl=\r
+y.\r
+> +\r
+> +EOF\r
+> +fi\r
+> +\r
+> if pkg-config --version > /dev/null 2>&1; then\r
+> have_pkg_config=3D1\r
+> else\r
+> @@ -342,14 +398,22 @@ fi\r
+>=20=20\r
+> printf "Checking for zlib (>=3D 1.2.5.2)... "\r
+> have_zlib=3D0\r
+> -if pkg-config --atleast-version=3D1.2.5.2 zlib; then\r
+> +# zlib is part of base in FreeBSD. version 9.1 included 1.2.7\r
+> +if [ $platform =3D FREEBSD -a `uname -U` -ge 901000 ] ; then\r
+> printf "Yes.\n"\r
+> have_zlib=3D1\r
+> - zlib_cflags=3D$(pkg-config --cflags zlib)\r
+> - zlib_ldflags=3D$(pkg-config --libs zlib)\r
+> + zlib_cflags=3D\r
+> + zlib_ldflags=3D-lz\r
+> else\r
+> - printf "No.\n"\r
+> - errors=3D$((errors + 1))\r
+> + if pkg-config --atleast-version=3D1.2.5.2 zlib; then\r
+> + printf "Yes.\n"\r
+> + have_zlib=3D1\r
+> + zlib_cflags=3D$(pkg-config --cflags zlib)\r
+> + zlib_ldflags=3D$(pkg-config --libs zlib)\r
+> + else\r
+> + printf "No.\n"\r
+> + errors=3D$((errors + 1))\r
+> + fi\r
+> fi\r
+>=20=20\r
+> printf "Checking for talloc development files... "\r
+> @@ -427,62 +491,6 @@ else\r
+> fi\r
+> fi\r
+>=20=20\r
+> -libdir_in_ldconfig=3D0\r
+> -\r
+> -printf "Checking which platform we are on... "\r
+> -uname=3D`uname`\r
+> -if [ $uname =3D "Darwin" ] ; then\r
+> - printf "Mac OS X.\n"\r
+> - platform=3DMACOSX\r
+> - linker_resolves_library_dependencies=3D0\r
+> -elif [ $uname =3D "SunOS" ] ; then\r
+> - printf "Solaris.\n"\r
+> - platform=3DSOLARIS\r
+> - linker_resolves_library_dependencies=3D0\r
+> -elif [ $uname =3D "FreeBSD" ] ; then\r
+> - printf "FreeBSD.\n"\r
+> - platform=3DFREEBSD\r
+> - linker_resolves_library_dependencies=3D0\r
+> -elif [ $uname =3D "OpenBSD" ] ; then\r
+> - printf "OpenBSD.\n"\r
+> - platform=3DOPENBSD\r
+> - linker_resolves_library_dependencies=3D0\r
+> -elif [ $uname =3D "Linux" ] || [ $uname =3D "GNU" ] ; then\r
+> - printf "$uname\n"\r
+> - platform=3D"$uname"\r
+> - linker_resolves_library_dependencies=3D1\r
+> -\r
+> - printf "Checking for $libdir_expanded in ldconfig... "\r
+> - ldconfig_paths=3D$(/sbin/ldconfig -N -X -v 2>/dev/null | sed -n -e '=\r
+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=3D$(printf '\n')\r
+> - #\r
+> - # because the shell's command substitution deletes any trailing newl=\r
+ines.\r
+> - IFS=3D"\r
+> -"\r
+> - for path in $ldconfig_paths; do\r
+> - if [ "$path" =3D "$libdir_expanded" ]; then\r
+> - libdir_in_ldconfig=3D1\r
+> - fi\r
+> - done\r
+> - IFS=3D$DEFAULT_IFS\r
+> - if [ "$libdir_in_ldconfig" =3D '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 correctl=\r
+y.\r
+> -\r
+> -EOF\r
+> -fi\r
+> -\r
+> printf "Checking byte order... "\r
+> cat> _byteorder.c <<EOF\r
+> #include <stdio.h>\r
+> --=20\r
+> 1.9.2\r
+>\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r