+# psi_add_decl(decl, options)
+# Add a pre-defined decl to $PSI_VA_DECLS/$PSI_DECLS.
+psi_add_decl() {
+ case "$2" in
+ *vararg*)
+ cat >>$PSI_VA_DECLS <<<" $1, {0}, "
+ ;;
+ *)
+ cat >>$PSI_DECLS <<<" $1, {0}, "
+ ;;
+ esac
+}
+
+dnl PSI_REDIR(name, custom symbol)
+dnl Create a function redirection to an optional custom symbol.
+AC_DEFUN(PSI_REDIR, [
+ psi_add_redir $1 ifelse([$2],[],[$1],[$2])
+])
+
+dnl PSI_FUNC_LIBC_MAIN()
+dnl Check for the platforms default stub in executables.