diff options
author | Jean Guyomarc'h <jean.guyomarch@openwide.fr> | 2016-08-23 11:31:52 +0200 |
---|---|---|
committer | Jean Guyomarc'h <jean.guyomarch@gmail.com> | 2016-08-23 20:28:44 +0200 |
commit | 6de774455bb43e153815dfc27645dd292995b309 (patch) | |
tree | 86263bb2b5a852fd61e8ebd7917b2301eb3a9d80 /m4/efl_define.m4 | |
parent | a0e8a9aeaa63ff02fd32d6bd4771c97600103d50 (diff) |
autotools: add macro to easily check for defines in headers
Diffstat (limited to '')
-rw-r--r-- | m4/efl_define.m4 | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/m4/efl_define.m4 b/m4/efl_define.m4 new file mode 100644 index 0000000000..2b73a691e8 --- /dev/null +++ b/m4/efl_define.m4 | |||
@@ -0,0 +1,20 @@ | |||
1 | dnl | ||
2 | dnl EFL_CHECK_DEFINE(symbol, header_file) | ||
3 | dnl | ||
4 | dnl NOTE: EFL_CHECK_DEFINE is strongly inspired by | ||
5 | dnl APR_CHECK_DEFINE which can be found in the | ||
6 | dnl sources of Apache's APR (under Apache Licence) | ||
7 | dnl | ||
8 | AC_DEFUN([EFL_CHECK_DEFINE], [ | ||
9 | AC_CACHE_CHECK([for $1 in $2],ac_cv_define_$1,[ | ||
10 | AC_EGREP_CPP(YES_IS_DEFINED, [ | ||
11 | #include <$2> | ||
12 | #ifdef $1 | ||
13 | YES_IS_DEFINED | ||
14 | #endif | ||
15 | ], ac_cv_define_$1=yes, ac_cv_define_$1=no) | ||
16 | ]) | ||
17 | if test "$ac_cv_define_$1" = "yes"; then | ||
18 | AC_DEFINE(HAVE_$1, 1, [Define if $1 is defined in $2]) | ||
19 | fi | ||
20 | ]) | ||