[mpich2-commits] r4096 - in mpich2/trunk/src/mpid/ch3: . channels/nemesis/nemesis/netmod/tcp
gropp at mcs.anl.gov
gropp at mcs.anl.gov
Mon Mar 16 18:29:32 CDT 2009
Author: gropp
Date: 2009-03-16 18:29:32 -0500 (Mon, 16 Mar 2009)
New Revision: 4096
Modified:
mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/tcp/tcp_getip.c
mpich2/trunk/src/mpid/ch3/configure.in
Log:
Added _ALL_SOURCE as option for struct ifconf; needed for AIX
Modified: mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/tcp/tcp_getip.c
===================================================================
--- mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/tcp/tcp_getip.c 2009-03-16 20:48:21 UTC (rev 4095)
+++ mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/tcp/tcp_getip.c 2009-03-16 23:29:32 UTC (rev 4096)
@@ -29,6 +29,14 @@
#define _SVID_SOURCE
#endif
+#ifdef USE_ALL_SOURCE_FOR_IFCONF
+/* This is a very special case. Allow the use of some extensions for just
+ the rest of this file so that we can get the ifconf structure
+ This is needed for AIX.
+ */
+#define _ALL_SOURCE
+#endif
+
#include "tcp_impl.h"
#include <sys/types.h>
Modified: mpich2/trunk/src/mpid/ch3/configure.in
===================================================================
--- mpich2/trunk/src/mpid/ch3/configure.in 2009-03-16 20:48:21 UTC (rev 4095)
+++ mpich2/trunk/src/mpid/ch3/configure.in 2009-03-16 23:29:32 UTC (rev 4096)
@@ -99,13 +99,10 @@
[ rankbits=$withval ],
[ rankbits=16 ])
AC_MSG_RESULT($rankbits)
-if test "$rankbits" = "16" ; then
- AC_DEFINE(CH3_RANK_BITS,16,[Define the number of CH3_RANK_BITS])
-elif test "$rankbits" = "32" ; then
- AC_DEFINE(CH3_RANK_BITS,32,[Define the number of CH3_RANK_BITS])
-else
+if test "$rankbits" != "16" -a "$rankbits" != "32" ; then
AC_MSG_ERROR(Only 16 or 32-bit ranks are supported)
fi
+AC_DEFINE_UNQUOTED(CH3_RANK_BITS,$rankbits,[Define the number of CH3_RANK_BITS])
AC_CHECK_HEADERS(assert.h limits.h string.h sys/types.h sys/uio.h uuid/uuid.h \
time.h ctype.h unistd.h arpa/inet.h sys/socket.h net/if.h)
@@ -141,6 +138,14 @@
AC_C_BIGENDIAN
# If we need the socket code, see if we can use struct ifconf
+# Some systems require special compile options or definitions, or
+# special header files.
+#
+# To simplify this sequence of tests, we set
+# pac_found_struct_ifconf
+# to yes when we figure out how to get struct ifconf
+pac_found_struct_ifconf=no
+#
# sys/socket.h is needed on Solaris
AC_CACHE_CHECK([whether we can use struct ifconf],
pac_cv_have_struct_ifconf,[
@@ -151,9 +156,10 @@
#endif
#include <net/if.h>
],[struct ifconf conftest;],
-pac_cv_have_struct_ifconf=yes,pac_cv_have_struct_ifconf=no)])
+[pac_cv_have_struct_ifconf=yes;pac_found_struct_ifconf=yes],
+ pac_cv_have_struct_ifconf=no)])
-if test "$pac_cv_have_struct_ifconf" = "no" ; then
+if test "$pac_found_struct_ifconf" = "no" ; then
# Try again with _SVID_SOURCE
AC_CACHE_CHECK([whether we can use struct ifconf with _SVID_SOURCE],
pac_cv_have_struct_ifconf_with_svid,[
@@ -165,15 +171,14 @@
#endif
#include <net/if.h>
],[struct ifconf conftest;],
-pac_cv_have_struct_ifconf_with_svid=yes,
+pac_cv_have_struct_ifconf_with_svid=yes;pac_found_struct_ifconf=yes,
pac_cv_have_struct_ifconf_with_svid=no)])
if test "$pac_cv_have_struct_ifconf_with_svid" = yes ; then
AC_DEFINE(USE_SVIDSOURCE_FOR_IFCONF,1,[Define if _SVID_SOURCE needs to be defined for struct ifconf])
fi
fi
-if test "$pac_cv_have_struct_ifconf" = "no" -a \
- "$pac_cv_have_struct_ifconf_with_svid" = "no" ; then
+if test "$pac_found_struct_ifconf" = "no" ; then
# Try again with undef _POSIX_C_SOURCE
AC_CACHE_CHECK([whether we can use struct ifconf without _POSIX_C_SOURCE],
pac_cv_have_struct_ifconf_without_posix,[
@@ -185,16 +190,33 @@
#endif
#include <net/if.h>
],[struct ifconf conftest;],
-pac_cv_have_struct_ifconf_without_posix=yes,
+pac_cv_have_struct_ifconf_without_posix=yes;pac_found_struct_ifconf=yes,
pac_cv_have_struct_ifconf_without_posix=no)])
if test "$pac_cv_have_struct_ifconf_without_posix" = yes ; then
AC_DEFINE(USE_NOPOSIX_FOR_IFCONF,1,[Define if _POSIX_C_SOURCE needs to be undefined for struct ifconf])
fi
fi
-if test "$pac_cv_have_struct_ifconf" = "yes" -o \
- "$pac_cv_have_struct_ifconf_with_svid" = "yes" -o \
- "$pac_cv_have_struct_ifconf_without_posix" ; then
+if test "$pac_found_struct_ifconf" = "no" ; then
+ # Try again with _ALL_SOURCE
+ AC_CACHE_CHECK([whether we can use struct ifconf with _ALL_SOURCE],
+pac_cv_have_struct_ifconf_with_svid,[
+AC_TRY_COMPILE([
+#define _ALL_SOURCE
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#include <net/if.h>
+],[struct ifconf conftest;],
+pac_cv_have_struct_ifconf_with_all_source=yes;pac_found_struct_ifconf=yes,
+pac_cv_have_struct_ifconf_with_all_source=no)])
+ if test "$pac_cv_have_struct_ifconf_with_all_source" = yes ; then
+ AC_DEFINE(USE_ALL_SOURCE_FOR_IFCONF,1,[Define if _ALL_SOURCE needs to be defined for struct ifconf])
+ fi
+fi
+
+if test "$pac_found_struct_ifconf" = "yes" ; then
AC_DEFINE(HAVE_STRUCT_IFCONF,1,[Define if struct ifconf can be used])
fi
#
More information about the mpich2-commits
mailing list