~ubuntu-branches/ubuntu/edgy/network-manager-pptp/edgy

« back to all changes in this revision

Viewing changes to acinclude.m4

  • Committer: Bazaar Package Importer
  • Author(s): Craig Box
  • Date: 2006-10-01 16:04:54 UTC
  • Revision ID: james.westby@ubuntu.com-20061001160454-3lepz9bs63bqtvfa
Tags: upstream-0.6.3+cvs20060819
ImportĀ upstreamĀ versionĀ 0.6.3+cvs20060819

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
dnl as-ac-expand.m4 0.1.0
 
3
dnl autostars m4 macro for expanding directories using configure's prefix
 
4
dnl thomas@apestaart.org 
 
5
 
 
6
dnl AS_AC_EXPAND(VAR, CONFIGURE_VAR)
 
7
dnl
 
8
dnl example
 
9
dnl AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
 
10
dnl will set SYSCONFDIR to /usr/local/etc if prefix=/usr/local
 
11
 
 
12
AC_DEFUN(AS_AC_EXPAND,
 
13
[
 
14
  EXP_VAR=[$1]
 
15
  FROM_VAR=[$2]
 
16
 
 
17
  dnl first expand prefix and exec_prefix if necessary
 
18
  prefix_save=$prefix
 
19
  exec_prefix_save=$exec_prefix
 
20
 
 
21
  dnl if no prefix given, then use /usr/local, the default prefix
 
22
  if test "x$prefix" = "xNONE"; then
 
23
    prefix=$ac_default_prefix
 
24
  fi
 
25
  dnl if no exec_prefix given, then use prefix
 
26
  if test "x$exec_prefix" = "xNONE"; then
 
27
    exec_prefix=$prefix
 
28
  fi
 
29
 
 
30
  full_var="$FROM_VAR"
 
31
  dnl loop until it doesn't change anymore
 
32
  while true; do
 
33
    new_full_var="`eval echo $full_var`"
 
34
    if test "x$new_full_var"="x$full_var"; then break; fi
 
35
    full_var=$new_full_var
 
36
  done
 
37
 
 
38
  dnl clean up
 
39
  full_var=$new_full_var
 
40
  AC_SUBST([$1], "$full_var")
 
41
 
 
42
  dnl restore prefix and exec_prefix
 
43
  prefix=$prefix_save
 
44
  exec_prefix=$exec_prefix_save
 
45
])