From 65e9d3ec365628b93a0da846f27259d8e6ad85fe Mon Sep 17 00:00:00 2001 From: samelian Date: Mon, 17 Jan 2011 17:01:57 +0000 Subject: [applications/amarok] sched_setaffinity buggy glibc check git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/amarok@1215101 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- ConfigureChecks.cmake | 30 ++++++++++++++++++++++++++++++ config.h.cmake | 2 ++ 2 files changed, 32 insertions(+) diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index 15729b8f..6f2191f3 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -19,6 +19,36 @@ check_include_file( linux/inotify.h HAVE_INOTIFY ) check_function_exists( statvfs HAVE_STATVFS ) +# sched_setaffinity buggy glibc check +check_c_source_compiles(" + #define _GNU_SOURCE + #include + int main() { + cpu_set_t mask; + CPU_ZERO(&mask); + CPU_SET(0, &mask); + sched_setaffinity(0, sizeof(mask), &mask); + return 0; + } " + SCHEDAFFINITY_3PARAMS ) + +if( SCHEDAFFINITY_3PARAMS ) + set( SCHEDAFFINITY_SUPPORT 1 ) +else( ) + check_c_source_compiles(" + #define _GNU_SOURCE + #include + int main() { + cpu_set_t mask; + CPU_ZERO(&mask); + CPU_SET(0, &mask); + sched_setaffinity(0, &mask); + return 0; + } " + SCHEDAFFINITY_SUPPORT ) +endif( ) + + # fabsf tde_save( CMAKE_REQUIRED_LIBRARIES ) set( CMAKE_REQUIRED_LIBRARIES m ) diff --git a/config.h.cmake b/config.h.cmake index 2ad6e580..101a7d43 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -2,6 +2,8 @@ #cmakedefine SIZEOF_LONG @SIZEOF_LONG@ #cmakedefine HAVE_STDINT_H 1 #cmakedefine HAVE_SYSTEMS_H 1 +#cmakedefine SCHEDAFFINITY_SUPPORT 1 +#cmakedefine SCHEDAFFINITY_3PARAMS 1 #cmakedefine HAVE_FABSF 1 #cmakedefine HAVE_LIBVISUAL 1 #cmakedefine HAVE_INOTIFY 1 -- cgit v1.2.1