From d281b19afec12e68bbd42ee853e40417e6a656d5 Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Mon, 12 May 2014 22:09:32 +1900 Subject: [PATCH] [PATCH] configure: add workaround for systems without zlib.pc --- 91/86d51c21b1ca0bd9b4e2b3f229c98d2ec8316b | 128 ++++++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 91/86d51c21b1ca0bd9b4e2b3f229c98d2ec8316b diff --git a/91/86d51c21b1ca0bd9b4e2b3f229c98d2ec8316b b/91/86d51c21b1ca0bd9b4e2b3f229c98d2ec8316b new file mode 100644 index 000000000..b61fbb84f --- /dev/null +++ b/91/86d51c21b1ca0bd9b4e2b3f229c98d2ec8316b @@ -0,0 +1,128 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 4938D431FC0 + for ; Sun, 11 May 2014 20:09:47 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.799 +X-Spam-Level: +X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id ezTh+mmvqdcx for ; + Sun, 11 May 2014 20:09:41 -0700 (PDT) +Received: from mail-oa0-f45.google.com (mail-oa0-f45.google.com + [209.85.219.45]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id B42C3431FBF + for ; Sun, 11 May 2014 20:09:41 -0700 (PDT) +Received: by mail-oa0-f45.google.com with SMTP id l6so7566101oag.18 + for ; Sun, 11 May 2014 20:09:41 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=from:to:cc:subject:date:message-id; + bh=rxFr8Q5FbRLoaviN2g6jUJV51YQNFSrkqdWpTmPkBdA=; + b=K+rLYKLp928jsAvoZ8kEXGvl0qTeq5hKG+4oydrQXVtZcNijCGkf6BS6q7TRJTeeII + 7B+dYVbbAyeTBzfyUB3CI4Gv62YKNmmobaP5ll8eelvre//Zec8c9PRsSoOZxqRO5oGM + rZSgaeCQf+YJCbOKdGO24kUM9jCqhSgTq7E7QA8Dd3aSeyN8Tr8HXuv+4aPTnrC6/HLa + G0RsFzjAv6Q/tVUco/5OmkCiYSlJ9oCHv6WKMehb8is2u+KRnRl2eyRALdKsHD+2io6X + 85an6pxbyW96hQswOjHEn9LiD/hJY71m+fbAvuLngYcPImpZkpMnD44ohIgw/iKL65n/ + aWnA== +X-Received: by 10.60.39.131 with SMTP id p3mr30620150oek.44.1399864181125; + Sun, 11 May 2014 20:09:41 -0700 (PDT) +Received: from localhost (189-211-224-40.static.axtel.net. [189.211.224.40]) + by mx.google.com with ESMTPSA id w8sm35645633oel.14.2014.05.11.20.09.38 + for + (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); + Sun, 11 May 2014 20:09:39 -0700 (PDT) +From: Felipe Contreras +To: notmuch@notmuchmail.org +Subject: [PATCH] configure: add workaround for systems without zlib.pc +Date: Sun, 11 May 2014 22:09:32 -0500 +Message-Id: <1399864172-28227-1-git-send-email-felipe.contreras@gmail.com> +X-Mailer: git-send-email 1.9.2+fc1~45~g3953d93 +Cc: Tomi Ollila +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Mon, 12 May 2014 03:09:47 -0000 + +Some systems (e.g. FreeBSD) might not have installed the appropriate +pkg-config file as they should. We can workaround the issue by creating +the .pc file they should have distributed. + +Signed-off-by: Felipe Contreras +--- + compat/.gitignore | 1 + + compat/gen_zlib_pc.c | 18 ++++++++++++++++++ + configure | 9 +++++++++ + 3 files changed, 28 insertions(+) + create mode 100644 compat/.gitignore + create mode 100644 compat/gen_zlib_pc.c + +diff --git a/compat/.gitignore b/compat/.gitignore +new file mode 100644 +index 0000000..107ba17 +--- /dev/null ++++ b/compat/.gitignore +@@ -0,0 +1 @@ ++zlib.pc +diff --git a/compat/gen_zlib_pc.c b/compat/gen_zlib_pc.c +new file mode 100644 +index 0000000..198a727 +--- /dev/null ++++ b/compat/gen_zlib_pc.c +@@ -0,0 +1,18 @@ ++#include ++#include ++ ++static const char *template = ++ "prefix=/usr\n" ++ "exec_prefix=${prefix}\n" ++ "libdir=${exec_prefix}/lib\n" ++ "\n" ++ "Name: zlib\n" ++ "Description: zlib compression library\n" ++ "Version: %s\n" ++ "Libs: -lz\n"; ++ ++int main(void) ++{ ++ printf(template, ZLIB_VERSION); ++ return 0; ++} +diff --git a/configure b/configure +index 9bde2eb..35dd21f 100755 +--- a/configure ++++ b/configure +@@ -340,6 +340,15 @@ else + errors=$((errors + 1)) + fi + ++if ! pkg-config --exists zlib; then ++ ${CC} ${zlib_cflags} -o compat/gen_zlib_pc \ ++ "$srcdir"/compat/gen_zlib_pc.c ${zlib_ldflags} > /dev/null 2>&1 && ++ compat/gen_zlib_pc > compat/zlib.pc && ++ PKG_CONFIG_PATH="$PKG_CONFIG_PATH":compat && ++ export PKG_CONFIG_PATH ++ rm -f compat/gen_zlib_pc ++fi ++ + printf "Checking for zlib (>= 1.2.5.2)... " + have_zlib=0 + if pkg-config --atleast-version=1.2.5.2 zlib; then +-- +1.9.2+fc1~45~g3953d93 + -- 2.26.2