GNOME Bugzilla – Bug 309866
Wrong check for resolv.h in configure.in on the Mac
Last modified: 2013-05-14 11:47:12 UTC
Version details: version 2.12.2 Distribution/Version: Mac OS X 10.4, also on Mac OS X 10.3 Find a Mac run configure on it for orbit2 Warning in configure: You'll get this warning: checking resolv.h usability... no checking resolv.h presence... yes configure: WARNING: resolv.h: present but cannot be compiled configure: WARNING: resolv.h: check for missing prerequisite headers? configure: WARNING: resolv.h: see the Autoconf documentation configure: WARNING: resolv.h: section "Present But Cannot Be Compiled" configure: WARNING: resolv.h: proceeding with the preprocessor's result configure: WARNING: resolv.h: in the future, the compiler will take precedence configure: WARNING: ## ------------------------------------------ ## configure: WARNING: ## Report this to the AC_PACKAGE_NAME lists. ## configure: WARNING: ## ------------------------------------------ ## Actually there is a missing header: netinet/in.h needs to be included before resolv.h on the Mac. There were discussion on this from other systems on gnu.org, here: <http://lists.gnu.org/archive/ html/autoconf/2004-10/msg00055.html>. Next, a new m4 macro was added, here: <<http://lists.gnu.org/archive/html/autoconf-patches/ 2004-11/txtlQ6dKl0J2i.txt> Would it be possible to use this check on orbit2, instead of the actual one?
Michele: you'd probably have to provide a patch; i don't think any of the developers of orbit test/build on a mac, so no one is likely to be able to do it themselves. :/
Shreyas - any thoughts ?
Created attachment 49753 [details] [review] Patch for finding resolv.h
I'd prefer to see all the checks in-line and not using acinclude.m5. Also: +dnl AC_CHECK_HEADERS(arpa/nameser.h resolv.h) +AC_CHECK_HEADERS([arpa/nameser.h netinet/in.h sys/socket.h sys/types.h]) don't leave commented out crud in there. Also - why have the AC_CHECK_HEADERS when the AC_HEADER_RESOLV seems to do a similar thing ? Shreyas - can you take this over ?
Created attachment 49883 [details] [review] Patch to find resolv.h New patch, conforming to the new macro in autoconf
I don't know much about m4 macros. Here's a new patch, conforming to the one finally put in December 2004 in autoconf cvs (It removes the check for sys/socket.h, which does not seem to be needed). I've removed the comment, deleted the old AC_CHECK_HEADERS, and inserted the macro inline, as well as removed the usage of acinclude.m4.
Still busted in orbit 2.14.3.
And the patch is mangled so I can't apply it or even make sense of it as it is now.
Here's the exact AC_HEADER_RESOLV from headers.m4 in released autoconf 2.60: # AC_HEADER_RESOLV # ---------------- # According to http://www.mcsr.olemiss.edu/cgi-bin/man-cgi?resolver+3 # (or http://www.chemie.fu-berlin.de/cgi-bin/man/sgi_irix?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 It would not be too much difficult to integrate it in orbit2. That's what I tried to do with the patch, but not an expert here, as I already said.
If that AC_DEFUN is already present in headers.m4, then you can probably just add AC_DEFUN to configure.in and let the standard autotools handle the rest. That's why system-wide .m4 files are made available.
If an AC_DEFUN for that function is already present in headers.m4, then you can probably just add that command (AC_HEADER_RESOLV) to configure.in and let the standard autotools handle the rest. That's why system-wide .m4 files are made available.
At the time I reported this bug, autoconf 2.60 was not released yet. The AC_DEFUN for resolv.h was only added in autoconf 2.60, and this version of ORBIT2 uses an older version of autoconf. So that, two cases here apply: 1 - The autoconf version on the system is 2.60, then configure should be changed to include AC_HEADER_RESOLV and it will do the right job. 2 - The autoconf version is older than 2.60 and there is a need to define this "new" macro in configure.in. One can object that autoconf is already at version 2.60 in Fink, and probably also in MacPorts, but this is not the case on the native system (2.59).
I guess we could bump the required version of autoconf to 2.60 by now? It's almost two years old.
ping. 2.63 is quite standard for gnome2.26ish. But more importantly... configure: WARNING: resolv.h: proceeding with the preprocessor's result configure: WARNING: resolv.h: in the future, the compiler will take precedence "the future" it mentions is here now, as of autoconf-8.64 (just released). So ORBit2-2.14.7 builds without some resolver functionality if autogen'ed with ac8.64 because this test now (unlike before) does not lead to defining HAVE_RESOLV_H.
*** Bug 609889 has been marked as a duplicate of this bug. ***
*** Bug 409500 has been marked as a duplicate of this bug. ***
Closing this now since surely the toolchain on most systems should be able to handle this now. Raised the autoconf requirement to 2.60 and added AC_HEADER_RESOLV.