]> rtime.felk.cvut.cz Git - orte.git/blobdiff - configure.ac
JORTE: ignore 'int-to-pointer' and 'pointer-to-int' compiler warnings
[orte.git] / configure.ac
index 7aeede73f8b70104d0e6e0b2abd9ba823ea2c732..ce6c0a2a9dcee9f7a65cb839cda2cb52129fce1a 100644 (file)
@@ -184,6 +184,7 @@ fi
 if test ${WIN} == 'yes' ; then
     AC_CHECK_HEADERS([\
     winsock2.h ws2tcpip.h windows.h w32api/windows.h],,,[[]])
+    AC_CHECK_FUNCS([gettimeofday])
 fi
 # kernel
 if test ${CONFIG_ORTE_KERNEL} == 'yes' ; then
@@ -235,7 +236,64 @@ AC_SUBST(INCLUDES)
 
 ###############################
 # Checks for typedefs, structures, and compiler characteristics.
-AC_C_BIGENDIAN
+need_endian_test=yes
+AC_CHECK_HEADERS([endian.h sys/param.h], [], [],[])
+
+if test "$ac_cv_header_sys_param_h" == 'yes' ; then
+    AC_MSG_CHECKING([whether BYTE_ORDER defined in sys/param.h])
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/param.h>], [
+                        unsigned int a=BYTE_ORDER;
+                        unsigned int b=BIG_ENDIAN;
+                        unsigned int c=LITTLE_ENDIAN;])],
+                      [AC_MSG_RESULT([yes])
+                       need_endian_test=no],[AC_MSG_RESULT([no])])
+
+    if test "$need_endian_test" == 'yes' ; then
+        AC_MSG_CHECKING([whether __BYTE_ORDER defined in sys/param.h])
+        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/param.h>], [
+                        unsigned int a=__BYTE_ORDER;
+                        unsigned int b=__BIG_ENDIAN;
+                        unsigned int c=__LITTLE_ENDIAN;])],
+                      [AC_MSG_RESULT([yes])
+                       need_endian_test=no],[AC_MSG_RESULT([no])])
+    fi
+fi
+if test "$ac_cv_header_endian_h" == 'yes' ; then
+    if test "$need_endian_test" == 'yes' ; then
+        AC_MSG_CHECKING([whether endian can be determined from endian.h])
+        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <endian.h>], [
+                        unsigned int a=__BYTE_ORDER;
+                        unsigned int b=__BIG_ENDIAN;
+                        unsigned int c=__LITTLE_ENDIAN;])],
+                      [AC_MSG_RESULT([yes])
+                       need_endian_test=no],[AC_MSG_RESULT([no])])
+    fi
+fi
+
+if test "$need_endian_test" == 'yes' ; then
+  AC_C_BIGENDIAN
+fi
+
+AH_BOTTOM([
+#if defined(HAVE_ENDIAN_H) || defined(HAVE_SYS_PARAM_H)
+  #ifdef HAVE_SYS_PARAM_H
+    #include <sys/param.h>
+  #endif
+  #if defined(HAVE_ENDIAN_H) && !defined(BYTE_ORDER) && !defined(__BYTE_ORDER)
+    #include <endian.h>
+  #endif
+  #if defined(__BYTE_ORDER)
+    #if __BYTE_ORDER == __BIG_ENDIAN
+      #define WORDS_BIGENDIAN 1
+    #endif
+  #elif defined(BYTE_ORDER)
+    #if BYTE_ORDER == BIG_ENDIAN
+      #define WORDS_BIGENDIAN 1
+    #endif
+  #endif
+#endif
+])
+
 AC_C_CONST
 AC_C_INLINE
 
@@ -272,7 +330,7 @@ chmod +x modtool
 #              generate orte/include/orte/orte_config.h
 # ======================================================================
 
-AC_MSG_NOTICE([creating orte/include/orte/orte_config.h])
+AC_MSG_NOTICE([fixing orte/include/orte/orte_config.h])
 sed -e "s/ PACKAGE/ ORTE_PACKAGE/" -e "s/ VERSION/ ORTE_VERSION/" \
     orte/include/orte/orte_config.h >orte/include/orte/orte_config.h.new
 if cmp -s orte/include/orte/orte_config.h.new orte/include/orte/orte_config.h; then