This macro substitutes (with AC_SUBST) VARNAME with the expansion of
itself or the DIR variable if specified, taking care of fixing up
${prefix} and such.
Side effect: VARNAME is replaced with the expansion.
AC_SUBST_DIR bases on Alexandre Oliva's AC_DEFINE_DIR macro.
Examples:
AC_SUBST_DIR(DATADIR)