You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

acinclude.m4 1.4 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. dnl as-ac-expand.m4 0.2.0 -*- autoconf -*-
  2. dnl autostars m4 macro for expanding directories using configure's prefix
  3. dnl (C) 2003, 2004, 2005 Thomas Vander Stichele <thomas at apestaart dot org>
  4. dnl Copying and distribution of this file, with or without modification,
  5. dnl are permitted in any medium without royalty provided the copyright
  6. dnl notice and this notice are preserved.
  7. dnl AS_AC_EXPAND(VAR, CONFIGURE_VAR)
  8. dnl example:
  9. dnl AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
  10. dnl will set SYSCONFDIR to /usr/local/etc if prefix=/usr/local
  11. AC_DEFUN([AS_AC_EXPAND],
  12. [
  13. EXP_VAR=[$1]
  14. FROM_VAR=[$2]
  15. dnl first expand prefix and exec_prefix if necessary
  16. prefix_save=$prefix
  17. exec_prefix_save=$exec_prefix
  18. dnl if no prefix given, then use /usr/local, the default prefix
  19. if test "x$prefix" = "xNONE"; then
  20. prefix="$ac_default_prefix"
  21. fi
  22. dnl if no exec_prefix given, then use prefix
  23. if test "x$exec_prefix" = "xNONE"; then
  24. exec_prefix=$prefix
  25. fi
  26. full_var="$FROM_VAR"
  27. dnl loop until it doesn't change anymore
  28. while true; do
  29. new_full_var="`eval echo $full_var`"
  30. if test "x$new_full_var" = "x$full_var"; then break; fi
  31. full_var=$new_full_var
  32. done
  33. dnl clean up
  34. full_var=$new_full_var
  35. AC_SUBST([$1], "$full_var")
  36. dnl restore prefix and exec_prefix
  37. prefix=$prefix_save
  38. exec_prefix=$exec_prefix_save
  39. ])