1 dnl as-ac-expand.m4 0.2.0
2 dnl autostars m4 macro for expanding directories using configure's prefix
3 dnl thomas@apestaart.org
5 dnl AS_AC_EXPAND(VAR, CONFIGURE_VAR)
7 dnl AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
8 dnl will set SYSCONFDIR to /usr/local/etc if prefix=/usr/local
10 AC_DEFUN([AS_AC_EXPAND],
15 dnl first expand prefix and exec_prefix if necessary
17 exec_prefix_save=$exec_prefix
19 dnl if no prefix given, then use /usr/local, the default prefix
20 if test "x$prefix" = "xNONE"; then
21 prefix="$ac_default_prefix"
23 dnl if no exec_prefix given, then use prefix
24 if test "x$exec_prefix" = "xNONE"; then
29 dnl loop until it doesn't change anymore
31 new_full_var="`eval echo $full_var`"
32 if test "x$new_full_var" = "x$full_var"; then break; fi
33 full_var=$new_full_var
37 full_var=$new_full_var
38 AC_SUBST([$1], "$full_var")
40 dnl restore prefix and exec_prefix
42 exec_prefix=$exec_prefix_save