From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 5C5FF431FC2 for ; Tue, 6 May 2014 12:47:15 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0.001 X-Spam-Level: X-Spam-Status: No, score=0.001 tagged_above=-999 required=5 tests=[UNPARSEABLE_RELAY=0.001] 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 oubayKaLdl25 for ; Tue, 6 May 2014 12:47:08 -0700 (PDT) X-Greylist: delayed 395 seconds by postgrey-1.32 at olra; Tue, 06 May 2014 12:47:07 PDT Received: from mail.atelo.org (atelo.org [192.95.27.91]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id EE09E431FAF for ; Tue, 6 May 2014 12:47:07 -0700 (PDT) Received: from coyotlan.Tlalpan (ovo.atelo.org [192.168.1.7]); by mail.atelo.org (OpenSMTPD) with ESMTP id f43138bf; for ; Tue, 6 May 2014 19:40:08 +0000 (UTC) Received: from localhost (1001@localhost [local]); by localhost (OpenSMTPD) with ESMTPA id 5c399ad2; for ; Tue, 6 May 2014 12:40:25 -0700 (PDT) Date: Tue, 6 May 2014 12:40:25 -0700 From: =?utf-8?B?WMSrY8Oy?= To: notmuch@notmuchmail.org Subject: pkg-config zlib check in 3c13bc Message-ID: <20140506194025.GA17097@coyotlan.Tlalpan> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="5vNYLRcllDrimb99" Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.5.23 (2014-03-12) 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: Tue, 06 May 2014 19:47:15 -0000 --5vNYLRcllDrimb99 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit 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ò --5vNYLRcllDrimb99 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-FreeBSD-check-for-zlib-version.patch" >From ca0b168ac01391b4137de504bea2845d39d0fff9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?X=C4=ABc=C3=B2?= 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 < /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 < _byteorder.c < -- 1.9.2 --5vNYLRcllDrimb99--