~ubuntu-branches/ubuntu/trusty/gnome-documents/trusty

« back to all changes in this revision

Viewing changes to m4/ax_config_dir.m4

  • Committer: Package Import Robot
  • Author(s): Andreas Henriksson, Thomas Bechtold
  • Date: 2013-04-04 13:32:08 UTC
  • mfrom: (3.1.4 experimental)
  • Revision ID: package-import@ubuntu.com-20130404133208-n19gqczi05z31ogb
Tags: 3.8.0-1
[ Thomas Bechtold ]
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
dnl Copied from Audacity 1.3.10 which itself is licensed under the GPL v2 or
 
2
dnl any later version
 
3
 
 
4
dnl Function to configure a sub-library now, because we need to know the result
 
5
dnl of the configuration now in order to take decisions.
 
6
dnl We don't worry about whether the configuration worked or not - it is
 
7
dnl assumed that the next thing after this will be a package-specific check to
 
8
dnl see if the package is actually available. (Hint: use pkg-config and
 
9
dnl -uninstalled.pc files if available).
 
10
dnl code based on a simplification of _AC_OUTPUT_SUBDIRS in 
 
11
dnl /usr/share/autoconf/autoconf/status.m4 which implements part of 
 
12
dnl AC_CONFIG_SUBDIRS
 
13
 
 
14
AC_DEFUN([AX_CONFIG_DIR],
 
15
[AC_REQUIRE([AC_DISABLE_OPTION_CHECKING])]
 
16
[m4_append([_AC_LIST_SUBDIRS], [$1], [])]
 
17
[
 
18
  # Remove --cache-file and --srcdir arguments so they do not pile up.
 
19
  ax_sub_configure_args=
 
20
  ax_prev=
 
21
  eval "set x $ac_configure_args"
 
22
  shift
 
23
  for ax_arg
 
24
  do
 
25
    if test -n "$ax_prev"; then
 
26
      ax_prev=
 
27
      continue
 
28
    fi
 
29
    case $ax_arg in
 
30
    -cache-file | --cache-file | --cache-fil | --cache-fi \
 
31
    | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
 
32
      ax_prev=cache_file ;;
 
33
    -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
 
34
    | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \
 
35
    | --c=*)
 
36
      ;;
 
37
    --config-cache | -C)
 
38
      ;;
 
39
    -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
 
40
      ax_prev=srcdir ;;
 
41
    -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
 
42
      ;;
 
43
    -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
 
44
      ax_prev=prefix ;;
 
45
    -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
 
46
      ;;
 
47
    *)
 
48
      case $ax_arg in
 
49
      *\'*) ax_arg=`echo "$ax_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
 
50
      esac
 
51
      ax_sub_configure_args="$ax_sub_configure_args '$ax_arg'" ;;
 
52
    esac
 
53
  done
 
54
 
 
55
  # Always prepend --prefix to ensure using the same prefix
 
56
  # in subdir configurations.
 
57
  ax_arg="--prefix=$prefix"
 
58
  case $ax_arg in
 
59
  *\'*) ax_arg=`echo "$ax_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
 
60
  esac
 
61
  ax_sub_configure_args="'$ax_arg' $ax_sub_configure_args"
 
62
 
 
63
  # Pass --silent
 
64
  if test "$silent" = yes; then
 
65
    ax_sub_configure_args="--silent $ax_sub_configure_args"
 
66
  fi
 
67
 
 
68
  ax_popdir=`pwd`
 
69
  AC_MSG_NOTICE([Configuring sources in $1])
 
70
  dnl for out-of-place builds srcdir and builddir will be different, and
 
71
  dnl builddir may not exist, so we must create it
 
72
  AS_MKDIR_P(["$1"])
 
73
  dnl and also set the variables. As this isn't autoconf, the following may be
 
74
  dnl risky:
 
75
  _AC_SRCDIRS(["$1"])
 
76
  cd "$1"
 
77
 
 
78
  # Check for guested configure; otherwise get Cygnus style configure.
 
79
  if test -f "configure.gnu"; then
 
80
    ax_sub_configure=$ac_srcdir/configure.gnu
 
81
  elif test -f "$ac_srcdir/configure"; then
 
82
    ax_sub_configure=$ac_srcdir/configure
 
83
  elif test -f "$ac_srcdir/configure.in"; then
 
84
    # This should be Cygnus configure.
 
85
        ax_sub_configure=$ac_aux_dir/configure
 
86
  else
 
87
    AC_MSG_WARN([no configuration information is in $1])
 
88
    ax_sub_configure=
 
89
  fi
 
90
 
 
91
  # The recursion is here.
 
92
  if test -n "$ax_sub_configure"; then
 
93
    # Make the cache file name correct relative to the subdirectory.
 
94
    case $cache_file in
 
95
    [[\\/]]* | ?:[[\\/]]* ) ax_sub_cache_file=$cache_file ;;
 
96
    *) # Relative name.
 
97
        ax_sub_cache_file=$ac_top_build_prefix$cache_file ;;
 
98
    esac
 
99
 
 
100
    AC_MSG_NOTICE([running $SHELL $ax_sub_configure $ax_sub_configure_args --cache-file=$ax_sub_cache_file --srcdir=$ac_srcdir])
 
101
    # The eval makes quoting arguments work.
 
102
    eval "\$SHELL \"\$ax_sub_configure\" $ax_sub_configure_args \
 
103
           --cache-file=\"\$ax_sub_cache_file\" --srcdir=\"\$ax_srcdir\""
 
104
  fi
 
105
 
 
106
  cd "$ax_popdir"
 
107
  AC_MSG_NOTICE([Done configuring in $1])
 
108
])
 
109