+2008-08-11 Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ * s-oscons-tmplt.c: RTEMS defines AF_INET6 but does support it.
+ * gsocket.h, socket.c: Update to support RTEMS.
+ * gcc-interface/Make-lang.in: Include CFLAGS_FOR_TARGET when cross.
+
2008-08-10 Samuel Tardieu <sam@rfc1149.net>
Robert Dewar <dewar@adacore.com>
./s-oscons-tmplt.exe > s-oscons-tmplt.s
else
-OSCONS_CPP=$(GCC_FOR_TARGET) -E -C \
+OSCONS_CPP=$(GCC_FOR_TARGET) $(CFLAGS_FOR_TARGET) -E -C \
-DTARGET=\"$(target)\" s-oscons-tmplt.c > s-oscons-tmplt.i
-OSCONS_EXTRACT=$(GCC_FOR_TARGET) -S s-oscons-tmplt.i
+OSCONS_EXTRACT=$(GCC_FOR_TARGET) $(CFLAGS_FOR_TARGET) -S s-oscons-tmplt.i
endif
ada/s-oscons.ads : ada/s-oscons-tmplt.c ada/gsocket.h ada/xoscons.adb ada/xutil.ads ada/xutil.adb
#if defined (_AIX) || defined (__FreeBSD__) || defined (__hpux__) || defined (__osf__) || defined (_WIN32) || defined (__APPLE__)
# define HAVE_THREAD_SAFE_GETxxxBYyyy 1
-#elif defined (sgi) || defined (linux) || defined (__GLIBC__) || (defined (sun) && defined (__SVR4) && !defined (__vxworks))
+#elif defined (sgi) || defined (linux) || defined (__GLIBC__) || (defined (sun) && defined (__SVR4) && !defined (__vxworks)) || defined(__rtems__)
# define HAVE_GETxxxBYyyy_R 1
#endif
# define Need_Netdb_Buffer 0
#endif
-#if defined (__FreeBSD__) || defined (__vxworks)
+#if defined (__FreeBSD__) || defined (__vxworks) || defined(__rtems__)
# define Has_Sockaddr_Len 1
#else
# define Has_Sockaddr_Len 0
#endif
CND(AF_INET, "IPv4 address family")
+/**
+ ** RTEMS lies and defines AF_INET6 even though there is no IPV6 support.
+ ** Its TCP/IP stack is in transition. It has newer .h files but no IPV6 yet.
+ **/
+#if defined(__rtems__)
+# undef AF_INET6
+#endif
+
#ifndef AF_INET6
# define AF_INET6 -1
#else
struct servent *rh;
int ri;
-#if defined(__linux__) || defined(__GLIBC__)
+#if defined(__linux__) || defined(__GLIBC__) || defined(__rtems__)
(void) getservbyname_r (name, proto, ret, buf, buflen, &rh);
#else
rh = getservbyname_r (name, proto, ret, buf, buflen);
struct servent *rh;
int ri;
-#if defined(__linux__) || defined(__GLIBC__)
+#if defined(__linux__) || defined(__GLIBC__) || defined(__rtems__)
(void) getservbyport_r (port, proto, ret, buf, buflen, &rh);
#else
rh = getservbyport_r (port, proto, ret, buf, buflen);