delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/12/03/05:05:42

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Fri, 3 Dec 2004 11:05:51 +0100
From: Stepan Kasal <kasal AT ucw DOT cz>
To: autoconf-patches AT gnu DOT org, cygwin AT cygwin DOT com
Cc: "Gerrit P. Haase" <freeweb AT nyckelpiga DOT de>,
"Gerrit P. Haase" <gerrit AT familiehaase DOT de>, Reini Urban <rurban AT x-ray DOT at>
Subject: Re: check for resolv.h
Message-ID: <20041203100551.GA15182@matsrv.math.cas.cz>
References: <20041027101112 DOT GC26549 AT matsrv DOT math DOT cas DOT cz> <20041129085909 DOT GA9353 AT matsrv DOT math DOT cas DOT cz> <87hdn8jhqe DOT fsf AT penguin DOT cs DOT ucla DOT edu> <20041130080715 DOT GC2482 AT matsrv DOT math DOT cas DOT cz> <878y8jempl DOT fsf AT penguin DOT cs DOT ucla DOT edu> <20041130090815 DOT GA11363 AT matsrv DOT math DOT cas DOT cz> <87brdf6vkw DOT fsf AT penguin DOT cs DOT ucla DOT edu>
Mime-Version: 1.0
In-Reply-To: <87brdf6vkw.fsf@penguin.cs.ucla.edu>
User-Agent: Mutt/1.4.1i
X-Virus-Scanned: ClamAV 0.80/578/Mon Nov 8 15:26:49 2004 clamav-milter version 0.80j on localhost
X-Virus-Status: Clean
X-Spam-Status: No, hits=-1.5 required=5.0 tests=BAYES_01 autolearn=no version=2.64
X-Spam-Checker-Version: SpamAssassin 2.64 (2004-01-11) on matsrv.math.cas.cz

--G4iJoqBmSsgzjUCe
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hello all,
  I have prepared another version of the AC_HEADER_RESOLV autoconf macro.
Attached is a patch against CVS; I have verified that it can be used with
autoconf-2.59b, too.

I have removed sys/socket.h; I wasn't able to find a reference to a
platform where it was required to include it before resolv.h.

I have added netdb.h, since Paul Eggert reports that it is needed on
Solaris 9.

Gerrit, Reini, could you please test the macro again?  (Of course, the
easiest way is to put the macro to aclocal.m4 and call AC_HEADER_RESOLV
in your configure.ac.)

Thank you in advance for your help,
	Stepan Kasal

AC_DEFUN([AC_HEADER_RESOLV],
[AC_CHECK_HEADERS(sys/types.h netinet/in.h arpa/nameser.h netdb.h resolv.h,
                 [], [],
[[#if HAVE_SYS_TYPES_H
#  include <sys/types.h>
#endif
#ifdef HAVE_NETINET_IN_H
#  include <netinet/in.h>   /* inet_ functions / structs */
#endif
#ifdef HAVE_ARPA_NAMESER_H
#  include <arpa/nameser.h> /* DNS HEADER struct */
#endif
#ifdef HAVE_NETDB_H
#  include <netdb.h>
#endif]])
])# AC_HEADER_RESOLV


--G4iJoqBmSsgzjUCe
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="autoconf-20041203-resolv3.patch"

2004-12-03  Stepan Kasal  <kasal AT ucw DOT cz>

	Add a specialized check for resolv.h.  Thanks to Gerrit P. Haase,
	Reini Urban and Paul Eggert for reporting the dependencies.

	* lib/autoconf/headers.m4 (AC_HEADER_RESOLV): New macro.
	* doc/autoconf.texi (AC_HEADER_RESOLV): Document it.
	(AC_HEADER_STAT): @cvindex{STAT_MACROS_BROKEN}, not @acindex.

Index: doc/autoconf.texi
===================================================================
RCS file: /cvsroot/autoconf/autoconf/doc/autoconf.texi,v
retrieving revision 1.846
diff -u -r1.846 autoconf.texi
--- doc/autoconf.texi	29 Nov 2004 21:43:11 -0000	1.846
+++ doc/autoconf.texi	3 Dec 2004 09:43:08 -0000
@@ -4750,10 +4750,34 @@
 @code{MAJOR_IN_SYSMACROS}.
 @end defmac
 
+@defmac AC_HEADER_RESOLV
+@acindex{HEADER_RESOLV}
+@cvindex HAVE_RESOLV_H
+@hdrindex{resolv.h}
+Checks for header @file{resolv.h}, checking for prerequisities first.
+To properly use @file{resolv.h}, your code should contain something like
+the following:
+
+@verbatim
+#if HAVE_SYS_TYPES_H
+#  include <sys/types.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#  include <netinet/in.h>   /* inet_ functions / structs */
+#endif
+#ifdef HAVE_ARPA_NAMESER_H
+#  include <arpa/nameser.h> /* DNS HEADER struct */
+#endif
+#ifdef HAVE_NETDB_H
+#  include <netdb.h>
+#endif
+#include <resolv.h>
+@end verbatim
+@end defmac
 
 @defmac AC_HEADER_STAT
 @acindex{HEADER_STAT}
-@acindex{STAT_MACROS_BROKEN}
+@cvindex STAT_MACROS_BROKEN
 @hdrindex{sys/stat.h}
 If the macros @code{S_ISDIR}, @code{S_ISREG}, etc.@: defined in
 @file{sys/stat.h} do not work properly (returning false positives),
Index: lib/autoconf/headers.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/headers.m4,v
retrieving revision 1.41
diff -u -r1.41 headers.m4
--- lib/autoconf/headers.m4	1 Jun 2004 05:33:28 -0000	1.41
+++ lib/autoconf/headers.m4	3 Dec 2004 09:43:08 -0000
@@ -440,6 +440,32 @@
 ])# AC_HEADER_MAJOR
 
 
+# AC_HEADER_RESOLV
+# ----------------
+# According to http://www.mcsr.olemiss.edu/cgi-bin/man-cgi?resolver+3,
+# sys/types.h, netinet/in.h and arpa/nameser.h are required on IRIX.
+# netinet/in.h is needed on Cygwin, too.
+# With Solaris 9, netdb.h is required, to get symbols like HOST_NOT_FOUND.
+#
+AN_HEADER(resolv.h,	[AC_HEADER_RESOLV])
+AC_DEFUN([AC_HEADER_RESOLV],
+[AC_CHECK_HEADERS(sys/types.h netinet/in.h arpa/nameser.h netdb.h resolv.h,
+		  [], [],
+[[#if HAVE_SYS_TYPES_H
+#  include <sys/types.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#  include <netinet/in.h>   /* inet_ functions / structs */
+#endif
+#ifdef HAVE_ARPA_NAMESER_H
+#  include <arpa/nameser.h> /* DNS HEADER struct */
+#endif
+#ifdef HAVE_NETDB_H
+#  include <netdb.h>
+#endif]])
+])# AC_HEADER_RESOLV
+
+
 # AC_HEADER_STAT
 # --------------
 # FIXME: Shouldn't this be named AC_HEADER_SYS_STAT?


--G4iJoqBmSsgzjUCe
Content-Type: text/plain; charset=us-ascii

--
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/
--G4iJoqBmSsgzjUCe--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019