Re: [PATCH] Fallback check for zlib.
authorTomi Ollila <tomi.ollila@iki.fi>
Sat, 10 May 2014 07:58:12 +0000 (10:58 +0300)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 18:02:34 +0000 (10:02 -0800)
58/7f1b459ef00abfa2d85b159bfaf26e1054ea95 [new file with mode: 0644]

diff --git a/58/7f1b459ef00abfa2d85b159bfaf26e1054ea95 b/58/7f1b459ef00abfa2d85b159bfaf26e1054ea95
new file mode 100644 (file)
index 0000000..7322558
--- /dev/null
@@ -0,0 +1,137 @@
+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 1EB2B431FC0\r
+       for <notmuch@notmuchmail.org>; Sat, 10 May 2014 00:58:28 -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 4HIYIr3PEWeL for <notmuch@notmuchmail.org>;\r
+       Sat, 10 May 2014 00:58:20 -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 8B04A431FBF\r
+       for <notmuch@notmuchmail.org>; Sat, 10 May 2014 00:58:20 -0700 (PDT)\r
+Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
+       by guru.guru-group.fi (Postfix) with ESMTP id B71B51000E5;\r
+       Sat, 10 May 2014 10:58:12 +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: [PATCH] Fallback check for zlib.\r
+In-Reply-To: <1399700023-8041-2-git-send-email-xico@atelo.org>\r
+References: <874n0y5qo5.fsf@maritornes.cs.unb.ca>\r
+       <1399700023-8041-1-git-send-email-xico@atelo.org>\r
+       <1399700023-8041-2-git-send-email-xico@atelo.org>\r
+User-Agent: Notmuch/0.18+11~gbc95cc5 (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: Sat, 10 May 2014 10:58:12 +0300\r
+Message-ID: <m2r442gj57.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: Sat, 10 May 2014 07:58:28 -0000\r
+\r
+On Sat, May 10 2014, X=C4=ABc=C3=B2 <xico@atelo.org> wrote:\r
+\r
+> ---\r
+\r
+I must say I like the patch. One thing I would change:\r
+\r
++    return (ZLIB_VERNUM) < (MINVER) || zlibVersion()[0] !=3D (ZLIB_VERSION=\r
+)[0];\r
+\r
+i.e. short-circuiting potential failure before executing zlibVersion()...\r
+\r
+(parenthesising macros is just extra fanciness I thought just before\r
+sending this email ;D)\r
+\r
+Tomi\r
+\r
+>  compat/have_zlib.c |  6 ++++++\r
+>  configure          | 21 ++++++++++++++++-----\r
+>  2 files changed, 22 insertions(+), 5 deletions(-)\r
+>  create mode 100644 compat/have_zlib.c\r
+>\r
+> diff --git a/compat/have_zlib.c b/compat/have_zlib.c\r
+> new file mode 100644\r
+> index 0000000..998c697\r
+> --- /dev/null\r
+> +++ b/compat/have_zlib.c\r
+> @@ -0,0 +1,6 @@\r
+> +#include <zlib.h>\r
+> +\r
+> +int main(void)\r
+> +{\r
+> +    return zlibVersion()[0] !=3D ZLIB_VERSION[0] || ZLIB_VERNUM < MINVER;\r
+> +}\r
+> diff --git a/configure b/configure\r
+> index 9bde2eb..7a11ded 100755\r
+> --- a/configure\r
+> +++ b/configure\r
+> @@ -340,16 +340,27 @@ else\r
+>      errors=3D$((errors + 1))\r
+>  fi\r
+>=20=20\r
+> -printf "Checking for zlib (>=3D 1.2.5.2)... "\r
+> +zv1=3D1 zv2=3D2 zv3=3D5 zv4=3D1\r
+> +printf "Checking for zlib (>=3D $zv1.$zv2.$zv3.$zv4)... "\r
+>  have_zlib=3D0\r
+> -if pkg-config --atleast-version=3D1.2.5.2 zlib; then\r
+> +if pkg-config --atleast-version=3D$zv1.$zv2.$zv3.$zv4 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
+> +    # Try finding zlib directly (e.g. on FreeBSD)\r
+> +    zlib_cflags=3D\r
+> +    zlib_ldflags=3D-lz\r
+> +    if ${CC} ${zlib_cflags} -DMINVER=3D0x$zv1$zv2$zv3$zv4 -o compat/have=\r
+_zlib "$srcdir"/compat/have_zlib.c ${zlib_ldflags} > /dev/null 2>&1 && ./co=\r
+mpat/have_zlib\r
+> +    then\r
+> +        printf "Yes.\n"\r
+> +        have_zlib=3D1\r
+> +    else\r
+> +        printf "No.\n"\r
+> +        errors=3D$((errors + 1))\r
+> +    fi\r
+> +    rm -f compat/have_zlib\r
+>  fi\r
+>=20=20\r
+>  printf "Checking for talloc development files... "\r
+> @@ -509,7 +520,7 @@ EOF\r
+>      echo "  http://xapian.org/"\r
+>      fi\r
+>      if [ $have_zlib -eq 0 ]; then\r
+> -    echo "  zlib library (>=3D version 1.2.5.2, including development files =\r
+such as headers)"\r
+> +    echo "  zlib library (>=3D version $zv1.$zv2.$zv3.$zv4, including develo=\r
+pment files such as headers)"\r
+>      echo "  http://zlib.net/"\r
+>      echo\r
+>      fi\r
+> --=20\r
+> 1.9.2\r