aclocal.m4: fix issue in cross-compiling

The aclocal.m4 called nm directly.
It can cause issue in cross-compiling and because is not possible
use a different NM implementation (like llvm-nm).
The compile error log:
https://bugs.gentoo.org/attachment.cgi?id=648556

Closes: https://bugs.gentoo.org/731906
Signed-off-by: Huang Rui <vowstar@gmail.com>
This commit is contained in:
Huang Rui 2020-07-25 12:50:49 +08:00
parent e94291c88f
commit f3396d502d
No known key found for this signature in database
GPG Key ID: AD4E34A8385E3E52
1 changed files with 3 additions and 1 deletions

4
aclocal.m4 vendored
View File

@ -25,9 +25,11 @@ AC_SUBST(install_suffix)
# Unwarranted assumptions:
# - the object file produced by AC_COMPILE_IFELSE is called "conftest.$ac_objext"
# - the nm(1) utility is available, and its name is "nm".
# Here use $NM because they can cause issue in cross-compiling and because is
# not possible use a different NM implementation (like llvm-nm)
AC_DEFUN([_AX_C_UNDERSCORES_MATCH_IF],
[AC_COMPILE_IFELSE([AC_LANG_SOURCE([void underscore(void){}])],
[AS_IF([nm conftest.$ac_objext|grep $1 >/dev/null 2>/dev/null],[$2],[$3])],
[AS_IF([$NM conftest.$ac_objext|grep $1 >/dev/null 2>/dev/null],[$2],[$3])],
[AC_MSG_ERROR([underscore test crashed])]
)])