summaryrefslogtreecommitdiff
path: root/legacy/evil/m4
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2011-12-16 17:50:13 +0000
committerVincent Torri <vincent.torri@gmail.com>2011-12-16 17:50:13 +0000
commitb21fb2cb051cbd5a20f661959517a16ac74f3960 (patch)
treef12cd746d510e91d4714e6788c00afea62ac054a /legacy/evil/m4
parent28aec29e9f1e75aa2aeec9435772d2ec22c16aac (diff)
Evil: organize the m4 files in common and "private" dirs, remove mpatrol, add a "windows-version" option to configure
SVN revision: 66293
Diffstat (limited to 'legacy/evil/m4')
-rwxr-xr-xlegacy/evil/m4/ac_attribute.m446
-rw-r--r--legacy/evil/m4/common/efl_attribute.m456
-rwxr-xr-xlegacy/evil/m4/common/efl_doxygen.m4 (renamed from legacy/evil/m4/efl_doxygen.m4)0
-rwxr-xr-xlegacy/evil/m4/efl_mpatrol.m4130
-rw-r--r--legacy/evil/m4/evil/evil_windows.m459
5 files changed, 115 insertions, 176 deletions
diff --git a/legacy/evil/m4/ac_attribute.m4 b/legacy/evil/m4/ac_attribute.m4
deleted file mode 100755
index 3926d23d56..0000000000
--- a/legacy/evil/m4/ac_attribute.m4
+++ /dev/null
@@ -1,46 +0,0 @@
1dnl Copyright (C) 2004-2008 Kim Woelders
2dnl Copyright (C) 2008 Vincent Torri <vtorri at univ-evry dot fr>
3dnl That code is public domain and can be freely used or copied.
4dnl Originally snatched from somewhere...
5
6dnl Macro for checking if the compiler supports __attribute__
7
8dnl Usage: AC_C___ATTRIBUTE__
9dnl call AC_DEFINE for HAVE___ATTRIBUTE__ and __UNUSED__
10dnl if the compiler supports __attribute__, HAVE___ATTRIBUTE__ is
11dnl defined to 1 and __UNUSED__ is defined to __attribute__((unused))
12dnl otherwise, HAVE___ATTRIBUTE__ is not defined and __UNUSED__ is
13dnl defined to nothing.
14
15AC_DEFUN([AC_C___ATTRIBUTE__],
16[
17
18AC_MSG_CHECKING([for __attribute__])
19
20AC_CACHE_VAL([ac_cv___attribute__],
21 [AC_TRY_COMPILE(
22 [
23#include <stdlib.h>
24
25int func(int x);
26int foo(int x __attribute__ ((unused)))
27{
28 exit(1);
29}
30 ],
31 [],
32 [ac_cv___attribute__="yes"],
33 [ac_cv___attribute__="no"]
34 )]
35)
36
37AC_MSG_RESULT($ac_cv___attribute__)
38
39if test "x${ac_cv___attribute__}" = "xyes" ; then
40 AC_DEFINE([HAVE___ATTRIBUTE__], [1], [Define to 1 if your compiler has __attribute__])
41 AC_DEFINE([__UNUSED__], [__attribute__((unused))], [Macro declaring a function argument to be unused])
42 else
43 AC_DEFINE([__UNUSED__], [], [Macro declaring a function argument to be unused])
44fi
45
46])
diff --git a/legacy/evil/m4/common/efl_attribute.m4 b/legacy/evil/m4/common/efl_attribute.m4
new file mode 100644
index 0000000000..78bff15679
--- /dev/null
+++ b/legacy/evil/m4/common/efl_attribute.m4
@@ -0,0 +1,56 @@
1dnl Copyright (C) 2011 Vincent Torri <vtorri at univ-evry dot fr>
2dnl That code is public domain and can be freely used or copied.
3
4dnl Macros for checking if the compiler supports some __attribute__ uses
5
6dnl Usage: EFL_ATTRIBUTE_UNUSED
7dnl call AC_DEFINE for __UNUSED__ if __attribute__((unused)) is available
8
9AC_DEFUN([EFL_ATTRIBUTE_UNUSED],
10[
11AC_MSG_CHECKING([for __attribute__ ((unused))])
12AC_COMPILE_IFELSE(
13 [AC_LANG_PROGRAM(
14 [[
15void foo(int x __attribute__ ((unused))) {}
16 ]],
17 [[
18 ]])],
19 [have_attribute_unused="yes"],
20 [have_attribute_unused="no"])
21AC_MSG_RESULT([${have_attribute_unused}])
22
23if test "x${have_attribute_unused}" = "xyes" ; then
24 AC_DEFINE([__UNUSED__], [__attribute__ ((unused))], [Macro declaring a function argument to be unused.])
25else
26 AC_DEFINE([__UNUSED__], [], [__attribute__ ((unused)) is not supported.])
27fi
28])
29
30dnl Usage: EFL_ATTRIBUTE_VECTOR
31dnl call AC_DEFINE for HAVE_GCC_ATTRIBUTE_VECTOR if __attribute__((vector)) is available
32
33AC_DEFUN([EFL_ATTRIBUTE_VECTOR],
34[
35AC_MSG_CHECKING([for __attribute__ ((vector))])
36AC_COMPILE_IFELSE(
37 [AC_LANG_PROGRAM(
38 [[
39typedef int v4si __attribute__ ((vector_size (16)));
40 ]],
41 [[
42if (sizeof(v4si) == 16)
43 return 0;
44else
45 return -1;
46 ]])],
47 [have_attribute_vector="yes"],
48 [have_attribute_vector="no"])
49AC_MSG_RESULT([${have_attribute_vector}])
50
51if test "x${have_attribute_vector}" = "xyes" ; then
52 AC_DEFINE([HAVE_GCC_ATTRIBUTE_VECTOR], [1], [Define to 1 if your compiler supports __attribute__ ((vector)).])
53fi
54])
55
56dnl End of efl_attribute.m4
diff --git a/legacy/evil/m4/efl_doxygen.m4 b/legacy/evil/m4/common/efl_doxygen.m4
index 0c1452fee0..0c1452fee0 100755
--- a/legacy/evil/m4/efl_doxygen.m4
+++ b/legacy/evil/m4/common/efl_doxygen.m4
diff --git a/legacy/evil/m4/efl_mpatrol.m4 b/legacy/evil/m4/efl_mpatrol.m4
deleted file mode 100755
index 88bf3bed2c..0000000000
--- a/legacy/evil/m4/efl_mpatrol.m4
+++ /dev/null
@@ -1,130 +0,0 @@
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 mpatrol is wanted and if yes, if
5dnl it is available.
6
7dnl Usage: EFL_CHECK_MPATROL([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
8dnl Defines EFL_MPATROL_CPPFLAGS and EFL_MPATROL_LIBS variables
9
10AC_DEFUN([EFL_CHECK_MPATROL],
11[
12
13dnl configure options
14
15AC_ARG_ENABLE([mpatrol],
16 [AC_HELP_STRING([--enable-mpatrol], [enable mpatrol @<:@default=no@:>@])],
17 [
18 if test "x${enableval}" = "xyes" ; then
19 _efl_enable_mpatrol="yes"
20 else
21 _efl_enable_mpatrol="no"
22 fi
23 ],
24 [_efl_enable_mpatrol="no"]
25)
26AC_MSG_CHECKING([whether mpatrol is used])
27AC_MSG_RESULT([${_efl_enable_mpatrol}])
28
29AC_ARG_WITH([mpatrol-dir],
30 [AC_HELP_STRING([--enable-mpatrol-dir], [specify the directory of mpatrol @<:@default=/usr/local@:>@])],
31 [_efl_with_mpatrol_dir=${withval}],
32 [_efl_with_mpatrol_dir="/usr/local"]
33)
34
35AC_ARG_WITH([mpatrol-bindir],
36 [AC_HELP_STRING([--enable-mpatrol-bindir], [specify the binary directory of mpatrol])],
37 [_efl_with_mpatrol_bindir=${withval}]
38)
39
40AC_ARG_WITH([mpatrol-includedir],
41 [AC_HELP_STRING([--enable-mpatrol-includedir], [specify the include directory of mpatrol])],
42 [_efl_with_mpatrol_includedir=${withval}]
43)
44
45AC_ARG_WITH([mpatrol-libdir],
46 [AC_HELP_STRING([--enable-mpatrol-libdir], [specify the library directory of mpatrol])],
47 [_efl_with_mpatrol_libdir=${withval}]
48)
49
50if test "x${_efl_enable_mpatrol}" = "xyes" ; then
51
52dnl values of the different paths
53
54 if test ! "x${_efl_with_mpatrol_bindir}" = "x" ; then
55 _efl_mpatrol_bindir=${_efl_with_mpatrol_bindir}
56 else
57 _efl_mpatrol_bindir="${_efl_with_mpatrol_dir}/bin"
58 fi
59
60 if test ! "x${_efl_with_mpatrol_includedir}" = "x" ; then
61 _efl_mpatrol_includedir=${_efl_with_mpatrol_includedir}
62 else
63 _efl_mpatrol_includedir="${_efl_with_mpatrol_dir}/include"
64 fi
65
66 if test ! "x${_efl_with_mpatrol_libdir}" = "x" ; then
67 _efl_mpatrol_libdir=${_efl_with_mpatrol_libdir}
68 else
69 _efl_mpatrol_libdir="${_efl_with_mpatrol_dir}/lib"
70 fi
71
72dnl check of mpatrol program
73
74 AC_CHECK_PROG([_efl_have_mpatrol],
75 [mpatrol],
76 ["yes"],
77 ["no"],
78 [$PATH$PATH_SEPARATOR${_efl_mpatrol_bindir}]
79 )
80
81 SAVE_CPPFLAGS=${CPPFLAGS}
82 SAVE_LIBS=${LDFLAGS}
83 CPPFLAGS="-I${_efl_mpatrol_includedir}"
84 LIBS="-L${_efl_mpatrol_libdir} -lmpatrol -lbfd -liberty -limagehlp"
85
86dnl check of mpatrol.h header file
87
88 AC_CHECK_HEADER([mpatrol.h],
89 [],
90 [_efl_have_mpatrol="no"]
91 )
92
93dnl check of mpatrol library and its needed dependencies
94
95 AC_LINK_IFELSE(
96 [AC_LANG_PROGRAM([[
97#include <mpatrol.h>
98 ]],
99 [[
100__mp_clearleaktable();
101 ]])],
102 [],
103 [_efl_have_mpatrol="no"]
104 )
105
106 AC_MSG_CHECKING([whether libmpatrol is usuable])
107 AC_MSG_RESULT([${_efl_have_mpatrol}])
108
109 CPPFLAGS=${SAVE_CPPFLAGS}
110 LIBS=${SAVE_LIBS}
111
112fi
113
114if test "x${_efl_enable_mpatrol}" = "xyes" ; then
115 EFL_MPATROL_CPPFLAGS="-include ${_efl_mpatrol_includedir}/mpatrol.h"
116 EFL_MPATROL_LIBS="-L${_efl_mpatrol_libdir} -lmpatrol -lbfd -liberty -limagehlp"
117fi
118
119AC_SUBST(EFL_MPATROL_CPPFLAGS)
120AC_SUBST(EFL_MPATROL_LIBS)
121
122AM_CONDITIONAL(EFL_HAVE_MPATROL, test "x${_efl_have_mpatrol}" = "xyes")
123
124if test "x${_efl_have_mpatrol}" = "xyes" ; then
125 ifelse([$1], , :, [$1])
126else
127 ifelse([$2], , :, [$2])
128fi
129
130])
diff --git a/legacy/evil/m4/evil/evil_windows.m4 b/legacy/evil/m4/evil/evil_windows.m4
new file mode 100644
index 0000000000..be79b8296b
--- /dev/null
+++ b/legacy/evil/m4/evil/evil_windows.m4
@@ -0,0 +1,59 @@
1dnl Copyright (C) 2011 Vincent Torri <vincent dot torri at gmail dot com>
2dnl This code is public domain and can be freely used or copied.
3
4dnl Macro that select the Windows version (XP (default), Vista, 7)
5
6dnl Usage: EFL_SELECT_WINDOWS_VERSION()
7dnl Update CPPFLAGS accordingly
8
9AC_DEFUN([EFL_SELECT_WINDOWS_VERSION],
10[
11
12dnl configure option
13
14AC_ARG_WITH([windows-version],
15 [AC_HELP_STRING([--with-windows-version], [select the target Windows version (xp, vista, win7 or ce) @<:@default=xp@:>@])],
16 [
17 if test "x${with_windows_version}" = "xvista" ; then
18 _winver="vista"
19 else
20 if test "x${with_windows_version}" = "xwin7" ; then
21 _winver="win7"
22 else
23 if test "x${with_windows_version}" = "ce" ; then
24 _winver="ce"
25 else
26 _winver="xp"
27 fi
28 fi
29 fi
30 ],
31 [_winver="xp"])
32
33AC_MSG_CHECKING([which Windows version to target])
34AC_MSG_RESULT([${_winver}])
35
36case "${_winver}" in
37 ce)
38 EFL_WINDOWS_VERSION_CFLAGS="-D_WIN32_WCE=0x0420"
39 _efl_windows_version="Windows CE"
40 ;;
41 vista)
42 EFL_WINDOWS_VERSION_CFLAGS="-D_WIN32_WINNT=0x0600"
43 _efl_windows_version="Windows Vista"
44 ;;
45 win7)
46 EFL_WINDOWS_VERSION_CFLAGS="-D_WIN32_WINNT=0x0601"
47 _efl_windows_version="Windows 7"
48 ;;
49 *)
50 EFL_WINDOWS_VERSION_CFLAGS="-D_WIN32_WINNT=0x0501"
51 _efl_windows_version="Windows XP"
52 ;;
53esac
54
55CPPFLAGS="${CPPFLAGS} ${EFL_WINDOWS_VERSION_CFLAGS}"
56AC_SUBST([EFL_WINDOWS_VERSION_CFLAGS])
57AC_SUBST([_efl_windows_version])
58
59])