Skip to content

Commit

Permalink
m4/tools.m4: Fix KDUMP_TOOL_KDUMPID macro with older autoconf
Browse files Browse the repository at this point in the history
Autoconf 2.69 cannot handle complex conditional expansions well. To improve
compatibility, expand the KDUMP_DIS_ASM macro on its own and then check the
kdump_res variable.

Fixes: ptesarik#83
Signed-off-by: Petr Tesarik <[email protected]>
  • Loading branch information
ptesarik committed Dec 22, 2024
1 parent 26282fc commit e2f82e2
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions m4/tools.m4
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ AS_IF([$EGREP "@<:@^A-Za-z0-9_@:>@($2)" conftest.linkerr >&AS_MESSAGE_LOG_FD],
[AC_MSG_RESULT(no)])dnl
])# KDUMP_DIS_ASM_CHECK_UNDEF

AC_DEFUN([KDUMP_DIS_ASM_LIBS],[[dnl determine disassembler libraries
AC_DEFUN([KDUMP_DIS_ASM_LIBS],[dnl determine disassembler libraries
DIS_ASM_LIBS=-lopcodes
AC_LANG_CONFTEST([AC_LANG_PROGRAM(
[#include <dis-asm.h>],
[disassembler(bfd_arch_i386, FALSE, bfd_mach_x86_64, NULL);])])
dnl ignore undefined symbols from missing linker dependencies
AC_MSG_CHECKING([for disassembler in $DIS_ASM_LIBS])
KDUMP_TRY_LINK_UNDEF($DIS_ASM_LIBS, [[-Wl,--require-defined=disassembler]])
KDUMP_TRY_LINK_UNDEF($DIS_ASM_LIBS, [-Wl,--require-defined=disassembler])
AC_MSG_RESULT($kdump_res)
AS_IF([test yes = "$kdump_res"], [dnl
KDUMP_DIS_ASM_CHECK_UNDEF(-lbfd, bfd_)
Expand All @@ -61,8 +61,8 @@ AS_IF([test yes = "$kdump_res"], [dnl
[KDUMP_REPORT_LINKERR]
[AC_MSG_FAILURE([Tried everything, still cannot link disassembler.])])
AC_SUBST(DIS_ASM_LIBS)
], false)dnl
]])# KDUMP_DIS_ASM_LIBS
])dnl
])# KDUMP_DIS_ASM_LIBS

AC_DEFUN([KDUMP_DIS_ASM],[dnl determine disassembler options
AC_CHECK_HEADERS(dis-asm.h, [],
Expand Down Expand Up @@ -90,8 +90,9 @@ AC_ARG_ENABLE(kdumpid,
[do not build kdumpid])],
[],
[enable_kdumpid=yes])
AS_IF([test no != "$enable_kdumpid"],
[AS_IF(KDUMP_DIS_ASM, [],
AS_IF([test no != "$enable_kdumpid"], [dnl
KDUMP_DIS_ASM
AS_IF([test yes != "$kdump_res"],
[AC_MSG_FAILURE(
[disassembler test failed (--disable-kdumpid to disable)])]
)])
Expand Down

0 comments on commit e2f82e2

Please sign in to comment.