summaryrefslogtreecommitdiff
path: root/legacy/evil/m4
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2008-10-21 11:01:36 +0000
committerVincent Torri <vincent.torri@gmail.com>2008-10-21 11:01:36 +0000
commit0eb2aaab4dafb49b761574d88b637ef2857d2927 (patch)
tree9feaf88187de0926ab59e5f8fac1d00c965bdd32 /legacy/evil/m4
parent67acca9238ce9a4f769c7c11689d974066b4abe7 (diff)
* m4/ac_attribute.m4:
use newer file from PROTO/autotools * src/lib/dlfcn/dlfcn.c: * src/lib/evil_mman.c: no need to define __UNUSED__ anymore with the new m4 macro * src/lib/Makefile.am: * src/lib/evil.c: remove useless file SVN revision: 36921
Diffstat (limited to 'legacy/evil/m4')
-rwxr-xr-xlegacy/evil/m4/ac_attribute.m450
1 files changed, 40 insertions, 10 deletions
diff --git a/legacy/evil/m4/ac_attribute.m4 b/legacy/evil/m4/ac_attribute.m4
index 46c1a42291..e0df55d985 100755
--- a/legacy/evil/m4/ac_attribute.m4
+++ b/legacy/evil/m4/ac_attribute.m4
@@ -1,14 +1,44 @@
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 the compiler supports __atribute__
5
6dnl Usage: AC_C___ATTRIBUTE__
7dnl call AC_DEFINE for HAVE___ATTRIBUTE__ and __UNUSED__
8dnl if the compiler supports __attribute__, HAVE___ATTRIBUTE__ is
9dnl defined to 1 and __UNUSED__ is defined to __attribute__((unused))
10dnl otherwise, HAVE___ATTRIBUTE__ is not defined and __UNUSED__ is
11dnl defined to nothing.
1 12
2AC_DEFUN([AC_C___ATTRIBUTE__], 13AC_DEFUN([AC_C___ATTRIBUTE__],
3[ 14[
4 AC_MSG_CHECKING(for __attribute__)
5 AC_CACHE_VAL(ac_cv___attribute__, [
6 AC_TRY_COMPILE([#include <stdlib.h>],
7 [int func(int x); int foo(int x __attribute__ ((unused))) { exit(1); }],
8 ac_cv___attribute__=yes, ac_cv___attribute__=no)])
9 if test "$ac_cv___attribute__" = "yes"; then
10 AC_DEFINE(HAVE___ATTRIBUTE__, 1, [Define to 1 if your compiler has __attribute__])
11 fi
12 AC_MSG_RESULT($ac_cv___attribute__)
13])
14 15
16AC_MSG_CHECKING([for __attribute__])
17
18AC_CACHE_VAL([ac_cv___attribute__],
19 [AC_TRY_COMPILE(
20 [
21#include <stdlib.h>
22 ],
23 [
24int func(int x);
25int foo(int x __attribute__ ((unused)))
26{
27 exit(1);
28}
29 ],
30 [ac_cv___attribute__="yes"],
31 [ac_cv___attribute__="no"]
32 )]
33)
34
35AC_MSG_RESULT($ac_cv___attribute__)
36
37if test "x${ac_cv___attribute__}" = "xyes" ; then
38 AC_DEFINE([HAVE___ATTRIBUTE__], [1], [Define to 1 if your compiler has __attribute__])
39 AC_DEFINE([__UNUSED__], [__attribute__((unused))], [Define to __attribute__((unused)) if your compiler has __attribute__])
40 else
41 AC_DEFINE([__UNUSED__], [], [Define to nothing if your compiler does not support __attribute__])
42fi
43
44])