summaryrefslogtreecommitdiff
path: root/legacy/eet/m4/efl_pthread.m4
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2010-02-28 17:27:38 +0000
committerVincent Torri <vincent.torri@gmail.com>2010-02-28 17:27:38 +0000
commit9129d1d30a6c98210a6c1fe2388309de7066e771 (patch)
treeb6964b8921258c60cbf9a42f20fbda271d19741f /legacy/eet/m4/efl_pthread.m4
parent43908b19051e3a996e55fbd5d500d8b5c37f999a (diff)
abort when pthread is requested but not found
patch by Albin Tonnerre SVN revision: 46655
Diffstat (limited to 'legacy/eet/m4/efl_pthread.m4')
-rw-r--r--legacy/eet/m4/efl_pthread.m426
1 files changed, 17 insertions, 9 deletions
diff --git a/legacy/eet/m4/efl_pthread.m4 b/legacy/eet/m4/efl_pthread.m4
index c1f6e7aa73..e50964fa83 100644
--- a/legacy/eet/m4/efl_pthread.m4
+++ b/legacy/eet/m4/efl_pthread.m4
@@ -1,11 +1,13 @@
1dnl Copyright (C) 2008 Vincent Torri <vtorri at univ-evry dot fr> 1dnl Copyright (C) 2010 Vincent Torri <vtorri at univ-evry dot fr>
2dnl That code is public domain and can be freely used or copied. 2dnl That code is public domain and can be freely used or copied.
3 3
4dnl Macro that check if several ASM instruction sets are available or not. 4dnl Macro that check if several pthread library is available or not.
5 5
6dnl Usage: EFL_CHECK_EFL_CHECK_PTHREAD(want_pthread_spin[, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) 6dnl Usage: EFL_CHECK_PTHREAD(want_pthread_spin[, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
7dnl Call AC_SUBST(EFL_PTHREAD_FLAGS) 7dnl Call AC_SUBST(EFL_PTHREAD_CFLAGS)
8dnl Call AC_SUBST(EFL_PTHREAD_LIBS)
8dnl Define EFL_HAVE_PTHREAD 9dnl Define EFL_HAVE_PTHREAD
10dnl Define EFL_HAVE_PTHREAD_SPINLOCK
9 11
10AC_DEFUN([EFL_CHECK_PTHREAD], 12AC_DEFUN([EFL_CHECK_PTHREAD],
11[ 13[
@@ -13,7 +15,7 @@ AC_DEFUN([EFL_CHECK_PTHREAD],
13dnl configure option 15dnl configure option
14 16
15AC_ARG_ENABLE([pthread], 17AC_ARG_ENABLE([pthread],
16 [AC_HELP_STRING([--disable-pthread], [enable POSIX threads code @<:@default=yes@:>@])], 18 [AC_HELP_STRING([--disable-pthread], [enable POSIX threads code @<:@default=auto@:>@])],
17 [ 19 [
18 if test "x${enableval}" = "xyes" ; then 20 if test "x${enableval}" = "xyes" ; then
19 _efl_enable_pthread="yes" 21 _efl_enable_pthread="yes"
@@ -21,7 +23,7 @@ AC_ARG_ENABLE([pthread],
21 _efl_enable_pthread="no" 23 _efl_enable_pthread="no"
22 fi 24 fi
23 ], 25 ],
24 [_efl_enable_pthread="yes"]) 26 [_efl_enable_pthread="auto"])
25 27
26AC_MSG_CHECKING([whether to build POSIX threads code]) 28AC_MSG_CHECKING([whether to build POSIX threads code])
27AC_MSG_RESULT([${_efl_enable_pthread}]) 29AC_MSG_RESULT([${_efl_enable_pthread}])
@@ -30,7 +32,7 @@ dnl check if the compiler supports pthreads
30 32
31_efl_have_pthread="no" 33_efl_have_pthread="no"
32 34
33if test "x${_efl_enable_pthread}" = "xyes" ; then 35if test "x${_efl_enable_pthread}" = "xyes" || test "x${_efl_enable_pthread}" = "xauto" ; then
34 36
35 AC_COMPILE_IFELSE( 37 AC_COMPILE_IFELSE(
36 [AC_LANG_PROGRAM([[ 38 [AC_LANG_PROGRAM([[
@@ -46,13 +48,16 @@ id = pthread_self();
46fi 48fi
47 49
48AC_MSG_CHECKING([whether system support POSIX threads]) 50AC_MSG_CHECKING([whether system support POSIX threads])
49AC_MSG_RESULT([${_efl_enable_pthread}]) 51AC_MSG_RESULT([${_efl_have_pthread}])
52if test "$x{_efl_enable_pthread}" = "xyes" && test "x${_efl_have_pthread}" = "xno"; then
53 AC_MSG_ERROR([pthread support requested but not found.])
54fi
50 55
51if test "x${_efl_have_pthread}" = "xyes" ; then 56if test "x${_efl_have_pthread}" = "xyes" ; then
52 case "$host_os" in 57 case "$host_os" in
53 mingw*) 58 mingw*)
54 EFL_PTHREAD_CFLAGS="" 59 EFL_PTHREAD_CFLAGS=""
55 EFL_PTHREAD_LIBS="-lpthreadGCE2" 60 EFL_PTHREAD_LIBS="-lpthreadGC2"
56 ;; 61 ;;
57 solaris*) 62 solaris*)
58 EFL_PTHREAD_CFLAGS="-mt" 63 EFL_PTHREAD_CFLAGS="-mt"
@@ -94,6 +99,9 @@ fi
94 99
95AC_MSG_CHECKING([whether to build POSIX threads spinlock code]) 100AC_MSG_CHECKING([whether to build POSIX threads spinlock code])
96AC_MSG_RESULT([${_efl_have_pthread_spinlock}]) 101AC_MSG_RESULT([${_efl_have_pthread_spinlock}])
102if test "$x{_efl_enable_pthread}" = "xyes" && test "x${_efl_have_pthread_spinlock}" = "xno"; then
103 AC_MSG_ERROR([pthread support requested but spinlocks are not supported])
104fi
97 105
98if test "x${_efl_have_pthread_spinlock}" = "xyes" ; then 106if test "x${_efl_have_pthread_spinlock}" = "xyes" ; then
99 AC_DEFINE(EFL_HAVE_PTHREAD_SPINLOCK, 1, [Define to mention that POSIX threads spinlocks are supported]) 107 AC_DEFINE(EFL_HAVE_PTHREAD_SPINLOCK, 1, [Define to mention that POSIX threads spinlocks are supported])