Re: resolv.h test proposal

2004-10-26 Thread Reini Urban
Stepan Kasal schrieb:
Hello Gerrit,
On Mon, Oct 25, 2004 at 05:40:19PM +0200, Gerrit P. Haase wrote:
I'm sorry, I don't know enough about autoconf / m4 programming to
integrate this into autoconf.
well, you don't need much special knowledge (I hope).
You wrote the most of the macro for me.  Then I used the definitions
from the file /usr/share/autoconf/autoconf/headers.m4 as templates.
(This file can be found by grepping for AC_CHECK_HEADERS.)
I adapted your check.
Thanks. That makes it easy.
Before I try to submit it, I'd like to ask you (or others on the
lists) to test it.
Works for me also. I use it in the clamav package.
(Delete the AN_HEADER line there are problems with it.)
--
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/
--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/


Re: resolv.h test proposal

2004-10-26 Thread Gerrit P. Haase
Stepan Kasal wrote:
Hello Gerrit,
On Mon, Oct 25, 2004 at 05:40:19PM +0200, Gerrit P. Haase wrote:
I'm sorry, I don't know enough about autoconf / m4 programming to
integrate this into autoconf.

well, you don't need much special knowledge (I hope).
You wrote the most of the macro for me.  Then I used the definitions
from the file /usr/share/autoconf/autoconf/headers.m4 as templates.
(This file can be found by grepping for AC_CHECK_HEADERS.)
I adapted your check.
Before I try to submit it, I'd like to ask you (or others on the
lists) to test it.
Used it in acinclude, verbatim:
checking for resolv.h... yes

(Delete the AN_HEADER line there are problems with it.)
Thank you for this, please submit to autoconf-patches,
Gerrit
--
=^..^=
--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/


Re: resolv.h test proposal

2004-10-26 Thread Stepan Kasal
Hello,

On Mon, Oct 25, 2004 at 06:16:40PM +0200, Reini Urban wrote:
> I'd better fix it upstream so they'll get it without any notice.

even if it gets to autoconf and they upgrade, they sill have to put
AC_HEADER_RESOLV to their configure.ac (unless they use autoscan).

Stepan

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: resolv.h test proposal

2004-10-26 Thread Stepan Kasal
Hello Gerrit,

On Mon, Oct 25, 2004 at 05:40:19PM +0200, Gerrit P. Haase wrote:
> I'm sorry, I don't know enough about autoconf / m4 programming to
> integrate this into autoconf.

well, you don't need much special knowledge (I hope).
You wrote the most of the macro for me.  Then I used the definitions
from the file /usr/share/autoconf/autoconf/headers.m4 as templates.
(This file can be found by grepping for AC_CHECK_HEADERS.)

I adapted your check.
Before I try to submit it, I'd like to ask you (or others on the
lists) to test it.

(Delete the AN_HEADER line there are problems with it.)

Thank you,
Stepan Kasal
# AC_HEADER_RESOLV
# 
AN_HEADER(resolv.h, AC_HEADER_RESOLV)
AC_DEFUN(AC_HEADER_RESOLV,
[AC_CHECK_HEADERS(sys/types.h netinet/in.h arpa/nameser.h sys/socket.h)
AC_CACHE_CHECK(for resolv.h,
   ac_cv_header_resolv_h,
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[
#if HAVE_SYS_TYPES_H
#  include 
#endif
#ifdef HAVE_NETINET_IN_H
#  include/* inet_ functions / structs */
#endif
#ifdef HAVE_ARPA_NAMESER_H
#  include  /* DNS HEADER struct */
#endif
#ifdef HAVE_SYS_SOCKET_H
#  include  /* DNS HEADER struct */
#endif]]),
  ac_cv_header_resolv_h=yes,
  ac_cv_header_resolv_h=no))
if test $ac_cv_header_resolv_h = yes; then
AC_DEFINE(HAVE_RESOLV_H, 1,
[Define to 1 if you have the  header file.])
fi
])# AC_HEADER_RESOLV

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/

Re: resolv.h test proposal

2004-10-25 Thread Reini Urban
Gerrit P. Haase schrieb:
Thread context: http://cygwin.com/ml/cygwin/2004-10/msg0.html
Stepan schrieb:

Hello Reini,
On Mon, Oct 25, 2004 at 02:49:51PM +0200, Reini Urban wrote:
So I take the liberty to forward it to the bug report address.
Many thanks for doing this for us.

nothing to be really grateful for.

What's really needed, is to write the AC_HEADER_RESOLV macro.
The existing AC_HEADER_* macros can serve as a template.

It would be nice if you or Gerrit or someone else could invest the time
to do it and post the patch to [EMAIL PROTECTED] .

I'm sorry, I don't know enough about autoconf / m4 programming to
integrate this into autoconf.
I just use this for acinclude.m4 or put it in a file named resolv_h.m4
under /usr/share/aclocal now:
# AC_HEADER_RESOLV
# Call AC_HEADER_RESOLV after this in configure.ac:
# AC_CHECK_HEADERS([arpa/nameser.h netinet/in.h sys/socket.h sys/types.h])
# ---
AC_DEFUN([AC_HEADER_RESOLV],
[AC_CHECK_HEADERS([resolv.h], [], [],
  [[#if HAVE_SYS_TYPES_H
#  include 
#endif
#ifdef HAVE_NETINET_IN_H
#  include/* inet_ functions / structs */
#endif
#ifdef HAVE_ARPA_NAMESER_H
#  include  /* DNS HEADER struct */
#endif
#ifdef HAVE_SYS_SOCKET_H
#  include  /* DNS HEADER struct */
#endif
  ]]
)])# AC_HEADER_RESOLV

I call AC_HEADER_RESOLV in configure.ac and this works for me(tm).
And now I have to persuade clamav folks to use this new macro where they 
even brought down their whole autoconf/libtool setup by overriding the 
most useful macros from aclocal.m4 in acinclude.m4 (some LIBTOOL 
overrides) and creating their own way of AC_CANONICAL_HOST and some more 
goodies???
Well it's still below v1.0, maybe that's why.

I'd better fix it upstream so they'll get it without any notice.
--
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/
--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/


Re: resolv.h test proposal

2004-10-25 Thread Gerrit P. Haase
Thread context: http://cygwin.com/ml/cygwin/2004-10/msg0.html

Stepan schrieb:

> Hello Reini,

> On Mon, Oct 25, 2004 at 02:49:51PM +0200, Reini Urban wrote:
>> >So I take the liberty to forward it to the bug report address.
>> 
>> Many thanks for doing this for us.

> nothing to be really grateful for.

> What's really needed, is to write the AC_HEADER_RESOLV macro.
> The existing AC_HEADER_* macros can serve as a template.

> It would be nice if you or Gerrit or someone else could invest the time
> to do it and post the patch to [EMAIL PROTECTED] .

I'm sorry, I don't know enough about autoconf / m4 programming to
integrate this into autoconf.

I just use this for acinclude.m4 or put it in a file named resolv_h.m4
under /usr/share/aclocal now:

# AC_HEADER_RESOLV
# Call AC_HEADER_RESOLV after this in configure.ac:
# AC_CHECK_HEADERS([arpa/nameser.h netinet/in.h sys/socket.h sys/types.h])
# ---
AC_DEFUN([AC_HEADER_RESOLV],
[AC_CHECK_HEADERS([resolv.h], [], [],
  [[#if HAVE_SYS_TYPES_H
#  include 
#endif
#ifdef HAVE_NETINET_IN_H
#  include/* inet_ functions / structs */
#endif
#ifdef HAVE_ARPA_NAMESER_H
#  include  /* DNS HEADER struct */
#endif
#ifdef HAVE_SYS_SOCKET_H
#  include  /* DNS HEADER struct */
#endif
  ]]
)])# AC_HEADER_RESOLV



I call AC_HEADER_RESOLV in configure.ac and this works for me(tm).


Gerrit
-- 
=^..^=


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: resolv.h test proposal

2004-10-25 Thread Reini Urban
Stepan Kasal schrieb:
Hello,
   the text below seems to relly be a bug report with a proposed fix.
So I take the liberty to forward it to the bug report address.
Many thanks for doing this for us.
- Forwarded message from "Gerrit P. Haase" -
Date: Mon, 25 Oct 2004 13:46:43 +0200
From: "Gerrit P. Haase" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [bugreport] resolv.h test fails (was: Re: minires-devel-0.97-1:
resolv.h fails)
Gerrit wrote:
Pierre A. Humblet wrote:
At 01:03 PM 10/18/2004 +0200, Corinna Vinschen wrote:
On Oct 18 03:28, Reini Urban wrote:
minires-devel-0.97-1:
#include  fails suddenly.
Apparently /usr/include/resolv.h misses the definition for
sockaddr_in, which is defined in 
Have no clue why it suddenly fails. Anyone else?
These headers didn't change for years...
Which file is supposed to include cygwin/in.h? I found nothing.
netinet/in.h

Its an upstream issue. According to the resolver man page, 
netinet/in.h should be included before resolv.h.

For example

SYNOPSIS
#include 
#include 
#include 
#include 

I think this is correct.  What is buggy is the autoconf test which is
just including resolv.h and not netinet/in.h to compile the test exe.
This applies to the default test when calling
AC_CHECK_HEADERS([resolv.h])
Workaround is to use s.th. like this in configure.ac:
AC_CHECK_HEADERS([arpa/nameser.h netinet/in.h sys/socket.h sys/types.h])
AC_CHECK_HEADERS([resolv.h], [], [],
  [[#if HAVE_SYS_TYPES_H
#  include 
#endif
#ifdef HAVE_NETINET_IN_H
#  include/* inet_ functions / structs */
#endif
#ifdef HAVE_ARPA_NAMESER_H
#  include  /* DNS HEADER struct */
#endif
#ifdef HAVE_SYS_SOCKET_H
#  include  /* DNS HEADER struct */
#endif
 ]])
Anyway, there should be a macro which provides this functionity.
--
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/
--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/