diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 21:41:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 21:41:43 +0000 |
commit | 92cccad89d1c12b39165d5f0ed7ccd2d44965a1a (patch) | |
tree | f59a2764cd8c50959050a428bd8fc935138df750 /m4/ax_check_define.m4 | |
parent | Initial commit. (diff) | |
download | libtpms-92cccad89d1c12b39165d5f0ed7ccd2d44965a1a.tar.xz libtpms-92cccad89d1c12b39165d5f0ed7ccd2d44965a1a.zip |
Adding upstream version 0.9.2.upstream/0.9.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'm4/ax_check_define.m4')
-rw-r--r-- | m4/ax_check_define.m4 | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/m4/ax_check_define.m4 b/m4/ax_check_define.m4 new file mode 100644 index 0000000..490fccc --- /dev/null +++ b/m4/ax_check_define.m4 @@ -0,0 +1,31 @@ +# SYNOPSIS +# +# AX_CHECK_DEFINE(includefile, define, [ACTION-SUCCESS], [ACTION-FAILURE]) +# +# DESCRIPTION +# +# Check whether the given #define is available in the given #include file +# +# LICENSE +# +# See the root directory of the libtpms project for the LICENSE +# +AC_DEFUN([AX_CHECK_DEFINE], + [AC_PREREQ(2.63) + AC_MSG_CHECKING(whether $2 is defined in $1) + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#include $1]], + [[#ifndef $2 + #error $2 not defined + #endif]])], + [ + AC_MSG_RESULT([yes]) + [$3] + ], + [ + AC_MSG_RESULT([no]) + [$4] + ] + ) + ] +) |