summaryrefslogtreecommitdiff
path: root/legacy/ecore/m4/efl_pthread.m4
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2009-11-11 23:43:58 +0000
committerVincent Torri <vincent.torri@gmail.com>2009-11-11 23:43:58 +0000
commit1b7b929a095f55b477110c9c357b3a31ee3775af (patch)
tree5a0899848d12e1e52b76a1a1b7f4c3acebe3537d /legacy/ecore/m4/efl_pthread.m4
parent1b98d1216c931a906b102b97674cc54755c0f4bc (diff)
* link correctly ecore against pthread
* use the efl_pthread.m4 macro * add configure output for pthread support in ecore SVN revision: 43627
Diffstat (limited to '')
-rw-r--r--legacy/ecore/m4/efl_pthread.m471
1 files changed, 71 insertions, 0 deletions
diff --git a/legacy/ecore/m4/efl_pthread.m4 b/legacy/ecore/m4/efl_pthread.m4
new file mode 100644
index 0000000000..7bd341c709
--- /dev/null
+++ b/legacy/ecore/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])