diff options
author | H. Peter Anvin <hpa@linux.intel.com> | 2017-11-29 16:02:52 -0800 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2017-11-29 16:02:52 -0800 |
commit | 2dbfdee7808f14805e639e960e2ebe0da17e42f9 (patch) | |
tree | e216b697b24d9cf4ead69ed28afdb2d483e49140 | |
parent | 4b70b62ba29a8ba30550b0104d43d3f57956c4cb (diff) | |
download | nasm-2dbfdee7808f14805e639e960e2ebe0da17e42f9.tar.gz |
aclocal.m4: correct and update PA_HAVE_FUNC()
PA_HAVE_FUNC() would fail on some systems for inline functions or
macros due to missing #includes. Also modernize to current autoconf
style.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
-rw-r--r-- | aclocal.m4 | 17 |
1 files changed, 12 insertions, 5 deletions
@@ -58,11 +58,18 @@ dnl a builtin/intrinsic function. dnl -------------------------------------------------------------------------- AC_DEFUN(PA_HAVE_FUNC, [AC_MSG_CHECKING([for $1]) -AC_TRY_LINK([], [(void)$1$2;], -AC_MSG_RESULT([yes]) -AC_DEFINE(AS_TR_CPP([HAVE_$1]), 1, - [Define to 1 if you have the `$1' intrinsic function.]), -AC_MSG_RESULT([no]))]) + AC_LINK_IFELSE([AC_LANG_SOURCE([ +AC_INCLUDES_DEFAULT +int main(void) { + (void)$1$2; + return 0; +} + ])], + [AC_MSG_RESULT([yes]) + AC_DEFINE(AS_TR_CPP([HAVE_$1]), 1, + [Define to 1 if you have the `$1' intrinsic function.])], + [AC_MSG_RESULT([no])]) +]) dnl -------------------------------------------------------------------------- dnl PA_LIBEXT |