[PATCH 1/2] configure: add a fallback check for zlib

2014-05-22 Thread Fraser Tweedale
On Wed, May 21, 2014 at 10:34:25PM +0300, Tomi Ollila wrote:
> On Wed, May 21 2014, Fraser Tweedale  wrote:
> 
> > On Sat, May 10, 2014 at 05:27:34PM -0500, Felipe Contreras wrote:
> >> Tomi Ollila wrote:
> >> > On Sun, May 11 2014, Felipe Contreras  
> >> > wrote:
> >> > 
> >> > > X?c? wrote:
> >> > >> Since zlib is part of the base system, FreeBSD chose not to register 
> >> > >> it
> >> > >> in pkg-config through zlib.pc. As a fallback test, configure will 
> >> > >> build
> >> > >> and run a zlib version check and make sure the header and library
> >> > >> versions are compatible.
> >> > >
> >> > > We could try to generate our on zlib.pc, this way the configure script
> >> > > would be cleaner.
> >> > 
> >> > But for that we'd need to figure out the version, and is there simpler
> >> > robust way to do that some other way ?
> >> 
> >> I don't meant to change the code that is checking for the version in the
> >> patch, you use the same code, but instead of have_zlib.c gen_zlib_pc.c,
> >> or something.
> >> 
> >
> > [please cc me in replies; I am not subscribed to the list]
> >
> > I think that the additional complexity outweighs the benefit of a
> > somewhat cleaner build script.
> >
> > If the $vz1, $vz2, et al. are what's bothering you, perhaps we could
> > push the complexity of version comparison into have_zlib.c and
> > supply the (string) version number as an argument to the program.
> > The have_zlib program could do the comparison and exit accordingly,
> > and plain old "1.2.5.2" can take its place in the configure script
> > once more.
> >
> > However, I don't see any problems with the patch as it is; I have
> > tested it on FreeBSD 10.0 and it works.
> 
> Did you notice 
> 
> http://mid.gmane.org/1399864172-28227-1-git-send-email-felipe.contreras at 
> gmail.com
> 
> :D
> 

Whups, I missed that one :)  Cheers.

> >
> > Regards,
> >
> > Fraser
> >
> >> -- 
> >> Felipe Contreras
> 
> Tomi
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 834 bytes
Desc: not available
URL: 



[PATCH 1/2] configure: add a fallback check for zlib

2014-05-22 Thread Felipe Contreras
Fraser Tweedale wrote:
> On Sat, May 10, 2014 at 05:27:34PM -0500, Felipe Contreras wrote:
> > Tomi Ollila wrote:
> > > On Sun, May 11 2014, Felipe Contreras  
> > > wrote:
> > > 
> > > > X?c? wrote:
> > > >> Since zlib is part of the base system, FreeBSD chose not to register it
> > > >> in pkg-config through zlib.pc. As a fallback test, configure will build
> > > >> and run a zlib version check and make sure the header and library
> > > >> versions are compatible.
> > > >
> > > > We could try to generate our on zlib.pc, this way the configure script
> > > > would be cleaner.
> > > 
> > > But for that we'd need to figure out the version, and is there simpler
> > > robust way to do that some other way ?
> > 
> > I don't meant to change the code that is checking for the version in the
> > patch, you use the same code, but instead of have_zlib.c gen_zlib_pc.c,
> > or something.
> > 
> 
> [please cc me in replies; I am not subscribed to the list]

Unless the list does Reply-To munging, there's no need to say that. And
this is a sane list, so no Reply-To munging :)

http://felipec.wordpress.com/2010/08/03/avoid-reply-to-munging-mail-as-mail-was-meant-to-be/

-- 
Felipe Contreras


Re: [PATCH 1/2] configure: add a fallback check for zlib

2014-05-22 Thread Felipe Contreras
Fraser Tweedale wrote:
> On Sat, May 10, 2014 at 05:27:34PM -0500, Felipe Contreras wrote:
> > Tomi Ollila wrote:
> > > On Sun, May 11 2014, Felipe Contreras  wrote:
> > > 
> > > > Xīcò wrote:
> > > >> Since zlib is part of the base system, FreeBSD chose not to register it
> > > >> in pkg-config through zlib.pc. As a fallback test, configure will build
> > > >> and run a zlib version check and make sure the header and library
> > > >> versions are compatible.
> > > >
> > > > We could try to generate our on zlib.pc, this way the configure script
> > > > would be cleaner.
> > > 
> > > But for that we'd need to figure out the version, and is there simpler
> > > robust way to do that some other way ?
> > 
> > I don't meant to change the code that is checking for the version in the
> > patch, you use the same code, but instead of have_zlib.c gen_zlib_pc.c,
> > or something.
> > 
> 
> [please cc me in replies; I am not subscribed to the list]

Unless the list does Reply-To munging, there's no need to say that. And
this is a sane list, so no Reply-To munging :)

http://felipec.wordpress.com/2010/08/03/avoid-reply-to-munging-mail-as-mail-was-meant-to-be/

-- 
Felipe Contreras
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH 1/2] configure: add a fallback check for zlib

2014-05-21 Thread Tomi Ollila
On Wed, May 21 2014, Fraser Tweedale  wrote:

> On Sat, May 10, 2014 at 05:27:34PM -0500, Felipe Contreras wrote:
>> Tomi Ollila wrote:
>> > On Sun, May 11 2014, Felipe Contreras  
>> > wrote:
>> > 
>> > > X?c? wrote:
>> > >> Since zlib is part of the base system, FreeBSD chose not to register it
>> > >> in pkg-config through zlib.pc. As a fallback test, configure will build
>> > >> and run a zlib version check and make sure the header and library
>> > >> versions are compatible.
>> > >
>> > > We could try to generate our on zlib.pc, this way the configure script
>> > > would be cleaner.
>> > 
>> > But for that we'd need to figure out the version, and is there simpler
>> > robust way to do that some other way ?
>> 
>> I don't meant to change the code that is checking for the version in the
>> patch, you use the same code, but instead of have_zlib.c gen_zlib_pc.c,
>> or something.
>> 
>
> [please cc me in replies; I am not subscribed to the list]
>
> I think that the additional complexity outweighs the benefit of a
> somewhat cleaner build script.
>
> If the $vz1, $vz2, et al. are what's bothering you, perhaps we could
> push the complexity of version comparison into have_zlib.c and
> supply the (string) version number as an argument to the program.
> The have_zlib program could do the comparison and exit accordingly,
> and plain old "1.2.5.2" can take its place in the configure script
> once more.
>
> However, I don't see any problems with the patch as it is; I have
> tested it on FreeBSD 10.0 and it works.

Did you notice 

http://mid.gmane.org/1399864172-28227-1-git-send-email-felipe.contreras at 
gmail.com

:D

>
> Regards,
>
> Fraser
>
>> -- 
>> Felipe Contreras

Tomi


[PATCH 1/2] configure: add a fallback check for zlib

2014-05-21 Thread Fraser Tweedale
On Sat, May 10, 2014 at 05:27:34PM -0500, Felipe Contreras wrote:
> Tomi Ollila wrote:
> > On Sun, May 11 2014, Felipe Contreras  wrote:
> > 
> > > X?c? wrote:
> > >> Since zlib is part of the base system, FreeBSD chose not to register it
> > >> in pkg-config through zlib.pc. As a fallback test, configure will build
> > >> and run a zlib version check and make sure the header and library
> > >> versions are compatible.
> > >
> > > We could try to generate our on zlib.pc, this way the configure script
> > > would be cleaner.
> > 
> > But for that we'd need to figure out the version, and is there simpler
> > robust way to do that some other way ?
> 
> I don't meant to change the code that is checking for the version in the
> patch, you use the same code, but instead of have_zlib.c gen_zlib_pc.c,
> or something.
> 

[please cc me in replies; I am not subscribed to the list]

I think that the additional complexity outweighs the benefit of a
somewhat cleaner build script.

If the $vz1, $vz2, et al. are what's bothering you, perhaps we could
push the complexity of version comparison into have_zlib.c and
supply the (string) version number as an argument to the program.
The have_zlib program could do the comparison and exit accordingly,
and plain old "1.2.5.2" can take its place in the configure script
once more.

However, I don't see any problems with the patch as it is; I have
tested it on FreeBSD 10.0 and it works.

Regards,

Fraser

> -- 
> Felipe Contreras
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 834 bytes
Desc: not available
URL: 



Re: [PATCH 1/2] configure: add a fallback check for zlib

2014-05-21 Thread Fraser Tweedale
On Wed, May 21, 2014 at 10:34:25PM +0300, Tomi Ollila wrote:
> On Wed, May 21 2014, Fraser Tweedale  wrote:
> 
> > On Sat, May 10, 2014 at 05:27:34PM -0500, Felipe Contreras wrote:
> >> Tomi Ollila wrote:
> >> > On Sun, May 11 2014, Felipe Contreras  wrote:
> >> > 
> >> > > Xīcò wrote:
> >> > >> Since zlib is part of the base system, FreeBSD chose not to register 
> >> > >> it
> >> > >> in pkg-config through zlib.pc. As a fallback test, configure will 
> >> > >> build
> >> > >> and run a zlib version check and make sure the header and library
> >> > >> versions are compatible.
> >> > >
> >> > > We could try to generate our on zlib.pc, this way the configure script
> >> > > would be cleaner.
> >> > 
> >> > But for that we'd need to figure out the version, and is there simpler
> >> > robust way to do that some other way ?
> >> 
> >> I don't meant to change the code that is checking for the version in the
> >> patch, you use the same code, but instead of have_zlib.c gen_zlib_pc.c,
> >> or something.
> >> 
> >
> > [please cc me in replies; I am not subscribed to the list]
> >
> > I think that the additional complexity outweighs the benefit of a
> > somewhat cleaner build script.
> >
> > If the $vz1, $vz2, et al. are what's bothering you, perhaps we could
> > push the complexity of version comparison into have_zlib.c and
> > supply the (string) version number as an argument to the program.
> > The have_zlib program could do the comparison and exit accordingly,
> > and plain old "1.2.5.2" can take its place in the configure script
> > once more.
> >
> > However, I don't see any problems with the patch as it is; I have
> > tested it on FreeBSD 10.0 and it works.
> 
> Did you notice 
> 
> http://mid.gmane.org/1399864172-28227-1-git-send-email-felipe.contre...@gmail.com
> 
> :D
> 

Whups, I missed that one :)  Cheers.

> >
> > Regards,
> >
> > Fraser
> >
> >> -- 
> >> Felipe Contreras
> 
> Tomi


pgpJyZ9LmgQ9K.pgp
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH 1/2] configure: add a fallback check for zlib

2014-05-21 Thread Tomi Ollila
On Wed, May 21 2014, Fraser Tweedale  wrote:

> On Sat, May 10, 2014 at 05:27:34PM -0500, Felipe Contreras wrote:
>> Tomi Ollila wrote:
>> > On Sun, May 11 2014, Felipe Contreras  wrote:
>> > 
>> > > Xīcò wrote:
>> > >> Since zlib is part of the base system, FreeBSD chose not to register it
>> > >> in pkg-config through zlib.pc. As a fallback test, configure will build
>> > >> and run a zlib version check and make sure the header and library
>> > >> versions are compatible.
>> > >
>> > > We could try to generate our on zlib.pc, this way the configure script
>> > > would be cleaner.
>> > 
>> > But for that we'd need to figure out the version, and is there simpler
>> > robust way to do that some other way ?
>> 
>> I don't meant to change the code that is checking for the version in the
>> patch, you use the same code, but instead of have_zlib.c gen_zlib_pc.c,
>> or something.
>> 
>
> [please cc me in replies; I am not subscribed to the list]
>
> I think that the additional complexity outweighs the benefit of a
> somewhat cleaner build script.
>
> If the $vz1, $vz2, et al. are what's bothering you, perhaps we could
> push the complexity of version comparison into have_zlib.c and
> supply the (string) version number as an argument to the program.
> The have_zlib program could do the comparison and exit accordingly,
> and plain old "1.2.5.2" can take its place in the configure script
> once more.
>
> However, I don't see any problems with the patch as it is; I have
> tested it on FreeBSD 10.0 and it works.

Did you notice 

http://mid.gmane.org/1399864172-28227-1-git-send-email-felipe.contre...@gmail.com

:D

>
> Regards,
>
> Fraser
>
>> -- 
>> Felipe Contreras

Tomi
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH 1/2] configure: add a fallback check for zlib

2014-05-21 Thread Fraser Tweedale
On Sat, May 10, 2014 at 05:27:34PM -0500, Felipe Contreras wrote:
> Tomi Ollila wrote:
> > On Sun, May 11 2014, Felipe Contreras  wrote:
> > 
> > > Xīcò wrote:
> > >> Since zlib is part of the base system, FreeBSD chose not to register it
> > >> in pkg-config through zlib.pc. As a fallback test, configure will build
> > >> and run a zlib version check and make sure the header and library
> > >> versions are compatible.
> > >
> > > We could try to generate our on zlib.pc, this way the configure script
> > > would be cleaner.
> > 
> > But for that we'd need to figure out the version, and is there simpler
> > robust way to do that some other way ?
> 
> I don't meant to change the code that is checking for the version in the
> patch, you use the same code, but instead of have_zlib.c gen_zlib_pc.c,
> or something.
> 

[please cc me in replies; I am not subscribed to the list]

I think that the additional complexity outweighs the benefit of a
somewhat cleaner build script.

If the $vz1, $vz2, et al. are what's bothering you, perhaps we could
push the complexity of version comparison into have_zlib.c and
supply the (string) version number as an argument to the program.
The have_zlib program could do the comparison and exit accordingly,
and plain old "1.2.5.2" can take its place in the configure script
once more.

However, I don't see any problems with the patch as it is; I have
tested it on FreeBSD 10.0 and it works.

Regards,

Fraser

> -- 
> Felipe Contreras


pgpnzNNymOoxA.pgp
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH 1/2] configure: add a fallback check for zlib

2014-05-11 Thread Tomi Ollila
On Sun, May 11 2014, Felipe Contreras  wrote:

> X?c? wrote:
>> Since zlib is part of the base system, FreeBSD chose not to register it
>> in pkg-config through zlib.pc. As a fallback test, configure will build
>> and run a zlib version check and make sure the header and library
>> versions are compatible.
>
> We could try to generate our on zlib.pc, this way the configure script
> would be cleaner.

But for that we'd need to figure out the version, and is there simpler
robust way to do that some other way ?

X?c?: zv4=2 instead of zv4=1 (1.2.5.2)

> -- 
> Felipe Contreras

Tomi


[PATCH 1/2] configure: add a fallback check for zlib

2014-05-10 Thread Felipe Contreras
Tomi Ollila wrote:
> On Sun, May 11 2014, Felipe Contreras  wrote:
> 
> > X?c? wrote:
> >> Since zlib is part of the base system, FreeBSD chose not to register it
> >> in pkg-config through zlib.pc. As a fallback test, configure will build
> >> and run a zlib version check and make sure the header and library
> >> versions are compatible.
> >
> > We could try to generate our on zlib.pc, this way the configure script
> > would be cleaner.
> 
> But for that we'd need to figure out the version, and is there simpler
> robust way to do that some other way ?

I don't meant to change the code that is checking for the version in the
patch, you use the same code, but instead of have_zlib.c gen_zlib_pc.c,
or something.

-- 
Felipe Contreras


[PATCH 1/2] configure: add a fallback check for zlib

2014-05-10 Thread Felipe Contreras
X?c? wrote:
> Since zlib is part of the base system, FreeBSD chose not to register it
> in pkg-config through zlib.pc. As a fallback test, configure will build
> and run a zlib version check and make sure the header and library
> versions are compatible.

We could try to generate our on zlib.pc, this way the configure script
would be cleaner.

-- 
Felipe Contreras


RE: [PATCH 1/2] configure: add a fallback check for zlib

2014-05-10 Thread Felipe Contreras
Tomi Ollila wrote:
> On Sun, May 11 2014, Felipe Contreras  wrote:
> 
> > Xīcò wrote:
> >> Since zlib is part of the base system, FreeBSD chose not to register it
> >> in pkg-config through zlib.pc. As a fallback test, configure will build
> >> and run a zlib version check and make sure the header and library
> >> versions are compatible.
> >
> > We could try to generate our on zlib.pc, this way the configure script
> > would be cleaner.
> 
> But for that we'd need to figure out the version, and is there simpler
> robust way to do that some other way ?

I don't meant to change the code that is checking for the version in the
patch, you use the same code, but instead of have_zlib.c gen_zlib_pc.c,
or something.

-- 
Felipe Contreras
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


RE: [PATCH 1/2] configure: add a fallback check for zlib

2014-05-10 Thread Tomi Ollila
On Sun, May 11 2014, Felipe Contreras  wrote:

> Xīcò wrote:
>> Since zlib is part of the base system, FreeBSD chose not to register it
>> in pkg-config through zlib.pc. As a fallback test, configure will build
>> and run a zlib version check and make sure the header and library
>> versions are compatible.
>
> We could try to generate our on zlib.pc, this way the configure script
> would be cleaner.

But for that we'd need to figure out the version, and is there simpler
robust way to do that some other way ?

Xīcò: zv4=2 instead of zv4=1 (1.2.5.2)

> -- 
> Felipe Contreras

Tomi
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


RE: [PATCH 1/2] configure: add a fallback check for zlib

2014-05-10 Thread Felipe Contreras
Xīcò wrote:
> Since zlib is part of the base system, FreeBSD chose not to register it
> in pkg-config through zlib.pc. As a fallback test, configure will build
> and run a zlib version check and make sure the header and library
> versions are compatible.

We could try to generate our on zlib.pc, this way the configure script
would be cleaner.

-- 
Felipe Contreras
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH 1/2] configure: add a fallback check for zlib

2014-05-10 Thread Xīcò
Since zlib is part of the base system, FreeBSD chose not to register it
in pkg-config through zlib.pc. As a fallback test, configure will build
and run a zlib version check and make sure the header and library
versions are compatible.
---
 compat/have_zlib.c |  6 ++
 configure  | 21 -
 2 files changed, 22 insertions(+), 5 deletions(-)
 create mode 100644 compat/have_zlib.c

diff --git a/compat/have_zlib.c b/compat/have_zlib.c
new file mode 100644
index 000..abaeedd
--- /dev/null
+++ b/compat/have_zlib.c
@@ -0,0 +1,6 @@
+#include 
+
+int main(void)
+{
+return (ZLIB_VERNUM) < (MINVER) || zlibVersion()[0] != (ZLIB_VERSION)[0];
+}
diff --git a/configure b/configure
index 9bde2eb..7a11ded 100755
--- a/configure
+++ b/configure
@@ -340,16 +340,27 @@ else
 errors=$((errors + 1))
 fi
 
-printf "Checking for zlib (>= 1.2.5.2)... "
+zv1=1 zv2=2 zv3=5 zv4=1
+printf "Checking for zlib (>= $zv1.$zv2.$zv3.$zv4)... "
 have_zlib=0
-if pkg-config --atleast-version=1.2.5.2 zlib; then
+if pkg-config --atleast-version=$zv1.$zv2.$zv3.$zv4 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))
+# Try finding zlib directly (e.g. on FreeBSD)
+zlib_cflags=
+zlib_ldflags=-lz
+if ${CC} ${zlib_cflags} -DMINVER=0x$zv1$zv2$zv3$zv4 -o compat/have_zlib 
"$srcdir"/compat/have_zlib.c ${zlib_ldflags} > /dev/null 2>&1 && 
./compat/have_zlib
+then
+printf "Yes.\n"
+have_zlib=1
+else
+printf "No.\n"
+errors=$((errors + 1))
+fi
+rm -f compat/have_zlib
 fi
 
 printf "Checking for talloc development files... "
@@ -509,7 +520,7 @@ EOF
echo "  http://xapian.org/";
 fi
 if [ $have_zlib -eq 0 ]; then
-   echo "  zlib library (>= version 1.2.5.2, including development files 
such as headers)"
+   echo "  zlib library (>= version $zv1.$zv2.$zv3.$zv4, including 
development files such as headers)"
echo "  http://zlib.net/";
echo
 fi
-- 
1.9.2

___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH 1/2] configure: add a fallback check for zlib

2014-05-10 Thread Xīcò
Since zlib is part of the base system, FreeBSD chose not to register it
in pkg-config through zlib.pc. As a fallback test, configure will build
and run a zlib version check and make sure the header and library
versions are compatible.
---
 compat/have_zlib.c |  6 ++
 configure  | 21 -
 2 files changed, 22 insertions(+), 5 deletions(-)
 create mode 100644 compat/have_zlib.c

diff --git a/compat/have_zlib.c b/compat/have_zlib.c
new file mode 100644
index 000..abaeedd
--- /dev/null
+++ b/compat/have_zlib.c
@@ -0,0 +1,6 @@
+#include 
+
+int main(void)
+{
+return (ZLIB_VERNUM) < (MINVER) || zlibVersion()[0] != (ZLIB_VERSION)[0];
+}
diff --git a/configure b/configure
index 9bde2eb..7a11ded 100755
--- a/configure
+++ b/configure
@@ -340,16 +340,27 @@ else
 errors=$((errors + 1))
 fi

-printf "Checking for zlib (>= 1.2.5.2)... "
+zv1=1 zv2=2 zv3=5 zv4=1
+printf "Checking for zlib (>= $zv1.$zv2.$zv3.$zv4)... "
 have_zlib=0
-if pkg-config --atleast-version=1.2.5.2 zlib; then
+if pkg-config --atleast-version=$zv1.$zv2.$zv3.$zv4 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))
+# Try finding zlib directly (e.g. on FreeBSD)
+zlib_cflags=
+zlib_ldflags=-lz
+if ${CC} ${zlib_cflags} -DMINVER=0x$zv1$zv2$zv3$zv4 -o compat/have_zlib 
"$srcdir"/compat/have_zlib.c ${zlib_ldflags} > /dev/null 2>&1 && 
./compat/have_zlib
+then
+printf "Yes.\n"
+have_zlib=1
+else
+printf "No.\n"
+errors=$((errors + 1))
+fi
+rm -f compat/have_zlib
 fi

 printf "Checking for talloc development files... "
@@ -509,7 +520,7 @@ EOF
echo "  http://xapian.org/";
 fi
 if [ $have_zlib -eq 0 ]; then
-   echo "  zlib library (>= version 1.2.5.2, including development files 
such as headers)"
+   echo "  zlib library (>= version $zv1.$zv2.$zv3.$zv4, including 
development files such as headers)"
echo "  http://zlib.net/";
echo
 fi
-- 
1.9.2