Fix tests: finer-grained use of CPU_SET, CPU_ZERO and cpu_set_t
[urcu.git] / configure.ac
index d064a13e00151430353af16ace1e10aff39145a5..a49b39f4d973d71058ff2332c51578208f0e4a6e 100644 (file)
@@ -77,7 +77,7 @@ AS_CASE([$host_cpu],
        [ia64], [ARCHTYPE="gcc"],
        [arm*], [ARCHTYPE="arm"],
        [mips*], [ARCHTYPE="mips"],
-       [tile*], [ARCHTYPE="tile"],
+       [tile*], [ARCHTYPE="gcc"],
        [ARCHTYPE="unknown"]
 )
 
@@ -113,6 +113,21 @@ AS_IF([test "x$ARCHTYPE" = "xarm"],[
        ])
 ])
 
+# Tile-specific checks
+AS_IF([echo "$host_cpu" | grep "^tile"],[
+       AC_MSG_CHECKING([for Tile architecture type])
+       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+                               #ifndef __tilegx__
+                               #error
+                               #endif
+               ]])
+       ],[
+               AC_MSG_RESULT([ok])
+       ],[
+               AC_MSG_FAILURE([URCU has only been tested on the TileGx architecture. For other Tile* architectures, please run the tests first and report the results to the maintainer so that proper support can be added.])
+       ])
+])
+
 # x86-specific checks
 AS_IF([test "x$ARCHTYPE" = "xx86"],[
        AC_MSG_CHECKING([if architecture really supports the mfence instruction])
@@ -216,6 +231,26 @@ AC_CHECK_FUNCS([sched_setaffinity],[
                        AC_MSG_RESULT([no])
                ])
 
+               # Confirm that we have CPU_SET, and it actually works.
+               AC_MSG_CHECKING([whether CPU_SET works])
+               AH_TEMPLATE([HAVE_CPU_SET], [Defined to 1 if we have CPU_SET and it works])
+               AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+                               #define _GNU_SOURCE
+                               #include <sched.h>
+                               int main()
+                               {
+                                       cpu_set_t foo, mask; CPU_SET (0, &foo);
+                                       return 0;
+                               }
+                       ]])
+               ],[
+                       # Works!
+                       AC_DEFINE(HAVE_CPU_SET, 1)
+                       AC_MSG_RESULT([yes])
+               ],[
+                       AC_MSG_RESULT([no])
+               ])
+
                # Check how many arguments does sched_setaffinity take.
                # Should be 3 or 2.
                AC_MSG_CHECKING([how many arguments sched_setaffinity takes])
This page took 0.023096 seconds and 4 git commands to generate.