summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--legacy/eet/m4/ac_attribute.m452
1 files changed, 42 insertions, 10 deletions
diff --git a/legacy/eet/m4/ac_attribute.m4 b/legacy/eet/m4/ac_attribute.m4
index 46c1a42291..34bb4dbf2f 100644
--- a/legacy/eet/m4/ac_attribute.m4
+++ b/legacy/eet/m4/ac_attribute.m4
@@ -1,14 +1,46 @@
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 __atribute__
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.
1 14
2AC_DEFUN([AC_C___ATTRIBUTE__], 15AC_DEFUN([AC_C___ATTRIBUTE__],
3[ 16[
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 17
18AC_MSG_CHECKING([for __attribute__])
19
20AC_CACHE_VAL([ac_cv___attribute__],
21 [AC_TRY_COMPILE(
22 [
23#include <stdlib.h>
24 ],
25 [
26int func(int x);
27int foo(int x __attribute__ ((unused)))
28{
29 exit(1);
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])