summaryrefslogtreecommitdiff
path: root/m4/efl_threads.m4
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@samsung.com>2014-02-19 11:02:33 +0900
committerCedric BAIL <cedric.bail@samsung.com>2014-02-19 11:02:33 +0900
commitec18feddd7a6b647dd6eeca9a97358bbee8c3f72 (patch)
tree0aef32691512fd13634e1de69143d17e5b120a39 /m4/efl_threads.m4
parent4f2f71b3dab2e57d4990792e22c7461069aa90e1 (diff)
Revert "autotools: try improving thread detection."
This reverts commit 14c6378fc41906db14464e17aadc7d94a825fafd. So either we get to fix T880 or T986. I do think the problem is more tricky than that, so I am for the moment going to get T880 broken rather than T986 as I think the later will show up in more case for our user base. Will try to find a proper solution for everyone before the next release.
Diffstat (limited to 'm4/efl_threads.m4')
-rw-r--r--m4/efl_threads.m439
1 files changed, 20 insertions, 19 deletions
diff --git a/m4/efl_threads.m4 b/m4/efl_threads.m4
index f1b0cb3..04b3e64 100644
--- a/m4/efl_threads.m4
+++ b/m4/efl_threads.m4
@@ -14,18 +14,15 @@ AC_DEFUN([EFL_CHECK_THREADS],
14 14
15dnl Generic thread detection 15dnl Generic thread detection
16 16
17dnl Use generic infrastructure for pthread detection (What a hell of a mess !) 17EFL_PTHREAD_CFLAGS="-D_REENTRANT"
18_efl_have_ax_threads="no" 18EFL_PTHREAD_LIBS=""
19AX_PTHREAD([
20 EFL_PTHREAD_CFLAGS="${PTHREAD_CFLAGS}"
21 EFL_PTHREAD_LIBS="${PTHREAD_LIBS}"
22 CC="${PTHREAD_CC}"
23 _efl_have_ax_threads="yes"
24 ])
25 19
26_efl_have_posix_threads="no" 20_efl_have_posix_threads="no"
27_efl_have_win32_threads="no" 21_efl_have_win32_threads="no"
28 22
23dnl Use generic infrastructure for pthread detection (What a hell of a mess !)
24gl_LOCK
25
29AC_DEFINE([EFL_HAVE_THREADS], [1], [Define to mention that POSIX or Win32 threads are supported]) 26AC_DEFINE([EFL_HAVE_THREADS], [1], [Define to mention that POSIX or Win32 threads are supported])
30 27
31case "$host_os" in 28case "$host_os" in
@@ -35,18 +32,25 @@ case "$host_os" in
35 AC_DEFINE([EFL_HAVE_WIN32_THREADS], [1], [Define to mention that Win32 threads are supported]) 32 AC_DEFINE([EFL_HAVE_WIN32_THREADS], [1], [Define to mention that Win32 threads are supported])
36 ;; 33 ;;
37 *) 34 *)
38 _efl_have_posix_threads="${_efl_have_ax_threads}" 35 _efl_have_posix_threads="${gl_use_threads}"
39 AC_DEFINE([EFL_HAVE_POSIX_THREADS], [1], [Define to mention that POSIX threads are supported]) 36 AC_DEFINE([EFL_HAVE_POSIX_THREADS], [1], [Define to mention that POSIX threads are supported])
40 ;; 37 ;;
41esac 38esac
42 39
43dnl check if the compiler supports POSIX thread barrier and setaffinity 40dnl System specific CFLAGS
41if test "x${_efl_have_posix_threads}" = "xyes"; then
42 case "$host_os" in
43 osf*) EFL_PTHREAD_CFLAGS="-D_REENTRANT" ;;
44 aix* | freebsd*) EFL_PTHREAD_CFLAGS="-D_THREAD_SAFE" ;;
45 solaris*) EFL_PTHREAD_CFLAGS="-D_REENTRANT" ;;
46 esac
47fi
48
49dnl check if the compiler supports POSIX threads
44if test "x${_efl_have_posix_threads}" = "xyes" ; then 50if test "x${_efl_have_posix_threads}" = "xyes" ; then
45 51
46 SAVE_LIBS=${LIBS} 52 SAVE_LIBS=${LIBS}
47 SAVE_CFLAGS=${CFLAGS} 53 LIBS="${LIBS} ${LIBMULTITHREAD}"
48 LIBS="${LIBS} ${PTHREAD_LIBS}"
49 CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS}"
50 AC_LINK_IFELSE( 54 AC_LINK_IFELSE(
51 [AC_LANG_PROGRAM([[ 55 [AC_LANG_PROGRAM([[
52#include <pthread.h> 56#include <pthread.h>
@@ -69,7 +73,6 @@ pthread_attr_setaffinity_np(NULL, 0, NULL);
69 [efl_have_setaffinity="yes"], 73 [efl_have_setaffinity="yes"],
70 [efl_have_setaffinity="no"]) 74 [efl_have_setaffinity="no"])
71 LIBS=${SAVE_LIBS} 75 LIBS=${SAVE_LIBS}
72 CFLAGS=${SAVE_CFLAGS}
73fi 76fi
74 77
75AC_MSG_CHECKING([which threads API is used]) 78AC_MSG_CHECKING([which threads API is used])
@@ -86,6 +89,8 @@ else
86fi 89fi
87AC_MSG_RESULT([${efl_have_threads}]) 90AC_MSG_RESULT([${efl_have_threads}])
88 91
92EFL_PTHREAD_LIBS="${LTLIBMULTITHREAD}"
93
89AC_SUBST(EFL_PTHREAD_CFLAGS) 94AC_SUBST(EFL_PTHREAD_CFLAGS)
90AC_SUBST(EFL_PTHREAD_LIBS) 95AC_SUBST(EFL_PTHREAD_LIBS)
91 96
@@ -94,11 +99,8 @@ dnl check if the compiler supports pthreads spinlock
94efl_have_posix_threads_spinlock="no" 99efl_have_posix_threads_spinlock="no"
95 100
96if test "x${_efl_have_posix_threads}" = "xyes" ; then 101if test "x${_efl_have_posix_threads}" = "xyes" ; then
97
98 SAVE_LIBS=${LIBS} 102 SAVE_LIBS=${LIBS}
99 SAVE_CFLAGS=${CFLAGS} 103 LIBS="${LIBS} ${LIBMULTITHREAD}"
100 LIBS="${LIBS} ${PTHREAD_LIBS}"
101 CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS}"
102 AC_LINK_IFELSE( 104 AC_LINK_IFELSE(
103 [AC_LANG_PROGRAM([[ 105 [AC_LANG_PROGRAM([[
104#include <pthread.h> 106#include <pthread.h>
@@ -113,7 +115,6 @@ sched_yield();
113 [efl_have_posix_threads_spinlock="yes"], 115 [efl_have_posix_threads_spinlock="yes"],
114 [efl_have_posix_threads_spinlock="no"]) 116 [efl_have_posix_threads_spinlock="no"])
115 LIBS=${SAVE_LIBS} 117 LIBS=${SAVE_LIBS}
116 CFLAGS=${SAVE_CFLAGS}
117 118
118fi 119fi
119 120