From ca57057f598bfc7119f79f71bf38ec88244ab396 Mon Sep 17 00:00:00 2001 From: Cy Schubert Date: Wed, 31 Aug 2016 00:08:49 +0000 Subject: Import am-utils 6.2, Suggested by: pfg@ Obtained from: ftp://ftp.am-utils.org/pub/am-utils/ --- m4/macros/expand_run_string.m4 | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 m4/macros/expand_run_string.m4 (limited to 'm4/macros/expand_run_string.m4') diff --git a/m4/macros/expand_run_string.m4 b/m4/macros/expand_run_string.m4 new file mode 100644 index 000000000000..2cb964e11f91 --- /dev/null +++ b/m4/macros/expand_run_string.m4 @@ -0,0 +1,29 @@ +dnl ###################################################################### +dnl Run a program and print its output as a string +dnl Takes: (header, code-to-run, [action-if-found, [action-if-not-found]]) +AC_DEFUN([AMU_EXPAND_RUN_STRING], +[ +value="notfound" +AC_TRY_RUN( +[ +$1 +main(argc) +int argc; +{ +$2 +exit(0); +}], +[ +value=`./conftest dummy 2>>config.log` +test -z "$value" && value="notfound" +], value="notfound", value="notfound") +if test "$value" = notfound +then + : + $4 +else + : + $3 +fi +]) +dnl ====================================================================== -- cgit v1.2.3