automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Creating plain Makefiles with automake


From: Gavin Smith
Subject: Re: Creating plain Makefiles with automake
Date: Mon, 29 Apr 2013 19:27:41 +0100

On Wed, Apr 24, 2013 at 12:10 AM, Gavin Smith <address@hidden> wrote:
> I've been working recently on making automake create plain Makefiles
> when it is run, rather than Makefile.in's, and thought I would share
> my progress and thoughts on this.
>
>...
>
> I haven't included the patches I've made so far as the changes are
> incomplete and there are a few problems which I need to sort out which
> would be distracting, but I can certainly share more information if
> desired. When I get it in a more polished state, I'll post the patches
> for playing around with.

The modifications have support now for functionality such as VPATH and
non-VPATH builds, verbosity settings, toggling dependency tracking,
make distclean and make distcheck. It is obviously incomplete but I
think it's clear now how the system would work.

Top-level Makefile.am from a test project:
AUTOMAKE_OPTIONS=foreign
noinst_PROGRAMS = hello
hello_SOURCES = hello.c beetroot.h rhubarb.h second.c
EXTRA_DIST = config.mk.in
DISTCLEANFILES = config.mk
SUBDIRS = subdir

The lines distributing and cleaning config.mk and config.mk.in will
stop being necessary in future.

(subdir/Makefile.am is an empty file).

configure.ac:
AC_INIT([hello], [0])
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE
AC_PROG_CC
AC_CONFIG_LINKS([Makefile:Makefile subdir/Makefile:subdir/Makefile])
AX_CONFIG_INCLUDE([config.mk])
AC_OUTPUT

Notice that AC_CONFIG_LINKS is being used instead of AC_CONFIG_FILES
for the makefiles. In future, there will be a nicer syntax for this.

The makefiles are generated by running "amplain --plain".

There is one top-level config.mk which is included by all the
generated makefiles. Directory-specific variables such as top_builddir
are set in the individual makefiles. The way this is done, variables
like srcdir get values like ".././subdir" where previously they would
be "." - this could be a problem, although it doesn't break documented
behaviour as far as I can see. I used to have an extra file "dir.mk"
where these variables were set, and this could be done again if it's a
problem (at the expense of having more files in directories).

List of some changes to be done:
* libtool support
* Distribute and clean config.mk automatically
* Guards to check if config.mk was not generated on every target for
users - this would improve portability to non-GNU make's.
* Use option module in autoconf instead of global variable '$plain'.
* Checks for use of automake conditionals (not supported in plain mode)

There are quite a few commits in my git branch for this feature, so I
will include them in aggregate below. I've put my branch up at
https://github.com/GavinSmith0123/automake-amplain/tree/amplain, which
is what you should download if you want to test this.

I've based my modifications on a git branch renaming the installed
automake executable to amplain, so I can use my modified version as
well as the unmodified version. Below are the changes I've made since
the rename, which will give some idea of how the system works but
cannot actually be applied as a patch. The rename branch itself was
based on v1.13.

diff --git a/Makefile.am b/Makefile.am
index 4a1837c..0fb0c96 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -222,13 +222,16 @@ dist_am_DATA = \
   lib/am/clean.am \
   lib/am/compile.am \
   lib/am/configure.am \
+  lib/am/configure.amp \
   lib/am/data.am \
   lib/am/dejagnu.am \
   lib/am/depend.am \
   lib/am/depend2.am \
+  lib/am/depend2.amp \
   lib/am/distdir.am \
   lib/am/footer.am \
   lib/am/header-vars.am \
+  lib/am/header-vars.amp \
   lib/am/header.am \
   lib/am/install.am \
   lib/am/inst-vars.am \
@@ -262,6 +265,7 @@ dist_am_DATA = \
 ## ------------------------------ ##

 dist_automake_ac_DATA = \
+  m4/ax_config_include.m4 \
   m4/amversion.m4 \
   m4/ar-lib.m4 \
   m4/as.m4 \
diff --git a/amplain.in b/amplain.in
index 3194c99..e465af5 100644
--- a/amplain.in
+++ b/amplain.in
@@ -307,6 +307,9 @@ my $copy_missing = 0;
 # TRUE if we should always update files that we know about.
 my $force_missing = 0;

+# Generate plain Makefiles
+my $plain = 0;
+

 ## ---------------------------------------- ##
 ## Variables filled during files scanning.  ##
@@ -485,6 +488,13 @@ my $am_file = 'BUG';
 # Relative dir of the output makefile.
 my $relative_dir;

+# Path from build/source directory to top build/source directory
+my $top_builddir;
+
+# Path from build/source directory to top build/source directory with
+# trailing slash
+my $top_build_prefix;
+
 # Greatest timestamp of the output's dependencies (excluding
 # configure's dependencies).
 my $output_deps_greatest_timestamp;
@@ -1142,13 +1152,20 @@ sub define_verbose_var ($$;$)
     my $pvar = verbose_private_var ($name);
     my $silent_var = $pvar . '_0';
     my $verbose_var = $pvar . '_1';
+
+    if (! $plain) {
     # For typical 'make's, 'configure' replaces AM_V (inside @@) with $(V)
     # and AM_DEFAULT_V (inside @@) with $(AM_DEFAULT_VERBOSITY).
     # For strict POSIX 2008 'make's, it replaces them with 0 or 1 instead.
     # See AM_SILENT_RULES in m4/silent.m4.
-    define_variable ($var, '$(' . $pvar . '_@'.'AM_V'.'@)', INTERNAL);
-    define_variable ($pvar . '_', '$(' . $pvar . '_@'.'AM_DEFAULT_V'.'@)',
-                     INTERNAL);
+        define_variable ($var, '$(' . $pvar . '_@'.'AM_V'.'@)', INTERNAL);
+        define_variable ($pvar . '_',
+            '$(' . $pvar . '_@'.'AM_DEFAULT_V'.'@)', INTERNAL);
+    } else {
+        define_variable ($var, '$(' . $pvar . '_$(V))', INTERNAL);
+        define_variable ($pvar . '_',
+            '$(' . $pvar . '_$(AM_DEFAULT_VERBOSITY))', INTERNAL);
+    }
     Automake::Variable::define ($silent_var, VAR_AUTOMAKE, '', TRUE,
                                 $silent_val, '', INTERNAL, VAR_ASIS)
       if (! vardef ($silent_var, TRUE));
@@ -1171,7 +1188,7 @@ sub verbose_flag ($)
 sub verbose_nodep_flag ($)
 {
     my ($name) = @_;
-    return '$(' . verbose_var ($name) . subst ('am__nodep') . ')';
+    return '$(' . verbose_var ($name) . '$(am__nodep)' . ')';
 }

 # silent_flag
@@ -1336,7 +1353,17 @@ sub handle_languages
   . subst ('am__quote')
   . $iter
   . subst ('am__quote')
-  . "\n");
+  . "\n")
+   unless $plain;
+
+ # If automated dependency tracking is disabled, the
+ # dependency files will be empty, and it does no harm
+ # to include them.
+ # This form of the include directive is incompatible with
+ # some versions of make other than GNU make.
+ $output_rules .= "include $iter\n" .
+                                 $iter . ": config.mk ; address@hidden
address@hidden" if $plain;
+
     }

     # Compute the set of directories to remove in distclean-depend.
@@ -1371,6 +1398,20 @@ sub handle_languages
  my ($AMDEP, $FASTDEP) =
   (option 'no-dependencies' || $lang->autodep eq 'no')
   ? ('FALSE', 'FALSE') : ('AMDEP', "am__fastdep$fpfx");
+
+ # In plain mode, only TRUE or FALSE conditionals are acceptible.
+ # Instead, lines will be disabled using @am__AMDEP_enabled@
+ # and @am__fastdep$fpfx_enabled@
+ ($FASTDEP, $AMDEP) = ('TRUE', 'TRUE') if ($plain && $AMDEP eq 'AMDEP');
+
+        # The following are used in plain mode when dependency tracking
+        # is not disabled at automake time
+        my ($fastdep_enabled, $fastdep_disabled) = ('', '');
+        if ($plain && $AMDEP eq 'TRUE')
+         {
+    $fastdep_enabled = '$(am__fastdep' . $fpfx . '_enabled)';
+    $fastdep_disabled = '$(am__fastdep' . $fpfx . '_disabled)';
+         }

  my $verbose = verbose_flag ($lang->ccer || 'GEN');
  my $verbose_nodep = ($AMDEP eq 'FALSE')
@@ -1382,6 +1423,8 @@ sub handle_languages
  'FPFX'    => $fpfx,
  'AMDEP'   => $AMDEP,
  'FASTDEP' => $FASTDEP,
+ 'FASTDEP_ENABLED' => $fastdep_enabled,
+ 'FASTDEP_DISABLED' => $fastdep_disabled,
  '-c'      => $lang->compile_flag || '',
  # These are not used, but they need to be defined
  # so &transform do not complain.
@@ -1442,6 +1485,7 @@ sub handle_languages
      BASE      => '$*',
      SOURCE    => '$<',
      SOURCEFLAG => $sourceflags{$ext} || '',
+     'source-search' => '',
      OBJ       => '$@',
      OBJOBJ    => '$@',
      LTOBJ     => '$@',
@@ -1449,6 +1493,8 @@ sub handle_languages
      COMPILE   => '$(' . $lang->compiler . ')',
      LTCOMPILE => '$(LT' . $lang->compiler . ')',
      -o        => $output_flag,
+     -o2       => ($output_flag ?
+     $output_flag . ' $obj$myext' : ''),
      SUBDIROBJ => !! option 'subdir-objects');
  }

@@ -1513,6 +1559,7 @@ sub handle_languages
      BASE      => $obj,
      SOURCE    => $source,
      SOURCEFLAG => $sourceflags{$srcext} || '',
+     'source-search' => '`test -f \'' . $source . '\' || echo \'$(srcdir)/\'`',
      # Use $myext and not '.o' here, in case
      # we are actually building a new source
      # file -- e.g. via yacc.
@@ -1526,6 +1573,9 @@ sub handle_languages
      COMPILE   => $obj_compile,
      LTCOMPILE => $obj_ltcompile,
      -o        => $output_flag,
+     # I.e., %-o% %OBJ%
+     -o2       => ($output_flag ?
+     $output_flag . " $obj$myext" : ''),
      %file_transform);
  }

@@ -1554,8 +1604,14 @@ sub handle_languages
  define_linker_variable ($lang)
   if ($lang->link);

- require_variables ("$am_file.am", $lang->Name . " source seen",
-   TRUE, @{$lang->config_vars});
+ # If generating plain Makefiles, config_vars (e.g. CC) are
+ # not being set in the generated Makefile.in, so this doesn't
+ # check whether they are being set or not.
+ # Maybe we could scan config.mk for them.
+ if (! $plain) {
+  require_variables ("$am_file.am", $lang->Name . " source seen",
+         TRUE, @{$lang->config_vars});
+ }

  # Call the finisher.
  $lang->finish;
@@ -2400,7 +2456,9 @@ sub handle_compile ()
     my $default_includes = '';
     if (! option 'nostdinc')
       {
- my @incs = ('-I.', subst ('am__isrc'));
+        my @incs;
+        @incs = ('-I.', subst ('am__isrc')) unless $plain;
+        @incs = ('-I. -I$(srcdir)') if $plain;

  my $var = var 'CONFIG_HEADER';
  if ($var)
@@ -2410,12 +2468,15 @@ sub handle_compile ()
  push @incs, '-I' . dirname ($hdr);
       }
   }
+        $default_includes = uniq (@incs);
+
  # We want '-I. -I$(srcdir)', but the latter -I is redundant
  # and unaesthetic in non-VPATH builds.  We use address@hidden@`
  # instead.  It will be replaced by '-I.' or '-I. -I$(srcdir)'.
  # Items in CONFIG_HEADER are never in $(srcdir) so it is safe
  # to just put @am__isrc@ right after '-I.', without a space.
- ($default_includes = ' ' . uniq (@incs)) =~ s/ @/@/;
+        # Not done in plain mode as we cannot use autoconf output variables
+ ($default_includes = ' ' . $default_includes) =~ s/ @/@/ unless $plain;
       }

     my (@mostly_rms, @dist_rms);
@@ -4015,6 +4076,7 @@ sub handle_configure ($$$@)

   my $colon_infile = ':' . join (':', @inputs);
   $colon_infile = '' if $colon_infile eq ":$makefile.in";
+  # Note: results of the following are not used in plain mode
   my @rewritten = rewrite_inputs_into_dependencies ($makefile, @inputs);
   my ($regen_aclocal_m4, @aclocal_m4_deps) = scan_aclocal_m4;
   define_pretty_variable ('am__aclocal_m4_deps', TRUE, INTERNAL,
@@ -4026,7 +4088,8 @@ sub handle_configure ($$$@)
   @configuredeps);

   my $automake_options = '--' . $strictness_name .
- (global_option 'no-dependencies' ? ' --ignore-deps' : '');
+ (global_option 'no-dependencies' ? ' --ignore-deps' : '') .
+ ($plain ? ' --plain' : '');

   $output_rules .= file_contents
     ('configure',
@@ -4603,7 +4666,8 @@ sub handle_clean ($)
      CLEAN_RMS            => join ('', sort @{$rms{&CLEAN}}),
      DISTCLEAN_RMS        => join ('', sort @{$rms{&DIST_CLEAN}}),
      MAINTAINER_CLEAN_RMS => join ('', sort @{$rms{&MAINTAINER_CLEAN}}),
-     MAKEFILE             => basename $makefile,
+     MAKEFILE             => basename ($makefile),
+     PLAIN                => $plain,
      );
 }

@@ -5084,7 +5148,18 @@ sub scan_autoconf_config_files ($$)
            "omit leading './' from config file names such as '$local';"
            . "\nremake rules might be subtly broken otherwise")
         if ($local =~ /^\.\//);
-      my $input = locate_am @rest;
+
+      my $input;
+      if (! $plain)
+        {
+          $input = locate_am @rest;
+        }
+      else
+        {
+          # In plain mode, output "Makefile" instead of "Makefile.in"
+          (-f "$local.am") && ($input = $local);
+        }
+
       if ($input)
  {
   # We have a file that automake should generate.
@@ -5103,7 +5178,6 @@ sub scan_autoconf_config_files ($$)
     }
 }

-
 # &scan_autoconf_traces ($FILENAME)
 # ---------------------------------
 sub scan_autoconf_traces ($)
@@ -5123,6 +5197,7 @@ sub scan_autoconf_traces ($)
  AC_CONFIG_HEADERS => 1,
  AC_CONFIG_LIBOBJ_DIR => 1,
  AC_CONFIG_LINKS => 1,
+                AX_CONFIG_INCLUDE => 1,
  AC_FC_SRCEXT => 1,
  AC_INIT => 0,
  AC_LIBSOURCE => 1,
@@ -5238,6 +5313,8 @@ sub scan_autoconf_traces ($)
       $ac_config_files_location{$dest} = $where;
       push @config_links, $spec;
     }
+    scan_autoconf_config_files ($where, $args[1])
+              if $plain;
  }
       elsif ($macro eq 'AC_FC_SRCEXT')
  {
@@ -6603,15 +6680,28 @@ sub read_am_file ($$)
 sub define_standard_variables
 {
   my $saved_output_vars = $output_vars;
-  my ($comments, undef, $rules) =
-    file_contents_internal (1, "$libdir/am/header-vars.am",
-    new Automake::Location);

-  foreach my $var (sort keys %configure_vars)
+  my ($comments, undef, $rules);
+
+  if (! $plain)
     {
-      &define_configure_variable ($var);
+      ($comments, undef, $rules) =
+        file_contents_internal (1, "$libdir/am/header-vars.am",
+                new Automake::Location);
+      foreach my $var (sort keys %configure_vars)
+      {
+        &define_configure_variable ($var);
+      }
     }
+  else
+    {
+      # If generating plain Makefiles, do not output template definitons
+      # of configure variable. These will be set in "config.mk"

+      ($comments, undef, $rules) =
+        file_contents_internal (1, "$libdir/am/header-vars.amp",
+                new Automake::Location);
+    }
   $output_vars .= $comments . $rules;
 }

@@ -7023,8 +7113,12 @@ sub file_contents_internal ($$$%)
 sub file_contents ($$%)
 {
     my ($basename, $where, %transform) = @_;
+
+    # If in plain mode, prefer the use of *.amp Makefile fragments
+    $basename = ($plain && -e "$libdir/am/$basename.amp") ?
+                "$basename.amp" : "$basename.am";
     my ($comments, $variables, $rules) =
-      file_contents_internal (1, "$libdir/am/$basename.am", $where,
+      file_contents_internal (1, "$libdir/am/$basename", $where,
       %transform);
     return "$comments$variables$rules";
 }
@@ -7813,6 +7907,20 @@ sub generate_makefile ($$)

   $relative_dir = dirname ($makefile);

+  # Set $top_build_prefix
+  if ($relative_dir eq '.')
+    {
+      $top_builddir = '.';
+      $top_build_prefix = '';
+    }
+  else
+    {
+      # Replace every directory in relative_dir with ".."
+      $top_builddir = $relative_dir;
+      $top_builddir =~ s|[^\\/]+|..|g;
+      $top_build_prefix = $top_builddir . '/';
+    }
+
   read_main_am_file ($makefile_am, $makefile_in);
   if (handle_options)
     {
@@ -7915,6 +8023,35 @@ sub generate_makefile ($$)

   # Comes last, because all the above procedures may have
   # defined or overridden variables.
+  if ($plain)
+    {
+      # Precede list of variables with "config.mk" include
+
+      $output_vars .= "include $top_build_prefix" . "config.mk\n";
+
+      # Define directory variables based on contents of config.mk
+      $output_vars .=
+        "inv_top_builddir = $relative_dir\n" .
+        'abs_srcdir = $(abs_top_srcdir)/$(inv_top_buildir)' . "\n" .
+        'abs_builddir = $(abs_top_builddir)/$(inv_top_buildir)' . "\n" .
+        'srcdir = $(top_srcdir)/$(inv_top_builddir)' . "\n" .
+        'builddir = .' . "\n" .
+        "top_build_prefix = $top_build_prefix\n" .
+        "top_builddir = $top_builddir\n" .
+        'top_srcdir = $(top_builddir)/$(relative_src_path)' . "\n";
+
+      $output_vars .= "am__aux_dir = \$(abs_top_srcdir)/$config_aux_dir\n";
+
+      # DEPDIR is required to find *.Po includes
+      # Otherwise, if config.mk is not there, we will not get the error
+      # messages we want
+      # FIXME: We should avoid defining DEPDIR in AX_CONFIG_INCLUDE
+      $output_vars .= 'DEPDIR = .deps'  . "\n";
+
+      # Specify a default target to stop any other targets we define
+      # become the default target
+      $output_vars .= 'am_plain_default_goal: all' . "\n";
+    }
   $output_vars .= output_variables;

   check_typos;
@@ -8114,6 +8251,7 @@ sub parse_arguments ()
      'c|copy' => \$copy_missing,
      'v|verbose' => sub { setup_channel 'verb', silent => 0; },
      'W|warnings=s'     => address@hidden,
+     'plain' => sub { $plain = 1; },
      );

   use Automake::Getopt ();
@@ -8137,8 +8275,19 @@ sub parse_arguments ()

       # Handle $local:$input syntax.
       my ($local, @rest) = split (/:/, $arg);
-      @rest = ("$local.in",) unless @rest;
-      my $input = locate_am @rest;
+
+      my $input;
+      if (! $plain)
+        {
+          @rest = ("$local.in",) unless @rest;
+          $input = locate_am @rest;
+        }
+      else
+        {
+          # In plain mode, output "Makefile" instead of "Makefile.in"
+          (-f "$local.am") && ($input = $local);
+        }
+
       if ($input)
  {
   push @input_files, $input;
diff --git a/configure.ac b/configure.ac
index 761172a..1c00eea 100644
--- a/configure.ac
+++ b/configure.ac
@@ -613,6 +613,7 @@
AC_CONFIG_FILES([t/wrap/aclocal-${APIVERSION}:t/wrap/aclocal.in],
 AC_CONFIG_FILES([t/wrap/amplain-${APIVERSION}:t/wrap/amplain.in],
                 [chmod +x t/wrap/amplain-${APIVERSION}],
                 [APIVERSION=$APIVERSION])
+AC_CONFIG_FILES([lib/am/configure.amp])

 AC_OUTPUT

diff --git a/lib/am/clean.am b/lib/am/clean.am
index da46435..f901fa1 100644
--- a/lib/am/clean.am
+++ b/lib/am/clean.am
@@ -28,7 +28,7 @@ clean-generic:
 distclean-am: distclean-generic clean-am
 distclean-generic:
  -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm
-f $(CONFIG_CLEAN_VPATH_FILES)
+ -test "$(abs_top_srcdir)" = "$(abs_top_builddir)" || test -z
"$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
 %DISTCLEAN_RMS%

 ## Makefiles and their dependencies cannot be cleaned by
@@ -39,7 +39,7 @@ distclean-generic:
 ## If you change distclean here, you probably also want to change
 ## maintainer-clean below.
 distclean:
- -rm -f %MAKEFILE%
+?!PLAIN? -rm -f %MAKEFILE%

 maintainer-clean-am: maintainer-clean-generic distclean-am
 maintainer-clean-generic:
@@ -51,7 +51,7 @@ maintainer-clean-generic:

 ## See comment for distclean.
 maintainer-clean:
- -rm -f %MAKEFILE%
+?!PLAIN? -rm -f %MAKEFILE%

 .PHONY: clean mostlyclean distclean maintainer-clean \
 clean-generic mostlyclean-generic distclean-generic maintainer-clean-generic
diff --git a/lib/am/configure.amp b/lib/am/configure.amp
new file mode 100644
index 0000000..bc4e9e8
--- /dev/null
+++ b/lib/am/configure.amp
@@ -0,0 +1,136 @@
+## automake - create Makefile.in from Makefile.am
+## Copyright (C) 2001-2012 Free Software Foundation, Inc.
+
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2, or (at your option)
+## any later version.
+
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+
+## You should have received a copy of the GNU General Public License
+## along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+
+## This dummy rule is called from subdirectories whenever one of the
+## top-level Makefile's dependencies must be updated.  It does depend
+## on %MAKEFILE% for the benefit of non-GNU make implementations (GNU
+## make will always make sure %MAKEFILE% is updated before considering
+## the am--refresh target anyway).
+if %?TOPDIR_P%
+.PHONY: am--refresh
+am--refresh: %MAKEFILE%
+ @:
+endif %?TOPDIR_P%
+
+## --------------------- ##
+## Building Makefile.*.  ##
+## --------------------- ##
+
+## Combined generation of Makefile in srcdir and copying to builddir
+## if necessary
+
+AUTOMAKE="$(am__aux_dir)/missing" amplain-1.13
+
+## Ensure that GNU make doesn't remove Makefile if ./config.status (below)
+## is interrupted.  Otherwise, the user would need to know to rerun
+## ./config.status to recreate the lost Makefile.
+.PRECIOUS: %MAKEFILE%
+
+%MAKEFILE%: %MAKEFILE-IN-DEPS% %MAKEFILE-AM%
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) %AUTOMAKE-OPTIONS%
%MAKEFILE-AM-SOURCES%'; \
+ $(am__cd) $(top_srcdir) && \
+  $(AUTOMAKE) %AUTOMAKE-OPTIONS% %MAKEFILE-AM-SOURCES%
+## FIXME: $(am__depfiles_maybe) lets us re-run the rule to create the
+## .P files.  Ideally we wouldn't have to do this by hand.
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status
%CONFIG-MAKEFILE% $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status %CONFIG-MAKEFILE%
$(am__depfiles_maybe);
+
+## Avoid the "deleted header file" problem for the dependencies.
+?HAVE-MAKEFILE-IN-DEPS?%MAKEFILE-IN-DEPS%:
+
+DIST_COMMON += %MAKEFILE-AM%
+
+## config.mk
+# Both top_build_prefix and top_src_prefix are empty if config.mk does
+# not exist, so we default to the current directory
+$(top_build_prefix)config.mk: $(top_build_prefix)config.status
+ cd $(top_build_prefix). && $(SHELL) ./config.status $@
+
+## --------------------------- ##
+## config.status & configure.  ##
+## --------------------------- ##
+
+if %?TOPDIR_P%
+## Always require configure.ac and configure at top level, even if they
+## don't exist.  This is especially important for configure, since it
+## won't be created until autoconf is run -- which might be after
+## automake is run.
+DIST_COMMON += $(top_srcdir)/configure $(am__configure_deps)
+endif %?TOPDIR_P%
+
+$(top_build_prefix)config.status: $(top_src_prefix)configure
$(CONFIG_STATUS_DEPENDENCIES)
+?TOPDIR_P? if test -e ./config.status; then \
+?TOPDIR_P?  $(SHELL) ./config.status --recheck; else $(SHELL)
$(top_src_prefix)configure; \
+?TOPDIR_P? fi
+?!TOPDIR_P? cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_src_prefix)configure: %MAINTAINER-MODE% $(am__configure_deps)
+?TOPDIR_P? $(am__cd) $(srcdir) && $(AUTOCONF)
+?!TOPDIR_P? cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+
+## ------------ ##
+## aclocal.m4.  ##
+## ------------ ##
+
+## Whenever a configure dependency changes we need to rebuild
+## aclocal.m4 too.  Changing configure.ac, or any file included by
+## aclocal.m4 might require adding more files to aclocal.m4.  Hence
+## the $(am__configure_deps) dependency.
+## We still need $(ACLOCAL_AMFLAGS) for sake of backward-compatibility;
+## we should hopefully be able to get rid of it in a not-so-distant
+## future.
+if %?REGEN-ACLOCAL-M4%
+$(ACLOCAL_M4): %MAINTAINER-MODE% $(am__aclocal_m4_deps)
+?TOPDIR_P? $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+?!TOPDIR_P? cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+## Avoid the "deleted header file" problem for the dependencies.
+$(am__aclocal_m4_deps):
+endif %?REGEN-ACLOCAL-M4%
+
+
+## --------- ##
+## cleanup.  ##
+## --------- ##
+
+## We special-case config.status here.  If we do it as part of the
+## normal clean processing for this directory, then it might be
+## removed before some subdir is cleaned.  However, that subdir's
+## Makefile depends on config.status.
+
+if %?TOPDIR_P%
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+distclean:
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+
+## Note: you might think we should remove Makefile.in, configure, or
+## aclocal.m4 here in a maintainer-clean rule.  However, the GNU
+## Coding Standards explicitly prohibit this.
+
+maintainer-clean:
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+## autom4te.cache is created by Autoconf; the only valid target to
+## remove it is maintainer-clean, not distclean.
+## If you have an autom4te.cache that cause distcheck to fail, then
+## it is good news: you finally discovered that autoconf and/or
+## autoheader is needed to use your tarball, which is wrong.
+ -rm -rf $(top_srcdir)/autom4te.cache
+
+
+endif %?TOPDIR_P%
diff --git a/lib/am/configure.amp.in b/lib/am/configure.amp.in
new file mode 100644
index 0000000..2b83883
--- /dev/null
+++ b/lib/am/configure.amp.in
@@ -0,0 +1,149 @@
+## automake - create Makefile.in from Makefile.am
+## Copyright (C) 2001-2012 Free Software Foundation, Inc.
+
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2, or (at your option)
+## any later version.
+
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+
+## You should have received a copy of the GNU General Public License
+## along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+
+## This dummy rule is called from subdirectories whenever one of the
+## top-level Makefile's dependencies must be updated.  It does depend
+## on %MAKEFILE% for the benefit of non-GNU make implementations (GNU
+## make will always make sure %MAKEFILE% is updated before considering
+## the am--refresh target anyway).
+if %?TOPDIR_P%
+.PHONY: am--refresh
+am--refresh: %MAKEFILE%
+ @:
+endif %?TOPDIR_P%
+
+## --------------------- ##
+## Building Makefile.*.  ##
+## --------------------- ##
+
+## Combined generation of Makefile in srcdir and copying to builddir
+## if necessary
+
+AUTOMAKE="$(am__aux_dir)/missing" address@hidden@
+
+## Ensure that GNU make doesn't remove Makefile if ./config.status (below)
+## is interrupted.  Otherwise, the user would need to know to rerun
+## ./config.status to recreate the lost Makefile.
+.PRECIOUS: %MAKEFILE%
+
+%MAKEFILE%: %MAKEFILE-IN-DEPS% %MAKEFILE-AM% $(am__configure_deps)
$(top_builddir)/config.status
+## If configure.ac or one of configure's dependencies has changed, all
+## Makefiles are to be updated; it is then more efficient to run
+## automake on all the Makefiles at once.  It also allow Automake to be
+## run for newly added directories.
+ @for dep in $?; do \
+  case '$(am__configure_deps)' in \
+    *$$dep*) \
+?TOPDIR_P?      echo ' cd $(srcdir) && $(AUTOMAKE) %AUTOMAKE-OPTIONS%'; \
+?TOPDIR_P?      $(am__cd) $(srcdir) && $(AUTOMAKE) %AUTOMAKE-OPTIONS% \
+?TOPDIR_P? && exit 0; \
+?!TOPDIR_P?      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS)
am--refresh ) \
+## If on the other hand, subdir/Makefile has been removed, then toplevel
+## am--refresh will not be aware of any need to run.  We still invoke it
+## due to $? listing all prerequisites.  Fix up for it by running the rebuild
+## rule for this file only, below.
+?!TOPDIR_P?        && { if test -f $@; then exit 0; else break; fi; }; \
+      exit 1;; \
+  esac; \
+ done; \
+## Otherwise, rebuild only this file.
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) %AUTOMAKE-OPTIONS%
%MAKEFILE-AM-SOURCES%'; \
+ $(am__cd) $(top_srcdir) && \
+  $(AUTOMAKE) %AUTOMAKE-OPTIONS% %MAKEFILE-AM-SOURCES%
+## FIXME: $(am__depfiles_maybe) lets us re-run the rule to create the
+## .P files.  Ideally we wouldn't have to do this by hand.
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status
%CONFIG-MAKEFILE% $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status %CONFIG-MAKEFILE%
$(am__depfiles_maybe);
+
+## Avoid the "deleted header file" problem for the dependencies.
+?HAVE-MAKEFILE-IN-DEPS?%MAKEFILE-IN-DEPS%:
+
+DIST_COMMON += %MAKEFILE-AM%
+
+
+## --------------------------- ##
+## config.status & configure.  ##
+## --------------------------- ##
+
+if %?TOPDIR_P%
+## Always require configure.ac and configure at top level, even if they
+## don't exist.  This is especially important for configure, since it
+## won't be created until autoconf is run -- which might be after
+## automake is run.
+DIST_COMMON += $(top_srcdir)/configure $(am__configure_deps)
+endif %?TOPDIR_P%
+
+$(top_builddir)/config.status: $(top_srcdir)/configure
$(CONFIG_STATUS_DEPENDENCIES)
+?TOPDIR_P? $(SHELL) ./config.status --recheck
+?!TOPDIR_P? cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: %MAINTAINER-MODE% $(am__configure_deps)
+?TOPDIR_P? $(am__cd) $(srcdir) && $(AUTOCONF)
+?!TOPDIR_P? cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+
+## ------------ ##
+## aclocal.m4.  ##
+## ------------ ##
+
+## Whenever a configure dependency changes we need to rebuild
+## aclocal.m4 too.  Changing configure.ac, or any file included by
+## aclocal.m4 might require adding more files to aclocal.m4.  Hence
+## the $(am__configure_deps) dependency.
+## We still need $(ACLOCAL_AMFLAGS) for sake of backward-compatibility;
+## we should hopefully be able to get rid of it in a not-so-distant
+## future.
+if %?REGEN-ACLOCAL-M4%
+$(ACLOCAL_M4): %MAINTAINER-MODE% $(am__aclocal_m4_deps)
+?TOPDIR_P? $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+?!TOPDIR_P? cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+## Avoid the "deleted header file" problem for the dependencies.
+$(am__aclocal_m4_deps):
+endif %?REGEN-ACLOCAL-M4%
+
+
+## --------- ##
+## cleanup.  ##
+## --------- ##
+
+## We special-case config.status here.  If we do it as part of the
+## normal clean processing for this directory, then it might be
+## removed before some subdir is cleaned.  However, that subdir's
+## Makefile depends on config.status.
+
+if %?TOPDIR_P%
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+distclean:
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+
+## Note: you might think we should remove Makefile.in, configure, or
+## aclocal.m4 here in a maintainer-clean rule.  However, the GNU
+## Coding Standards explicitly prohibit this.
+
+maintainer-clean:
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+## autom4te.cache is created by Autoconf; the only valid target to
+## remove it is maintainer-clean, not distclean.
+## If you have an autom4te.cache that cause distcheck to fail, then
+## it is good news: you finally discovered that autoconf and/or
+## autoheader is needed to use your tarball, which is wrong.
+ -rm -rf $(top_srcdir)/autom4te.cache
+
+
+endif %?TOPDIR_P%
diff --git a/lib/am/depend2.amp b/lib/am/depend2.amp
new file mode 100644
index 0000000..b029606
--- /dev/null
+++ b/lib/am/depend2.amp
@@ -0,0 +1,135 @@
+## automake - create Makefile.in from Makefile.am
+## Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2, or (at your option)
+## any later version.
+
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+
+## You should have received a copy of the GNU General Public License
+## along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+## This file is read several times:
+## - once per *extension* (not per language) for generic compilation rules
+## - once for each file which requires specific flags.
+
+## Note it is on purpose we wrote "if %AMDEP%", since:
+##
+## - if deps are turned off, %AMDEP% is mapped onto FALSE, and therefore
+##   the "if FALSE" chunk is removed (automake-time conditionals).
+##
+## - if deps are on, %AMDEP% is mapped onto AMDEP,  and therefore
+##   the "if AMDEP" chunk is prefix with @AMDEP_TRUE@ just like for any
+##   other configure-time conditional.
+##
+## We do likewise for %FASTDEP%; this expands to an ordinary
+## configure-time conditional.  %FASTDEP% is used to speed up the
+## common case of building a package with gcc 3.x.  In this case we
+## can skip the use of depcomp and easily inline the dependency
+## tracking.
+
+## Verbosity of FASTDEP rules
+## --------------------------
+## (1) Some people want to see what happens during make.  They think
+##     @-commands are evil because hiding things hinders debugging.
+## (2) Other people want to see only the important commands--those that
+##     may produce diagnostics, such as compiler invocations.  They
+##     do not care about build details such as dependency generation
+##     (the if/then/else machinery in FASTDEP rules).  Their point is
+##     that it is hard to spot diagnostics in a verbose output.
+## (3) Other people want "make -s" to work as expected: silently.
+##     This way they can spot any diagnostic really easily.
+##
+## The second point suggests we hide rules with @ and that we 'echo'
+## only the relevant parts.  However this goes against the two others.
+## There are regular complaints about this on the mailing list, but
+## it's hard to please everybody.  On April 2003, William Fulton (from
+## clan (3)) and Karl Berry (from clan (2)) agreed that folding the
+## compile rules so that they are output on a single line (instead of 5)
+## would be a good compromise.  Actually we use two lines rather than one,
+## because this way %SOURCE% is always located at the end of the first
+## line and is therefore easier to spot.  (We need an extra line when
+## depbase is used.)
+
+if %?NONLIBTOOL%
+?GENERIC?%EXT%.o:
+?!GENERIC?%OBJ%: %SOURCE%
+ %VERBOSE%
+if %AMDEP%
+## In fast-dep mode, we can always use -o.
+## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
+if !%?GENERIC%
+ %FASTDEP_ENABLED%%SILENT%%COMPILE% -MT %OBJ% -MD -MP -MF
%DEPBASE%.Tpo %-c% -o %OBJ% %SOURCEFLAG%`test -f '%SOURCE%' || echo
'$(srcdir)/'`%SOURCE%
+ %FASTDEP_ENABLED%%SILENT%$(am__mv) %DEPBASE%.Tpo %DEPBASE%.Po
+else %?GENERIC%
+?!SUBDIROBJ? %FASTDEP_ENABLED%%SILENT%%COMPILE% -MT %OBJ% -MD -MP -MF
%DEPBASE%.Tpo %-c% -o %OBJ% %SOURCEFLAG%%SOURCE%
+?!SUBDIROBJ? %FASTDEP_ENABLED%%SILENT%$(am__mv) %DEPBASE%.Tpo %DEPBASE%.Po
+?SUBDIROBJ? %FASTDEP_ENABLED%%SILENT%depbase=`echo %OBJ% | sed
's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+?SUBDIROBJ? %FASTDEP_ENABLED%%COMPILE% -MT %OBJ% -MD -MP -MF
%DEPBASE%.Tpo %-c% -o %OBJ% %SOURCEFLAG%%SOURCE% &&\
+?SUBDIROBJ? %FASTDEP_ENABLED%$(am__mv) %DEPBASE%.Tpo %DEPBASE%.Po
+endif %?GENERIC%
+ %FASTDEP_DISABLED%$(am__AMDEP_enabled)%SILENT%source='%SOURCE%'
object='%OBJ%' libtool=no \
+ DEPDIR=$(DEPDIR) $(%FPFX%DEPMODE) $(depcomp) \
+ %COMPILE% %-c% %-o2% %SOURCEFLAG%%source-search%%SOURCE%
+ $(am__AMDEP_disabled)%SILENT%%COMPILE% %-c% %-o2%
%SOURCEFLAG%%source-search%%SOURCE%
+else !%AMDEP%
+ %SILENT%%COMPILE% %-c% %-o2% %SOURCEFLAG%%source-search%%SOURCE%
+endif !%AMDEP%
+
+?GENERIC?%EXT%.obj:
+?!GENERIC?%OBJOBJ%: %SOURCE%
+if %FASTDEP%
+## In fast-dep mode, we can always use -o.
+## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
+?!GENERIC? %VERBOSE%%COMPILE% -MT %OBJOBJ% -MD -MP -MF %DEPBASE%.Tpo
%-c% -o %OBJOBJ% %SOURCEFLAG%`if test -f '%SOURCE%'; then $(CYGPATH_W)
'%SOURCE%'; else $(CYGPATH_W) '$(srcdir)/%SOURCE%'; fi`
+?!GENERIC? %SILENT%$(am__mv) %DEPBASE%.Tpo %DEPBASE%.Po
+?GENERIC??!SUBDIROBJ? %VERBOSE%%COMPILE% -MT %OBJOBJ% -MD -MP -MF
%DEPBASE%.Tpo %-c% -o %OBJOBJ% %SOURCEFLAG%`$(CYGPATH_W) '%SOURCE%'`
+?GENERIC??!SUBDIROBJ? %SILENT%$(am__mv) %DEPBASE%.Tpo %DEPBASE%.Po
+?GENERIC??SUBDIROBJ? %VERBOSE%depbase=`echo %OBJ% | sed
's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+?GENERIC??SUBDIROBJ? %COMPILE% -MT %OBJOBJ% -MD -MP -MF %DEPBASE%.Tpo
%-c% -o %OBJOBJ% %SOURCEFLAG%`$(CYGPATH_W) '%SOURCE%'` &&\
+?GENERIC??SUBDIROBJ? $(am__mv) %DEPBASE%.Tpo %DEPBASE%.Po
+else !%FASTDEP%
+if %AMDEP%
+ $(am__AMDEP_TRUE)%VERBOSE%source='%SOURCE%' object='%OBJOBJ%'
libtool=no @AMDEPBACKSLASH@
+ $(am__AMDEP_TRUE)DEPDIR=$(DEPDIR) $(%FPFX%DEPMODE) $(depcomp) @AMDEPBACKSLASH@
+endif %AMDEP%
+if %?GENERIC%
+?-o? %VERBOSE-NODEP%%COMPILE% %-c% %-o% %OBJOBJ%
%SOURCEFLAG%`$(CYGPATH_W) '%SOURCE%'`
+?!-o? %VERBOSE-NODEP%%COMPILE% %-c% `$(CYGPATH_W) %SOURCEFLAG%'%SOURCE%'`
+else !%?GENERIC%
+## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
+?-o? %VERBOSE-NODEP%%COMPILE% %-c% %-o% %OBJOBJ% %SOURCEFLAG%`if test
-f '%SOURCE%'; then $(CYGPATH_W) '%SOURCE%'; else $(CYGPATH_W)
'$(srcdir)/%SOURCE%'; fi`
+?!-o? %VERBOSE-NODEP%%COMPILE% %-c% %SOURCEFLAG%`if test -f
'%SOURCE%'; then $(CYGPATH_W) '%SOURCE%'; else $(CYGPATH_W)
'$(srcdir)/%SOURCE%'; fi`
+endif !%?GENERIC%
+endif !%FASTDEP%
+endif %?NONLIBTOOL%
+
+if %?LIBTOOL%
+?GENERIC?%EXT%.lo:
+?!GENERIC?%LTOBJ%: %SOURCE%
+if %FASTDEP%
+## In fast-dep mode, we can always use -o.
+## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
+?!GENERIC? %VERBOSE%%LTCOMPILE% -MT %LTOBJ% -MD -MP -MF %DEPBASE%.Tpo
%-c% -o %LTOBJ% %SOURCEFLAG%`test -f '%SOURCE%' || echo
'$(srcdir)/'`%SOURCE%
+?!GENERIC? %SILENT%$(am__mv) %DEPBASE%.Tpo %DEPBASE%.Plo
+?GENERIC??!SUBDIROBJ? %VERBOSE%%LTCOMPILE% -MT %LTOBJ% -MD -MP -MF
%DEPBASE%.Tpo %-c% -o %LTOBJ% %SOURCEFLAG%%SOURCE%
+?GENERIC??!SUBDIROBJ? %SILENT%$(am__mv) %DEPBASE%.Tpo %DEPBASE%.Plo
+?GENERIC??SUBDIROBJ? %VERBOSE%depbase=`echo %OBJ% | sed
's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+?GENERIC??SUBDIROBJ? %LTCOMPILE% -MT %LTOBJ% -MD -MP -MF
%DEPBASE%.Tpo %-c% -o %LTOBJ% %SOURCEFLAG%%SOURCE% &&\
+?GENERIC??SUBDIROBJ? $(am__mv) %DEPBASE%.Tpo %DEPBASE%.Plo
+else !%FASTDEP%
+if %AMDEP%
+ $(am__AMDEP_TRUE)%VERBOSE%source='%SOURCE%' object='%LTOBJ%'
libtool=yes @AMDEPBACKSLASH@
+ $(am__AMDEP_TRUE)DEPDIR=$(DEPDIR) $(%FPFX%DEPMODE) $(depcomp) @AMDEPBACKSLASH@
+endif %AMDEP%
+## We can always use '-o' with Libtool.
+?GENERIC? %VERBOSE-NODEP%%LTCOMPILE% %-c% -o %LTOBJ% %SOURCEFLAG%%SOURCE%
+## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
+?!GENERIC? %VERBOSE-NODEP%%LTCOMPILE% %-c% -o %LTOBJ%
%SOURCEFLAG%`test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
+endif !%FASTDEP%
+endif %?LIBTOOL%
diff --git a/lib/am/header-vars.amp b/lib/am/header-vars.amp
new file mode 100644
index 0000000..bb9c697
--- /dev/null
+++ b/lib/am/header-vars.amp
@@ -0,0 +1,84 @@
+## automake - create Makefile.in from Makefile.am
+## Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2, or (at your option)
+## any later version.
+
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+
+## You should have received a copy of the GNU General Public License
+## along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+VPATH = $(srcdir)
+
+## FIXME: workarounds to set $(MAKE) if make doesn't set it
+## @SET_MAKE@
+
+## We used to define this.  However, we don't because vendor makes
+## (e.g., Solaris, Irix) won't correctly propagate variables that are
+## defined in Makefile.  This particular variable can't be correctly
+## defined by configure (at least, not the current configure), so we
+## simply avoid defining it to allow the user to use this feature with
+## a vendor make.
+## DESTDIR =
+
+## Shell code that determines whether make is running in "dry mode"
+## ("make -n") or not.  Useful in rules that invoke make recursively,
+## and are thus executed also with "make -n" -- either because they
+## are declared as dependencies to '.MAKE' (NetBSD make), or because
+## their recipes contain the "$(MAKE)" string (GNU and Solaris make).
+
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+## If we run "make TESTS='snooze nap'", GNU make will export MAKEFLAGS
+## to "TESTS=foo\ nap", so that the simpler loop below (on word-splitted
+## $$MAKEFLAGS) would see a "make flag" equal to "nap", and would wrongly
+## misinterpret that as and indication that make is running in dry mode.
+## This has already happened in practice.  So we need this hack.
+      *\\[\ \ ]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+
+## Some derived variables that have been found to be useful.
+pkgdatadir = $(datadir)/$(PACKAGE)
+pkgincludedir = $(includedir)/$(PACKAGE)
+pkglibdir = $(libdir)/$(PACKAGE)
+pkglibexecdir = $(libexecdir)/$(PACKAGE)
+
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+
+## These are defined because otherwise make on NetBSD V1.1 will print
+## (eg): $(NORMAL_INSTALL) expands to empty string.
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+
+## dejagnu.am uses these variables.  Some users might rely on them too.
+?BUILD?build_triplet = @build@
+?HOST?host_triplet = @host@
+?TARGET?target_triplet = @target@
diff --git a/m4/ax_config_include.m4 b/m4/ax_config_include.m4
new file mode 100644
index 0000000..a5e6d1a
--- /dev/null
+++ b/m4/ax_config_include.m4
@@ -0,0 +1,31 @@
+AC_DEFUN([AX_CONFIG_INCLUDE],
+[# Create config.mk.in in source tree
+for ac_file in $@; do
+  t=$srcdir/$ac_file.in
+  rm -f $t
+
+  for ac_var in $ac_subst_vars; do
+   eval am_var=am_subst_notmake_\$ac_var
+   eval am_var_val=\$$am_var
+   if test -n "$am_var_val"; then :; else
+     echo $ac_var = address@hidden@ >> $t
+   fi
+  done
+  for var in \
+    abs_top_srcdir abs_top_builddir; do
+    echo "$var = @$var@" >> $t
+  done
+  # @srcdir@ is path from top_builddir to top_srcdir provided
+  # config.mk is in top_builddir
+  echo "relative_src_path = @srcdir@" >> $t
+  # Analagous to top_build_prefix
+  echo "top_src_prefix = @srcdir@/" >> $t
+done
+dnl Prevent automake from generating rebuild rules for config.mk by
+dnl passing "config.mk" to AC_CONFIG_FILES indirectly
+ac_config_mk_location=config.mk
+dnl Third option is needed otherwise config.status doesn't work properly.
+dnl See http://lists.gnu.org/archive/html/bug-autoconf/2008-08/msg00029.html
+AC_CONFIG_FILES([$ac_config_mk_location], [],
[ac_config_mk_location=$ac_config_mk_location])
+])
+
diff --git a/m4/depend.m4 b/m4/depend.m4
index cd93061..ea59305 100644
--- a/m4/depend.m4
+++ b/m4/depend.m4
@@ -153,6 +153,18 @@ AC_SUBST([$1DEPMODE],
[depmode=$am_cv_$1_dependencies_compiler_type])
 AM_CONDITIONAL([am__fastdep$1], [
   test "x$enable_dependency_tracking" != xno \
   && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+
+# Set output switches for plain mode
+if test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_$1_dependencies_compiler_type" = gcc3; then
+  am__fastdep$1_enabled=''
+  am__fastdep$1_disabled='@: '
+else
+  am__fastdep$1_enabled='@: '
+  am__fastdep$1_disabled=''
+fi
+AC_SUBST([am__fastdep$1_enabled])
+AC_SUBST([am__fastdep$1_disabled])
 ])


@@ -176,14 +188,19 @@ AS_HELP_STRING(
 AS_HELP_STRING(
   [--disable-dependency-tracking],
   [speeds up one-time build])])
+am__AMDEP_enabled='@: '
+am__AMDEP_disabled=''
 if test "x$enable_dependency_tracking" != xno; then
   am_depcomp="$ac_aux_dir/depcomp"
   AMDEPBACKSLASH='\'
   am__nodep='_no'
+  am__AMDEP_enabled=''
+  am__AMDEP_disabled='@: '
 fi
+AC_SUBST([am__AMDEP_enabled])
+AC_SUBST([am__AMDEP_disabled])
 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
 AC_SUBST([AMDEPBACKSLASH])dnl
 _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
-AC_SUBST([am__nodep])dnl
-_AM_SUBST_NOTMAKE([am__nodep])dnl
+AC_SUBST([am__nodep])
 ])
diff --git a/m4/depout.m4 b/m4/depout.m4
index 835c32b..608ef53 100644
--- a/m4/depout.m4
+++ b/m4/depout.m4
@@ -14,9 +14,9 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
   # Older Autoconf quotes --file arguments for eval, but not when files
   # are listed without --file.  Let's play safe and only enable the eval
   # if we detect the quoting.
-  case $CONFIG_FILES in
-  *\'*) eval set x "$CONFIG_FILES" ;;
-  *)   set x $CONFIG_FILES ;;
+  case "$CONFIG_FILES $CONFIG_LINKS" in
+  *\'*) eval set x "$CONFIG_FILES" "$CONFIG_LINKS" ;;
+  *)   set x $CONFIG_FILES $CONFIG_LINKS ;;
   esac
   shift
   for mf
@@ -42,6 +42,11 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
     am__include=`sed -n 's/^am__include = //p' < "$mf"`
     test -z "am__include" && continue
     am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+
+    # Default values in case Makefile.in was generated with --plain
+    test -n "$am__include" || am__include=include
+    test -n "$am__quote" || am__quote=''
+
     # Find all dependency output files, they are included files with
     # $(DEPDIR) in their names.  We invoke sed twice because it is the
     # simplest approach to changing $(DEPDIR) to its actual value in the
diff --git a/m4/substnot.m4 b/m4/substnot.m4
index 1830e79..0525931 100644
--- a/m4/substnot.m4
+++ b/m4/substnot.m4
@@ -9,7 +9,9 @@
 # ---------------------------
 # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
 # This macro is traced by Automake.
-AC_DEFUN([_AM_SUBST_NOTMAKE])
+AC_DEFUN([_AM_SUBST_NOTMAKE], [
address@hidden
+])

 # AM_SUBST_NOTMAKE(VARIABLE)
 # --------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]