-dnl PSI_FUNC(fn, action-if-yes, action-if-no)
-dnl Check for a possible function redirection.
-AC_DEFUN(PSI_FUNC, [
- AC_REQUIRE([PSI_FUNC_LIBC_MAIN])
- psi_symbol=$1
- AC_CACHE_CHECK(for $1, psi_cv_fn_$1, [
- psi_symbol_redirect=
- AC_TRY_LINK(PSI_INCLUDES, [
- void (*fn)(void) = (void (*)(void)) $psi_symbol;
- ], [
- psi_symbol_redirect=`$NM -g conftest$ac_exeext | $AWK -F" *|@" '/^@<:@@<:@:space:@:>@@:>@+U '$psi_cv_libc_main'/ {next} /^@<:@@<:@:space:@:>@@:>@+U / {print$[]3; exit}'`
- ])
- psi_cv_fn_$1=$psi_symbol_redirect
- ])
- case "$psi_cv_fn_$1" in
- "")
- $3
- ;;
- "$psi_symbol"|"_$psi_symbol")
- $2
- ;;
- *)
- $2
- PSI_REDIR($1)
- ;;
- esac
+dnl PSI_DECL_ARGS(decl args)
+dnl INTERNAL: build psi_decl_args
+AC_DEFUN(PSI_DECL_ARGS, [
+ psi_decl_args=
+ PSI_DECL_ARG($1)
+ m4_case([$2],
+ [(void)], [],
+ [()], [],
+ [m4_map_args_sep([PSI_DECL_ARG(m4_normalize(], [))], [], m4_bregexp([$2], [(\(.*\))], [\1]))])