aboutsummaryrefslogtreecommitdiff
path: root/contrib/amd/m4/macros/expand_run_string.m4
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/amd/m4/macros/expand_run_string.m4')
-rw-r--r--contrib/amd/m4/macros/expand_run_string.m425
1 files changed, 25 insertions, 0 deletions
diff --git a/contrib/amd/m4/macros/expand_run_string.m4 b/contrib/amd/m4/macros/expand_run_string.m4
new file mode 100644
index 000000000000..02c531e07bfa
--- /dev/null
+++ b/contrib/amd/m4/macros/expand_run_string.m4
@@ -0,0 +1,25 @@
+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`, value="notfound", value="notfound")
+if test "$value" = notfound
+then
+ :
+ $4
+else
+ :
+ $3
+fi
+])
+dnl ======================================================================