1 dnl AS_AC_EXPAND(VAR, CONFIGURE_VAR)
2 dnl example
3 dnl AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
4 dnl will set SYSCONFDIR to /usr/local/etc
5
6 dnl written by thomas vander stichele
7
8 AC_DEFUN(AS_AC_EXPAND,
9 [
10 EXP_VAR=[$1]
11 FROM_VAR=[$2]
12
13 dnl first expand prefix and exec_prefix if necessary
14 prefix_save=$prefix
15 if test "x$prefix" = "xNONE"; then
16 prefix=/usr/local
17 fi
18 exec_prefix_save=$exec_prefix
19 if test "x$exec_prefix" = "xNONE"; then
20 if test "x$prefix_save" = "xNONE"; then
21 exec_prefix=/usr/local
22 else
23 exec_prefix=$prefix
24 fi
25 fi
26
27 full_var="$FROM_VAR"
28 dnl loop until it doesn't change anymore
29 while true; do
30 new_full_var="`eval echo $full_var`"
31 if test "x$new_full_var"="x$full_var"; then break; fi
32 full_var=$new_full_var
33 done
34
35 dnl clean up
36 full_var=$new_full_var
37 [$1]=$full_var
38 prefix=$prefix_save
39 exec_prefix=$exec_prefix_save
40 ])
41
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.