1dnl adl_RECURSIVE_EVAL(VALUE, RESULT)
2dnl =================================
3dnl Interpolate the VALUE in loop until it doesn't change,
4dnl and set the result to $RESULT.
5dnl WARNING: It's easy to get an infinite loop with some unsane input.
6AC_DEFUN([adl_RECURSIVE_EVAL],
7[_lcl_receval="$1"
8$2=`(test "x$prefix" = xNONE && prefix="$ac_default_prefix"
9     test "x$exec_prefix" = xNONE && exec_prefix="${prefix}"
10     _lcl_receval_old=''
11     while test "[$]_lcl_receval_old" != "[$]_lcl_receval"; do
12       _lcl_receval_old="[$]_lcl_receval"
13       eval _lcl_receval="\"[$]_lcl_receval\""
14     done
15     echo "[$]_lcl_receval")`])
16