# Check if libelf and libdw are present
AC_CHECK_LIB([elf], [elf_version], [], [AC_MSG_ERROR(Missing libelf (from elfutils >= 0.154) which is required by debug info. You can disable this feature using --disable-debug-info.)])
AC_CHECK_LIB([dw], [dwarf_begin], [], [AC_MSG_ERROR(Missing libdw (from elfutils >= 0.154) which is required by debug info. You can disable this feature using --disable-debug-info.)])
- AX_LIB_ELFUTILS([0], [154], [], [AC_MSG_ERROR(elfutils >= 0.154 is required to use the debug info feature. You can disable this feature using --disable-debug-info.)])
+ AX_LIB_ELFUTILS([0], [154], [:], [AC_MSG_ERROR(elfutils >= 0.154 is required to use the debug info feature. You can disable this feature using --disable-debug-info.)])
AC_DEFINE([ENABLE_DEBUG_INFO], [1], [Define to 1 if you enable the 'debug info' feature])
], [])
AC_DEFUN([AX_LIB_ELFUTILS], [
m4_pushdef([major_version], [$1])
m4_pushdef([minor_version], [$2])
-
- m4_if([$#], 3, [
- m4_pushdef([true_action], [$3])
- ], [
- m4_pushdef([true_action], [])
- ])
-
- m4_if([$#], 4, [
- m4_pushdef([false_action], [$4])
- ], [
- m4_pushdef([false_action], [
- AC_MSG_ERROR(elfutils >= major_version.minor_version is required)])
- ])
+ m4_pushdef([true_action], m4_default([$3], [:]))
+ m4_pushdef([false_action], m4_default(
+ [$4], [AC_MSG_ERROR(elfutils >= major_version.minor_version is required)]
+ ))
AC_CACHE_CHECK(
[for elfutils version >= major_version.minor_version],