summaryrefslogtreecommitdiff
path: root/legacy/eina/m4/efl_pthread.m4
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2009-08-20 08:31:26 +0000
committerVincent Torri <vincent.torri@gmail.com>2009-08-20 08:31:26 +0000
commit5213fca4893dadbc4e34ed426e865c187e9ceaa5 (patch)
treed0282255f84c41265fd4fb6374b381b9e2d1b9ef /legacy/eina/m4/efl_pthread.m4
parent2e7e9169e7149fe692f8c124331881c041dc6e52 (diff)
rewrite a bit that m4 macro
SVN revision: 41881
Diffstat (limited to '')
-rw-r--r--legacy/eina/m4/efl_pthread.m456
1 files changed, 19 insertions, 37 deletions
diff --git a/legacy/eina/m4/efl_pthread.m4 b/legacy/eina/m4/efl_pthread.m4
index b11ae84f62..30f364b6bc 100644
--- a/legacy/eina/m4/efl_pthread.m4
+++ b/legacy/eina/m4/efl_pthread.m4
@@ -13,7 +13,7 @@ AC_DEFUN([EFL_CHECK_PTHREAD],
13dnl configure option 13dnl configure option
14 14
15AC_ARG_ENABLE([pthread], 15AC_ARG_ENABLE([pthread],
16 [AC_HELP_STRING([--disable-pthread], [enable POSIX threads code @<:@default=no@:>@])], 16 [AC_HELP_STRING([--disable-pthread], [enable POSIX threads code @<:@default=yes@:>@])],
17 [ 17 [
18 if test "x${enableval}" = "xyes" ; then 18 if test "x${enableval}" = "xyes" ; then
19 _efl_enable_pthread="yes" 19 _efl_enable_pthread="yes"
@@ -21,8 +21,8 @@ AC_ARG_ENABLE([pthread],
21 _efl_enable_pthread="no" 21 _efl_enable_pthread="no"
22 fi 22 fi
23 ], 23 ],
24 [_efl_enable_pthread="yes"] 24 [_efl_enable_pthread="yes"])
25) 25
26AC_MSG_CHECKING([whether to build POSIX threads code]) 26AC_MSG_CHECKING([whether to build POSIX threads code])
27AC_MSG_RESULT([${_efl_enable_pthread}]) 27AC_MSG_RESULT([${_efl_enable_pthread}])
28 28
@@ -31,43 +31,25 @@ dnl check if the compiler supports pthreads
31_efl_have_pthread="no" 31_efl_have_pthread="no"
32 32
33if test "x${_efl_enable_pthread}" = "xyes" ; then 33if test "x${_efl_enable_pthread}" = "xyes" ; then
34 34 AC_CHECK_HEADER(pthread.h,
35 SAVE_CFLAGS=${CFLAGS} 35 [_efl_have_pthread="yes"],
36 CFLAGS="-pthread" 36 [_efl_have_pthread="no"])
37 AC_LANG_PUSH([C])
38
39 AC_COMPILE_IFELSE(
40 [AC_LANG_PROGRAM([[
41#include <pthread.h>
42 ]],
43 [[]])
44 ],
45 [
46 _efl_have_pthread="yes"
47 EFL_PTHREAD_CFLAGS="-pthread"
48 EFL_PTHREAD_LIBS="-pthread"
49 ]
50 )
51
52 AC_LANG_POP([C])
53 CFLAGS=${SAVE_CFLAGS}
54fi 37fi
55 38
56AC_MSG_CHECKING([whether compiler need -pthread POSIX for threads support]) 39AC_MSG_CHECKING([whether system support POSIX threads])
57AC_MSG_RESULT([${_efl_have_pthread}]) 40AC_MSG_RESULT([${_efl_enable_pthread}])
58
59if test "x${_efl_have_pthread}" = "xno" -a "x${_efl_enable_pthread}" = "xyes" ; then
60 AC_CHECK_HEADER(pthread.h,
61 [
62 _efl_have_pthread="yes"
63 EFL_PTHREAD_LIBS="-lpthread"
64 ],
65 [
66 _efl_have_pthread="no"
67 ])
68 41
69 AC_MSG_CHECKING([whether system support POSIX threads]) 42if test "x${_efl_have_pthread}" = "xyes" ; then
70 AC_MSG_RESULT([${_efl_enable_pthread}]) 43 case "$host_os" in
44 solaris*)
45 EFL_PTHREAD_CFLAGS="-mt"
46 EFL_PTHREAD_LIBS="-mt"
47 ;;
48 *)
49 EFL_PTHREAD_CFLAGS="-pthread"
50 EFL_PTHREAD_LIBS="-pthead"
51 ;;
52 esac
71fi 53fi
72 54
73AC_SUBST(EFL_PTHREAD_CFLAGS) 55AC_SUBST(EFL_PTHREAD_CFLAGS)