summaryrefslogtreecommitdiff
path: root/legacy/eina/m4/efl_pthread.m4
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2008-10-03 15:28:13 +0000
committerVincent Torri <vincent.torri@gmail.com>2008-10-03 15:28:13 +0000
commit89d5e6f07332af1f34efad33c13119a928d68628 (patch)
treef5ad4d33ae5620ec4f2068598166eedb8392e332 /legacy/eina/m4/efl_pthread.m4
parent9b59c2205cadc6ac30231470c3a523c52ff99734 (diff)
* add detection of SIMD and thread support
* minor formatting SVN revision: 36418
Diffstat (limited to '')
-rw-r--r--legacy/eina/m4/efl_pthread.m467
1 files changed, 67 insertions, 0 deletions
diff --git a/legacy/eina/m4/efl_pthread.m4 b/legacy/eina/m4/efl_pthread.m4
new file mode 100644
index 0000000000..172acef9ab
--- /dev/null
+++ b/legacy/eina/m4/efl_pthread.m4
@@ -0,0 +1,67 @@
1dnl Copyright (C) 2008 Vincent Torri <vtorri at univ-evry dot fr>
2dnl That code is public domain and can be freely used or copied.
3
4dnl Macro that check if several ASM instruction sets are available or not.
5
6dnl Usage: EFL_CHECK_EFL_CHECK_PTHREAD([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
7dnl Call AC_SUBST(EFL_PTHREAD_FLAGS)
8dnl Define EFL_HAVE_PTHREAD
9
10AC_DEFUN([EFL_CHECK_PTHREAD],
11[
12
13dnl configure option
14
15AC_ARG_ENABLE([pthread],
16 [AC_HELP_STRING([--enable-pthread], [enable POSIX threads code @<:@default=no@:>@])],
17 [
18 if test "x${enableval}" = "xyes" ; then
19 _efl_enable_pthread="yes"
20 else
21 _efl_enable_pthread="no"
22 fi
23 ],
24 [_efl_enable_pthread="no"]
25)
26AC_MSG_CHECKING([whether to build POSIX threads code])
27AC_MSG_RESULT([${_efl_enable_pthread}])
28
29dnl check if the compiler supports pthreads
30
31_efl_have_pthread="no"
32
33if test "x${_efl_enable_pthread}" = "xyes" ; then
34
35 SAVE_CFLAGS=${CFLAGS}
36 CFLAGS="-pthread"
37 AC_LANG_PUSH([C])
38
39 AC_COMPILE_IFELSE(
40 [AC_LANG_PROGRAM([[
41#include <pthread.h>
42 ]],
43 [[]])
44 ],
45 [_efl_have_pthread="yes"
46 EFL_PTHREAD_FLAGS="-pthread"]
47 )
48
49 AC_LANG_POP([C])
50 CFLAGS=${SAVE_CFLAGS}
51fi
52
53AC_MSG_CHECKING([whether POSIX threads are supported])
54AC_MSG_RESULT([${_efl_have_pthread}])
55
56AC_SUBST(EFL_PTHREAD_FLAGS)
57
58if test "x${_efl_have_pthread}" = "xyes" ; then
59 AC_DEFINE(EFL_HAVE_PTHREAD, 1, [Define to mention that POSIX threads are supported])
60fi
61
62if test "x${_efl_have_pthread}" = "xyes" ; then
63 ifelse([$1], , :, [$1])
64else
65 ifelse([$2], , :, [$2])
66fi
67])