--- /dev/null
+Return-Path: <felipe.contreras@gmail.com>\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 4938D431FC0\r
+ for <notmuch@notmuchmail.org>; Sun, 11 May 2014 20:09:47 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.799\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
+ tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+ FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] 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 ezTh+mmvqdcx for <notmuch@notmuchmail.org>;\r
+ Sun, 11 May 2014 20:09:41 -0700 (PDT)\r
+Received: from mail-oa0-f45.google.com (mail-oa0-f45.google.com\r
+ [209.85.219.45]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id B42C3431FBF\r
+ for <notmuch@notmuchmail.org>; Sun, 11 May 2014 20:09:41 -0700 (PDT)\r
+Received: by mail-oa0-f45.google.com with SMTP id l6so7566101oag.18\r
+ for <notmuch@notmuchmail.org>; Sun, 11 May 2014 20:09:41 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+ h=from:to:cc:subject:date:message-id;\r
+ bh=rxFr8Q5FbRLoaviN2g6jUJV51YQNFSrkqdWpTmPkBdA=;\r
+ b=K+rLYKLp928jsAvoZ8kEXGvl0qTeq5hKG+4oydrQXVtZcNijCGkf6BS6q7TRJTeeII\r
+ 7B+dYVbbAyeTBzfyUB3CI4Gv62YKNmmobaP5ll8eelvre//Zec8c9PRsSoOZxqRO5oGM\r
+ rZSgaeCQf+YJCbOKdGO24kUM9jCqhSgTq7E7QA8Dd3aSeyN8Tr8HXuv+4aPTnrC6/HLa\r
+ G0RsFzjAv6Q/tVUco/5OmkCiYSlJ9oCHv6WKMehb8is2u+KRnRl2eyRALdKsHD+2io6X\r
+ 85an6pxbyW96hQswOjHEn9LiD/hJY71m+fbAvuLngYcPImpZkpMnD44ohIgw/iKL65n/\r
+ aWnA==\r
+X-Received: by 10.60.39.131 with SMTP id p3mr30620150oek.44.1399864181125;\r
+ Sun, 11 May 2014 20:09:41 -0700 (PDT)\r
+Received: from localhost (189-211-224-40.static.axtel.net. [189.211.224.40])\r
+ by mx.google.com with ESMTPSA id w8sm35645633oel.14.2014.05.11.20.09.38\r
+ for <multiple recipients>\r
+ (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
+ Sun, 11 May 2014 20:09:39 -0700 (PDT)\r
+From: Felipe Contreras <felipe.contreras@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] configure: add workaround for systems without zlib.pc\r
+Date: Sun, 11 May 2014 22:09:32 -0500\r
+Message-Id: <1399864172-28227-1-git-send-email-felipe.contreras@gmail.com>\r
+X-Mailer: git-send-email 1.9.2+fc1~45~g3953d93\r
+Cc: Tomi Ollila <tomi.ollila@iki.fi>\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 03:09:47 -0000\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
+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
++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
++ 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
+\r