From 58fe23dee10b2cf54a190a6ba8ef9b75921c8561 Mon Sep 17 00:00:00 2001 From: Tomi Ollila Date: Tue, 6 May 2014 23:31:53 +0300 Subject: [PATCH] Re: pkg-config zlib check in 3c13bc --- 66/f240009857da2a09957c2f0e973a0bbbbb9d4c | 283 ++++++++++++++++++++++ 1 file changed, 283 insertions(+) create mode 100644 66/f240009857da2a09957c2f0e973a0bbbbb9d4c diff --git a/66/f240009857da2a09957c2f0e973a0bbbbb9d4c b/66/f240009857da2a09957c2f0e973a0bbbbb9d4c new file mode 100644 index 000000000..7e00770b2 --- /dev/null +++ b/66/f240009857da2a09957c2f0e973a0bbbbb9d4c @@ -0,0 +1,283 @@ +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 24F39431FAF + for ; Tue, 6 May 2014 13:32:06 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + 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 s9jBMqTcM1Mc for ; + Tue, 6 May 2014 13:31:58 -0700 (PDT) +Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) + by olra.theworths.org (Postfix) with ESMTP id 3B185431FC2 + for ; Tue, 6 May 2014 13:31:58 -0700 (PDT) +Received: from guru.guru-group.fi (localhost [IPv6:::1]) + by guru.guru-group.fi (Postfix) with ESMTP id 9DA691000E5; + Tue, 6 May 2014 23:31:53 +0300 (EEST) +From: Tomi Ollila +To: =?utf-8?B?WMSrY8Oy?= , notmuch@notmuchmail.org +Subject: Re: pkg-config zlib check in 3c13bc +In-Reply-To: <20140506194025.GA17097@coyotlan.Tlalpan> +References: <20140506194025.GA17097@coyotlan.Tlalpan> +User-Agent: Notmuch/0.18+12~gbfbd199 (http://notmuchmail.org) Emacs/24.3.1 + (x86_64-unknown-linux-gnu) +X-Face: HhBM'cA~ +MIME-Version: 1.0 +Content-Type: text/plain; charset=utf-8 +Content-Transfer-Encoding: quoted-printable +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 20:32:06 -0000 + +On Tue, May 06 2014, X=C4=ABc=C3=B2 wrote: + +> Dear notmuch, +> +> Although notmuch was configuring fine on FreeBSD before 3c13bc, the pkg-c= +onfig +> 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 ve= +rsion, +> and compared to lowest release where at least zlib 1.2.5.2 was available +> (that=E2=80=99s FreeBSD 9.1, with zlib 1.2.7). +> +> Best, + +This line: +if [ $platform =3D FREEBSD -a `uname -U` -ge 901000 ] ; then + +fails on systems where uname does not have -U option +as `uname -U` is executed always... + +if [ $platform =3D FREEBSD ] && [ "`uname -U`" -ge 901000 ] ; then + +would work better there... + +But, I'd like suggest alternate option to create a test c program +and test whether it compiles (analogous to what there is already +done with many other checks) -- this same would apply to fdatasync() +case too. + +If we cared about cross-compilability one could also do + +zlib_vernum=3D$(printf '#include \nZLIB_VERNUM' | gcc -E - | sed -n= + '$ s/^0x/0x/p') + +if [ $((${zlib_vernum:-0})) -ge 4690 ]; then # 4690 =3D=3D 0x1252 + printf "Yes\n" + ... + +But that would be sooooo inconsistent what we have now +(and possibly fragile?) + +> -- +> X=C4=ABc=C3=B2 + + +Tomi + + +>>From ca0b168ac01391b4137de504bea2845d39d0fff9 Mon Sep 17 00:00:00 2001 +> From: =3D?UTF-8?q?X=3DC4=3DABc=3DC3=3DB2?=3D +> 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 +>=20=20 +> errors=3D0 +>=20=20 +> +libdir_in_ldconfig=3D0 +> + +> +printf "Checking which platform we are on... " +> +uname=3D`uname` +> +if [ $uname =3D "Darwin" ] ; then +> + printf "Mac OS X.\n" +> + platform=3DMACOSX +> + linker_resolves_library_dependencies=3D0 +> +elif [ $uname =3D "SunOS" ] ; then +> + printf "Solaris.\n" +> + platform=3DSOLARIS +> + linker_resolves_library_dependencies=3D0 +> +elif [ $uname =3D "FreeBSD" ] ; then +> + printf "FreeBSD.\n" +> + platform=3DFREEBSD +> + linker_resolves_library_dependencies=3D0 +> +elif [ $uname =3D "OpenBSD" ] ; then +> + printf "OpenBSD.\n" +> + platform=3DOPENBSD +> + linker_resolves_library_dependencies=3D0 +> +elif [ $uname =3D "Linux" ] || [ $uname =3D "GNU" ] ; then +> + printf "$uname\n" +> + platform=3D"$uname" +> + linker_resolves_library_dependencies=3D1 +> + +> + printf "Checking for $libdir_expanded in ldconfig... " +> + ldconfig_paths=3D$(/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=3D$(printf '\n') +> + # +> + # because the shell's command substitution deletes any trailing newl= +ines. +> + IFS=3D" +> +" +> + for path in $ldconfig_paths; do +> + if [ "$path" =3D "$libdir_expanded" ]; then +> + libdir_in_ldconfig=3D1 +> + fi +> + done +> + IFS=3D$DEFAULT_IFS +> + if [ "$libdir_in_ldconfig" =3D '0' ]; then +> + printf "No (will set RPATH)\n" +> + else +> + printf "Yes\n" +> + fi +> +else +> + printf "Unknown.\n" +> + cat < + +> +*** Warning: Unknown platform. Notmuch might or might not build correctl= +y. +> + +> +EOF +> +fi +> + +> if pkg-config --version > /dev/null 2>&1; then +> have_pkg_config=3D1 +> else +> @@ -342,14 +398,22 @@ fi +>=20=20 +> printf "Checking for zlib (>=3D 1.2.5.2)... " +> have_zlib=3D0 +> -if pkg-config --atleast-version=3D1.2.5.2 zlib; then +> +# zlib is part of base in FreeBSD. version 9.1 included 1.2.7 +> +if [ $platform =3D FREEBSD -a `uname -U` -ge 901000 ] ; then +> printf "Yes.\n" +> have_zlib=3D1 +> - zlib_cflags=3D$(pkg-config --cflags zlib) +> - zlib_ldflags=3D$(pkg-config --libs zlib) +> + zlib_cflags=3D +> + zlib_ldflags=3D-lz +> else +> - printf "No.\n" +> - errors=3D$((errors + 1)) +> + if pkg-config --atleast-version=3D1.2.5.2 zlib; then +> + printf "Yes.\n" +> + have_zlib=3D1 +> + zlib_cflags=3D$(pkg-config --cflags zlib) +> + zlib_ldflags=3D$(pkg-config --libs zlib) +> + else +> + printf "No.\n" +> + errors=3D$((errors + 1)) +> + fi +> fi +>=20=20 +> printf "Checking for talloc development files... " +> @@ -427,62 +491,6 @@ else +> fi +> fi +>=20=20 +> -libdir_in_ldconfig=3D0 +> - +> -printf "Checking which platform we are on... " +> -uname=3D`uname` +> -if [ $uname =3D "Darwin" ] ; then +> - printf "Mac OS X.\n" +> - platform=3DMACOSX +> - linker_resolves_library_dependencies=3D0 +> -elif [ $uname =3D "SunOS" ] ; then +> - printf "Solaris.\n" +> - platform=3DSOLARIS +> - linker_resolves_library_dependencies=3D0 +> -elif [ $uname =3D "FreeBSD" ] ; then +> - printf "FreeBSD.\n" +> - platform=3DFREEBSD +> - linker_resolves_library_dependencies=3D0 +> -elif [ $uname =3D "OpenBSD" ] ; then +> - printf "OpenBSD.\n" +> - platform=3DOPENBSD +> - linker_resolves_library_dependencies=3D0 +> -elif [ $uname =3D "Linux" ] || [ $uname =3D "GNU" ] ; then +> - printf "$uname\n" +> - platform=3D"$uname" +> - linker_resolves_library_dependencies=3D1 +> - +> - printf "Checking for $libdir_expanded in ldconfig... " +> - ldconfig_paths=3D$(/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=3D$(printf '\n') +> - # +> - # because the shell's command substitution deletes any trailing newl= +ines. +> - IFS=3D" +> -" +> - for path in $ldconfig_paths; do +> - if [ "$path" =3D "$libdir_expanded" ]; then +> - libdir_in_ldconfig=3D1 +> - fi +> - done +> - IFS=3D$DEFAULT_IFS +> - if [ "$libdir_in_ldconfig" =3D '0' ]; then +> - printf "No (will set RPATH)\n" +> - else +> - printf "Yes\n" +> - fi +> -else +> - printf "Unknown.\n" +> - cat < - +> -*** Warning: Unknown platform. Notmuch might or might not build correctl= +y. +> - +> -EOF +> -fi +> - +> printf "Checking byte order... " +> cat> _byteorder.c < #include +> --=20 +> 1.9.2 +> +> _______________________________________________ +> notmuch mailing list +> notmuch@notmuchmail.org +> http://notmuchmail.org/mailman/listinfo/notmuch -- 2.26.2