summaryrefslogtreecommitdiff
path: root/legacy/eet/m4/efl_pthread.m4
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2009-12-03 15:35:04 +0000
committerCedric BAIL <cedric.bail@free.fr>2009-12-03 15:35:04 +0000
commitaf13fe5496052e9a0793fad812334b2c2c749041 (patch)
treeaf0056c075feb7cc85c1715a0a6127b85c78676b /legacy/eet/m4/efl_pthread.m4
parent7de1f120c2c4f744b12e5779449d41b85f3864fd (diff)
* eet: All operation on Eet_File should be thread safe. This should
make use of all eet primitive thread safe now. Please any bug or lock that you find. SVN revision: 44172
Diffstat (limited to 'legacy/eet/m4/efl_pthread.m4')
-rw-r--r--legacy/eet/m4/efl_pthread.m471
1 files changed, 71 insertions, 0 deletions
diff --git a/legacy/eet/m4/efl_pthread.m4 b/legacy/eet/m4/efl_pthread.m4
new file mode 100644
index 0000000000..7bd341c709
--- /dev/null
+++ b/legacy/eet/m4/efl_pthread.m4
@@ -0,0 +1,71 @@
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([--disable-pthread], [enable POSIX threads code @<:@default=yes@:>@])],
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="yes"])
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 AC_CHECK_HEADER(pthread.h,
35 [_efl_have_pthread="yes"],
36 [_efl_have_pthread="no"])
37fi
38
39AC_MSG_CHECKING([whether system support POSIX threads])
40AC_MSG_RESULT([${_efl_enable_pthread}])
41
42if test "x${_efl_have_pthread}" = "xyes" ; then
43 case "$host_os" in
44 mingw*)
45 EFL_PTHREAD_CFLAGS="-mthreads"
46 EFL_PTHREAD_LIBS="-mthreads -lpthreadGC2"
47 ;;
48 solaris*)
49 EFL_PTHREAD_CFLAGS="-mt"
50 EFL_PTHREAD_LIBS="-mt"
51 ;;
52 *)
53 EFL_PTHREAD_CFLAGS="-pthread"
54 EFL_PTHREAD_LIBS="-pthread"
55 ;;
56 esac
57fi
58
59AC_SUBST(EFL_PTHREAD_CFLAGS)
60AC_SUBST(EFL_PTHREAD_LIBS)
61
62if test "x${_efl_have_pthread}" = "xyes" ; then
63 AC_DEFINE(EFL_HAVE_PTHREAD, 1, [Define to mention that POSIX threads are supported])
64fi
65
66if test "x${_efl_have_pthread}" = "xyes" ; then
67 ifelse([$1], , :, [$1])
68else
69 ifelse([$2], , :, [$2])
70fi
71])