From: Xīcò <xico@atelo.org>
To: notmuch@notmuchmail.org
Subject: pkg-config zlib check in 3c13bc
Date: Tue, 6 May 2014 12:40:25 -0700 [thread overview]
Message-ID: <20140506194025.GA17097@coyotlan.Tlalpan> (raw)
[-- Attachment #1: Type: text/plain, Size: 493 bytes --]
Dear notmuch,
Although notmuch was configuring fine on FreeBSD before 3c13bc, the pkg-config
check introduced for zlib does not work. Indeed, zlib is part of the
base system, and always assumed to be present.
Proposed patch puts platform test before pkg-config checks, and add a
special case for zlib on FreeBSD. uname -U is used to get (numeric) OS version,
and compared to lowest release where at least zlib 1.2.5.2 was available
(that’s FreeBSD 9.1, with zlib 1.2.7).
Best,
--
Xīcò
[-- Attachment #2: 0001-FreeBSD-check-for-zlib-version.patch --]
[-- Type: text/x-diff, Size: 4773 bytes --]
From ca0b168ac01391b4137de504bea2845d39d0fff9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?X=C4=ABc=C3=B2?= <xico@atelo.org>
Date: Tue, 6 May 2014 12:37:32 -0700
Subject: [PATCH 1/1] FreeBSD check for zlib version.
---
configure | 130 +++++++++++++++++++++++++++++++++-----------------------------
1 file changed, 69 insertions(+), 61 deletions(-)
diff --git a/configure b/configure
index 9bde2eb..7204812 100755
--- a/configure
+++ b/configure
@@ -270,6 +270,62 @@ EOF
errors=0
+libdir_in_ldconfig=0
+
+printf "Checking which platform we are on... "
+uname=`uname`
+if [ $uname = "Darwin" ] ; then
+ printf "Mac OS X.\n"
+ platform=MACOSX
+ linker_resolves_library_dependencies=0
+elif [ $uname = "SunOS" ] ; then
+ printf "Solaris.\n"
+ platform=SOLARIS
+ linker_resolves_library_dependencies=0
+elif [ $uname = "FreeBSD" ] ; then
+ printf "FreeBSD.\n"
+ platform=FREEBSD
+ linker_resolves_library_dependencies=0
+elif [ $uname = "OpenBSD" ] ; then
+ printf "OpenBSD.\n"
+ platform=OPENBSD
+ linker_resolves_library_dependencies=0
+elif [ $uname = "Linux" ] || [ $uname = "GNU" ] ; then
+ printf "$uname\n"
+ platform="$uname"
+ linker_resolves_library_dependencies=1
+
+ printf "Checking for $libdir_expanded in ldconfig... "
+ ldconfig_paths=$(/sbin/ldconfig -N -X -v 2>/dev/null | sed -n -e 's,^\(/.*\):\( (.*)\)\?$,\1,p')
+ # Separate ldconfig_paths only on newline (not on any potential
+ # embedded space characters in any filenames). Note, we use a
+ # literal newline in the source here rather than something like:
+ #
+ # IFS=$(printf '\n')
+ #
+ # because the shell's command substitution deletes any trailing newlines.
+ IFS="
+"
+ for path in $ldconfig_paths; do
+ if [ "$path" = "$libdir_expanded" ]; then
+ libdir_in_ldconfig=1
+ fi
+ done
+ IFS=$DEFAULT_IFS
+ if [ "$libdir_in_ldconfig" = '0' ]; then
+ printf "No (will set RPATH)\n"
+ else
+ printf "Yes\n"
+ fi
+else
+ printf "Unknown.\n"
+ cat <<EOF
+
+*** Warning: Unknown platform. Notmuch might or might not build correctly.
+
+EOF
+fi
+
if pkg-config --version > /dev/null 2>&1; then
have_pkg_config=1
else
@@ -342,14 +398,22 @@ fi
printf "Checking for zlib (>= 1.2.5.2)... "
have_zlib=0
-if pkg-config --atleast-version=1.2.5.2 zlib; then
+# zlib is part of base in FreeBSD. version 9.1 included 1.2.7
+if [ $platform = FREEBSD -a `uname -U` -ge 901000 ] ; then
printf "Yes.\n"
have_zlib=1
- zlib_cflags=$(pkg-config --cflags zlib)
- zlib_ldflags=$(pkg-config --libs zlib)
+ zlib_cflags=
+ zlib_ldflags=-lz
else
- printf "No.\n"
- errors=$((errors + 1))
+ if pkg-config --atleast-version=1.2.5.2 zlib; then
+ printf "Yes.\n"
+ have_zlib=1
+ zlib_cflags=$(pkg-config --cflags zlib)
+ zlib_ldflags=$(pkg-config --libs zlib)
+ else
+ printf "No.\n"
+ errors=$((errors + 1))
+ fi
fi
printf "Checking for talloc development files... "
@@ -427,62 +491,6 @@ else
fi
fi
-libdir_in_ldconfig=0
-
-printf "Checking which platform we are on... "
-uname=`uname`
-if [ $uname = "Darwin" ] ; then
- printf "Mac OS X.\n"
- platform=MACOSX
- linker_resolves_library_dependencies=0
-elif [ $uname = "SunOS" ] ; then
- printf "Solaris.\n"
- platform=SOLARIS
- linker_resolves_library_dependencies=0
-elif [ $uname = "FreeBSD" ] ; then
- printf "FreeBSD.\n"
- platform=FREEBSD
- linker_resolves_library_dependencies=0
-elif [ $uname = "OpenBSD" ] ; then
- printf "OpenBSD.\n"
- platform=OPENBSD
- linker_resolves_library_dependencies=0
-elif [ $uname = "Linux" ] || [ $uname = "GNU" ] ; then
- printf "$uname\n"
- platform="$uname"
- linker_resolves_library_dependencies=1
-
- printf "Checking for $libdir_expanded in ldconfig... "
- ldconfig_paths=$(/sbin/ldconfig -N -X -v 2>/dev/null | sed -n -e 's,^\(/.*\):\( (.*)\)\?$,\1,p')
- # Separate ldconfig_paths only on newline (not on any potential
- # embedded space characters in any filenames). Note, we use a
- # literal newline in the source here rather than something like:
- #
- # IFS=$(printf '\n')
- #
- # because the shell's command substitution deletes any trailing newlines.
- IFS="
-"
- for path in $ldconfig_paths; do
- if [ "$path" = "$libdir_expanded" ]; then
- libdir_in_ldconfig=1
- fi
- done
- IFS=$DEFAULT_IFS
- if [ "$libdir_in_ldconfig" = '0' ]; then
- printf "No (will set RPATH)\n"
- else
- printf "Yes\n"
- fi
-else
- printf "Unknown.\n"
- cat <<EOF
-
-*** Warning: Unknown platform. Notmuch might or might not build correctly.
-
-EOF
-fi
-
printf "Checking byte order... "
cat> _byteorder.c <<EOF
#include <stdio.h>
--
1.9.2
next reply other threads:[~2014-05-06 19:47 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-06 19:40 Xīcò [this message]
2014-05-06 20:31 ` pkg-config zlib check in 3c13bc Tomi Ollila
2014-05-08 12:11 ` David Bremner
2014-05-09 20:01 ` Tomi Ollila
2014-05-10 0:46 ` David Bremner
2014-05-10 1:53 ` Xīcò
2014-05-10 2:11 ` David Bremner
2014-05-10 4:01 ` Felipe Contreras
2014-05-10 5:33 ` [PATCH] Fallback check for zlib Xīcò
2014-05-10 5:33 ` Xīcò
2014-05-10 7:58 ` Tomi Ollila
2014-05-10 9:37 ` David Bremner
2014-05-10 10:41 ` Tomi Ollila
2014-05-10 18:44 ` [PATCH] configure: add a fallback " Xīcò
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140506194025.GA17097@coyotlan.Tlalpan \
--to=xico@atelo.org \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).