Subj : m4 and AutoConf macros To : comp.programming From : Jason Curl Date : Wed Aug 24 2005 10:36 am Hello I'm trying to write a 'configure' script that will take two arguments. I'm using the GNU AutoConf tools and writing macros in m4 to help (and to add portability). Anyone have a clue how to get M4 to expand shell variables before passing the arguments? e.g. AC_DEFUN([LX_TEST_ID], [if test x$ac_cv_prog_id != xyes; then uname=`$1 $2 2> /dev/null` if test -z $uname; then ac_cv_prog_id=no else ac_cv_prog_id=yes ID='$1' IDFLAGS='$2' fi fi ]) # This doesn't work. As a result if ID='id' and IDFLAGS='-un' then # after ID='$ID' and IDFLAGS='$IDFLAGS' as m4 literally replaces $1 # with $ID and not id. LX_TEST_ID([$ID],[$IDFLAGS]) # But this does LX_TEST_ID([id],[-un]) I've looked at the AC_DEFINE_UNQUOTED source, but I have no idea how it works. Thanks, Jason. .