author | renatofilho |
Fri May 18 21:15:39 2007 +0100 (2007-05-18) | |
branch | trunk |
changeset 692 | d9c6cce2b167 |
permissions | -rw-r--r-- |
rosfran@253 | 1 |
dnl AS_AC_EXPAND(VAR, CONFIGURE_VAR) |
rosfran@253 | 2 |
dnl |
rosfran@253 | 3 |
dnl example |
rosfran@253 | 4 |
dnl AS_AC_EXPAND(SYSCONFDIR, $sysconfdir) |
rosfran@253 | 5 |
dnl will set SYSCONFDIR to /usr/local/etc if prefix=/usr/local |
rosfran@253 | 6 |
|
rosfran@253 | 7 |
AC_DEFUN([AS_AC_EXPAND], |
rosfran@253 | 8 |
[ |
rosfran@253 | 9 |
EXP_VAR=[$1] |
rosfran@253 | 10 |
FROM_VAR=[$2] |
rosfran@253 | 11 |
|
rosfran@253 | 12 |
dnl first expand prefix and exec_prefix if necessary |
rosfran@253 | 13 |
prefix_save=$prefix |
rosfran@253 | 14 |
exec_prefix_save=$exec_prefix |
rosfran@253 | 15 |
|
rosfran@253 | 16 |
dnl if no prefix given, then use /usr/local, the default prefix |
rosfran@253 | 17 |
if test "x$prefix" = "xNONE"; then |
rosfran@253 | 18 |
prefix=$ac_default_prefix |
rosfran@253 | 19 |
fi |
rosfran@253 | 20 |
dnl if no exec_prefix given, then use prefix |
rosfran@253 | 21 |
if test "x$exec_prefix" = "xNONE"; then |
rosfran@253 | 22 |
exec_prefix=$prefix |
rosfran@253 | 23 |
fi |
rosfran@253 | 24 |
|
rosfran@253 | 25 |
full_var="$FROM_VAR" |
rosfran@253 | 26 |
dnl loop until it doesn't change anymore |
rosfran@253 | 27 |
while true; do |
rosfran@253 | 28 |
new_full_var="`eval echo $full_var`" |
rosfran@253 | 29 |
if test "x$new_full_var"="x$full_var"; then break; fi |
rosfran@253 | 30 |
full_var=$new_full_var |
rosfran@253 | 31 |
done |
rosfran@253 | 32 |
|
rosfran@253 | 33 |
dnl clean up |
rosfran@253 | 34 |
full_var=$new_full_var |
rosfran@253 | 35 |
AC_SUBST([$1], "$full_var") |
rosfran@253 | 36 |
|
rosfran@253 | 37 |
dnl restore prefix and exec_prefix |
rosfran@253 | 38 |
prefix=$prefix_save |
rosfran@253 | 39 |
exec_prefix=$exec_prefix_save |
rosfran@253 | 40 |
]) |