public inbox for java-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch] Fix configure glitch on Solaris
@ 2009-12-06 15:46 Eric Botcazou
  2009-12-07  9:26 ` Andrew Haley
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Botcazou @ 2009-12-06 15:46 UTC (permalink / raw)
  To: java-patches

[-- Attachment #1: Type: text/plain, Size: 505 bytes --]

Hi,

natVMNetworkInterfacePosix.cc fails to compile under Solaris because 'struct 
ifconf' is not defined because net/if.h is not included, the root problem 
being that net/if.h requires sys/socket.h and the configure machinery doesn't 
provide it.

Hence the attached patch, tested on SPARC/Solaris 9 and AMD64/Linux.  OK for 
mainline?


2009-12-06  Eric Botcazou  <ebotcazou@adacore.com>

	* configure.ac (net/if.h check): Include sys/socket.h if present.
	* configure: Regenerate.


-- 
Eric Botcazou

[-- Attachment #2: solaris_libjava.diff --]
[-- Type: text/x-diff, Size: 957 bytes --]

Index: configure.ac
===================================================================
--- configure.ac	(revision 155009)
+++ configure.ac	(working copy)
@@ -1568,9 +1568,17 @@ TL_AC_GXX_INCLUDE_DIR
 # for now.  If you change this, you also must update natFile.cc.
 AC_CHECK_HEADERS([unistd.h bstring.h sys/time.h sys/types.h fcntl.h \
 		  sys/ioctl.h sys/filio.h sys/stat.h sys/select.h \
-		  sys/socket.h netinet/in.h arpa/inet.h netdb.h net/if.h \
+		  sys/socket.h netinet/in.h arpa/inet.h netdb.h \
 		  pwd.h sys/config.h stdint.h langinfo.h locale.h \
 		  dirent.h sys/rw_lock.h magic.h ifaddrs.h])
+
+# sys/socket.h is a prerequisite for net/if.h on Solaris.
+AC_CHECK_HEADERS(net/if.h, [], [], [
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+])
+
 AC_CHECK_HEADERS(inttypes.h, [
     AC_DEFINE(HAVE_INTTYPES_H, 1, [Define if <inttypes.h> is available])
     AC_DEFINE(JV_HAVE_INTTYPES_H, 1, [Define if <inttypes.h> is available])

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch] Fix configure glitch on Solaris
  2009-12-06 15:46 [patch] Fix configure glitch on Solaris Eric Botcazou
@ 2009-12-07  9:26 ` Andrew Haley
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Haley @ 2009-12-07  9:26 UTC (permalink / raw)
  To: Eric Botcazou; +Cc: java-patches

Eric Botcazou wrote:
> Hi,
> 
> natVMNetworkInterfacePosix.cc fails to compile under Solaris because 'struct 
> ifconf' is not defined because net/if.h is not included, the root problem 
> being that net/if.h requires sys/socket.h and the configure machinery doesn't 
> provide it.
> 
> Hence the attached patch, tested on SPARC/Solaris 9 and AMD64/Linux.  OK for 
> mainline?
> 
> 
> 2009-12-06  Eric Botcazou  <ebotcazou@adacore.com>
> 
> 	* configure.ac (net/if.h check): Include sys/socket.h if present.
> 	* configure: Regenerate.

Sure.

Thanks,
Andrew.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-12-07  9:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-06 15:46 [patch] Fix configure glitch on Solaris Eric Botcazou
2009-12-07  9:26 ` Andrew Haley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).