leo_sobral@1: dnl AS_AC_EXPAND(VAR, CONFIGURE_VAR) leo_sobral@1: dnl leo_sobral@1: dnl example leo_sobral@1: dnl AS_AC_EXPAND(SYSCONFDIR, $sysconfdir) leo_sobral@1: dnl will set SYSCONFDIR to /usr/local/etc if prefix=/usr/local leo_sobral@1: leo_sobral@1: AC_DEFUN([AS_AC_EXPAND], leo_sobral@1: [ leo_sobral@1: EXP_VAR=[$1] leo_sobral@1: FROM_VAR=[$2] leo_sobral@1: leo_sobral@1: dnl first expand prefix and exec_prefix if necessary leo_sobral@1: prefix_save=$prefix leo_sobral@1: exec_prefix_save=$exec_prefix leo_sobral@1: leo_sobral@1: dnl if no prefix given, then use /usr/local, the default prefix leo_sobral@1: if test "x$prefix" = "xNONE"; then leo_sobral@1: prefix=$ac_default_prefix leo_sobral@1: fi leo_sobral@1: dnl if no exec_prefix given, then use prefix leo_sobral@1: if test "x$exec_prefix" = "xNONE"; then leo_sobral@1: exec_prefix=$prefix leo_sobral@1: fi leo_sobral@1: leo_sobral@1: full_var="$FROM_VAR" leo_sobral@1: dnl loop until it doesn't change anymore leo_sobral@1: while true; do leo_sobral@1: new_full_var="`eval echo $full_var`" leo_sobral@1: if test "x$new_full_var"="x$full_var"; then break; fi leo_sobral@1: full_var=$new_full_var leo_sobral@1: done leo_sobral@1: leo_sobral@1: dnl clean up leo_sobral@1: full_var=$new_full_var leo_sobral@1: AC_SUBST([$1], "$full_var") leo_sobral@1: leo_sobral@1: dnl restore prefix and exec_prefix leo_sobral@1: prefix=$prefix_save leo_sobral@1: exec_prefix=$exec_prefix_save leo_sobral@1: ])