1dnl ###################################################################### 2dnl Expand the value of a CPP macro into a printable string. 3dnl Takes: header, macro, [action-if-found, [action-if-not-found]] 4dnl It runs the header through CPP looking for a match between the macro 5dnl and a string pattern, and if sucessful, it prints the string value out. 6AC_DEFUN([AMU_EXPAND_CPP_STRING], 7[ 8# we are looking for a regexp of a string 9AC_EGREP_CPP(\".*\", 10[$1] 11$2, 12value="notfound" 13AC_TRY_RUN( 14[ 15[$1] 16main(argc) 17int argc; 18{ 19#ifdef $2 20if (argc > 1) 21 printf("%s", $2); 22exit(0); 23#else 24# error no such option $2 25#endif 26exit(1); 27}], value=`./conftest dummy 2>>config.log`, value="notfound", value="notfound") 28, 29value="notfound" 30) 31if test "$value" = notfound 32then 33 : 34 $4 35else 36 : 37 $3 38fi 39]) 40dnl ====================================================================== 41