--- /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 4EB93431FC7\r
+ for <notmuch@notmuchmail.org>; Mon, 12 May 2014 08:22: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 RYGYR-0vovMt for <notmuch@notmuchmail.org>;\r
+ Mon, 12 May 2014 08:22:01 -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 75477431FC2\r
+ for <notmuch@notmuchmail.org>; Mon, 12 May 2014 08:22:01 -0700 (PDT)\r
+Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
+ by guru.guru-group.fi (Postfix) with ESMTP id 47FE2100051;\r
+ Mon, 12 May 2014 18:21:52 +0300 (EEST)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: Felipe Contreras <felipe.contreras@gmail.com>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH] configure: add workaround for systems without zlib.pc\r
+In-Reply-To: <1399864172-28227-1-git-send-email-felipe.contreras@gmail.com>\r
+References: <1399864172-28227-1-git-send-email-felipe.contreras@gmail.com>\r
+User-Agent: Notmuch/0.18+11~gb21401f (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: Mon, 12 May 2014 18:21:51 +0300\r
+Message-ID: <m2wqdrqay8.fsf@guru.guru-group.fi>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\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: Mon, 12 May 2014 15:22:06 -0000\r
+\r
+On Mon, May 12 2014, Felipe Contreras <felipe.contreras@gmail.com> wrote:\r
+\r
+> Some systems (e.g. FreeBSD) might not have installed the appropriate\r
+> pkg-config file as they should. We can workaround the issue by creating\r
+> the .pc file they should have distributed.\r
+\r
+I agree with David that this is easier to follow (and don't have those\r
+sneaky zv? -variables ;D\r
+\r
+2 comments inline.\r
+\r
+>\r
+> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\r
+> ---\r
+> compat/.gitignore | 1 +\r
+> compat/gen_zlib_pc.c | 18 ++++++++++++++++++\r
+> configure | 9 +++++++++\r
+> 3 files changed, 28 insertions(+)\r
+> create mode 100644 compat/.gitignore\r
+> create mode 100644 compat/gen_zlib_pc.c\r
+>\r
+> diff --git a/compat/.gitignore b/compat/.gitignore\r
+> new file mode 100644\r
+> index 0000000..107ba17\r
+> --- /dev/null\r
+> +++ b/compat/.gitignore\r
+> @@ -0,0 +1 @@\r
+> +zlib.pc\r
+> diff --git a/compat/gen_zlib_pc.c b/compat/gen_zlib_pc.c\r
+> new file mode 100644\r
+> index 0000000..198a727\r
+> --- /dev/null\r
+> +++ b/compat/gen_zlib_pc.c\r
+> @@ -0,0 +1,18 @@\r
+> +#include <stdio.h>\r
+> +#include <zlib.h>\r
+> +\r
+> +static const char *template =\r
+> + "prefix=/usr\n"\r
+> + "exec_prefix=${prefix}\n"\r
+> + "libdir=${exec_prefix}/lib\n"\r
+> + "\n"\r
+> + "Name: zlib\n"\r
+> + "Description: zlib compression library\n"\r
+> + "Version: %s\n"\r
+> + "Libs: -lz\n";\r
+\r
+The above is bit different what zlib.pc files have in e.g. Fedora 20 and\r
+Ubuntu 14.04 machines: those have 'Requires: before Libs: (and Cflags:)'\r
+But probably that is unnecessary (and just some sugar coating...?).\r
+\r
+\r
+> +int main(void)\r
+> +{\r
+> + printf(template, ZLIB_VERSION);\r
+> + return 0;\r
+> +}\r
+> diff --git a/configure b/configure\r
+> index 9bde2eb..35dd21f 100755\r
+> --- a/configure\r
+> +++ b/configure\r
+> @@ -340,6 +340,15 @@ else\r
+> errors=$((errors + 1))\r
+> fi\r
+> \r
+> +if ! pkg-config --exists zlib; then\r
+> + ${CC} ${zlib_cflags} -o compat/gen_zlib_pc \\r
+> + "$srcdir"/compat/gen_zlib_pc.c ${zlib_ldflags} > /dev/null 2>&1 &&\r
+> + compat/gen_zlib_pc > compat/zlib.pc &&\r
+> + PKG_CONFIG_PATH="$PKG_CONFIG_PATH":compat &&\r
+\r
+To be consistent what we do elsewhere:\r
+\r
+ PKG_CONFIG_PATH=${PKG_CONFIG_PATH:+$PKG_CONFIG_PATH:}compat &&\r
+\r
+i.e. don't add ':' in case $PKG_CONFIG_PATH is not defined or is empty string.\r
+\r
+\r
+Tomi\r
+\r
+\r
+> + export PKG_CONFIG_PATH\r
+> + rm -f compat/gen_zlib_pc\r
+> +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
+> -- \r
+> 1.9.2+fc1~45~g3953d93\r