]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
Merge branch 'master' into ng/master
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sun, 21 Apr 2013 09:24:54 +0000 (11:24 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Sun, 21 Apr 2013 16:03:15 +0000 (18:03 +0200)
* master:
  INSTALL: regen
  sync: update files from upstream with "make fetch"
  tests: tweaks and minimal improvements to t/insthook.sh
  typofix: in comments in t/extra2.sh
  tests: fix botched cross-reference in a heading comment
  compat: reinstate support for obsolete $(INCLUDES) variable
  automake: refactoring: factor out common cpp-like flags
  NEWS (mint): reflect new Automake versioning scheme
  NEWS (master): reflect new Automake versioning scheme
  Add missing '$' for variable expansion in depout.m4
  maintcheck: avoid spurious failure
  perl: perl subroutine prototypes are problematic, don't use them
  fixup: one stray reference to older versioning scheme
  preproc: enhance and extend tests
  preproc: add support for relative names in included fragments

+ Non-trivial extra changes:

* automake.in (@cpplike_flags): Use $(AM_DEFAULT_INCLUDES), not
$(DEFAULT_INCLUDES).  Do not support $(INCLUDES).
(generate_makefile): User definition of $(INCLUDES) causes a fatal
error, not a warning.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
1  2 
automake.in
doc/automake-ng.texi
lib/Automake/Options.pm
t/extra-dist-wildcards.sh
t/insthook.sh
t/warnopts.sh

diff --cc automake.in
index 7b69dde91f3f7bf3f0e2b9c3bac88f73bad32a1f,0dcf06beff7e111a85297f5b498a30675f855544..b01803f5cbf1d6634a09619363eeab1f333f2763
@@@ -560,6 -600,15 +560,14 @@@ sub initialize_per_input (
  
  # Initialize our list of languages that are internally supported.
  
 -    $(DEFAULT_INCLUDES)
 -    $(INCLUDES)
+ my @cpplike_flags =
+   qw{
+     $(DEFS)
++    $(AM_DEFAULT_INCLUDES)
+     $(AM_CPPFLAGS)
+     $(CPPFLAGS)
+   };
  # C.
  register_language ('name' => 'c',
                   'Name' => 'C',
@@@ -3355,40 -3937,15 +3363,40 @@@ sub rewrite_inputs_into_dependencie
    return @res;
  }
  
 +sub handle_config_headers ()
 +{
 +  my (@config_h_local, @config_h_nonlocal, @config_hin_local);
 +  foreach my $spec (@config_headers)
 +    {
 +      my ($out, @ins) = split_config_file_spec ($spec);
 +      if ($relative_dir eq dirname ($out))
 +      {
 +        push @config_h_local, basename ($out);
 +      }
 +      else
 +      {
 +        push @config_h_nonlocal, "\$(top_builddir)/$out";
 +      }
 +      foreach my $in (@ins)
 +        {
 +        push @config_hin_local, '$(srcdir)/' . basename ($in)
 +            if $relative_dir eq dirname ($in);
 +        }
 +    }
 +  define_variable ('am.config-hdr.local', INTERNAL, @config_h_local);
 +  define_variable ('am.config-hdr.non-local', INTERNAL, @config_h_nonlocal);
 +  define_variable ('am.config-hdr.local.in',  INTERNAL, @config_hin_local);
 +  define_variable ('AM_CONFIG_HEADERS', INTERNAL,
 +                   qw/$(am.config-hdr.local) $(am.config-hdr.non-local)/);
 +}
  
 -
 -# handle_configure ($MAKEFILE_AM, $MAKEFILE_IN, $MAKEFILE, @INPUTS)
 -# -----------------------------------------------------------------
 +# handle_configure ($MAKEFILE, @INPUTS)
 +# -------------------------------------
  # Handle remaking and configure stuff.
  # We need the name of the input file, to do proper remaking rules.
- sub handle_configure ($@)
+ sub handle_configure
  {
 -  my ($makefile_am, $makefile_in, $makefile, @inputs) = @_;
 +  my ($makefile, @inputs) = @_;
  
    prog_error 'empty @inputs'
      unless @inputs;
@@@ -4951,8 -6009,9 +4959,8 @@@ sub cond_stack_endi
  # be defined conditionally.  The second argument is the condition
  # under which the value should be defined; this should be the empty
  # string to define the variable unconditionally.  The third argument
 -# is a list holding the values to use for the variable.  The value is
 -# pretty printed in the output file.
 -sub define_pretty_variable
 +# is a list holding the values to use for the variable.
- sub define_cond_variable ($$$@)
++sub define_cond_variable
  {
      my ($var, $cond, $where, @value) = @_;
  
  # --------------------------------------
  # Define a new Automake Makefile variable VAR to VALUE, but only if
  # not already defined.
- sub define_variable ($$@)
+ sub define_variable
  {
 -    my ($var, $value, $where) = @_;
 -    define_pretty_variable ($var, TRUE, $where, $value);
 +    my ($var, $where, @value) = @_;
 +    define_cond_variable ($var, TRUE, $where, @value);
  }
  
  
@@@ -4996,9 -6056,9 +5004,9 @@@ sub define_configure_variabl
    # Some variables we do not want to output.  For instance it
    # would be a bad idea to output `U = @U@` when `@U@` can be
    # substituted as `\`.
 -  my $pretty = exists $ignored_configure_vars{$var} ? VAR_SILENT : VAR_ASIS;
 +  return if exists $ignored_configure_vars{$var};
-   Automake::Variable::define ($var, VAR_CONFIGURE, '', TRUE, subst $var,
+   Automake::Variable::define ($var, VAR_CONFIGURE, '', TRUE, subst ($var),
 -                            '', $configure_vars{$var}, $pretty);
 +                            '', $configure_vars{$var});
  }
  
  
@@@ -5200,8 -6265,24 +5209,19 @@@ sub read_am_fil
        chomp;
        $_ .= "\n";
  
 -      # Don't look at MAINTAINER_MODE_TRUE here.  That shouldn't be
 -      # used by users.  @MAINT@ is an anachronism now.
 -      $_ =~ s/\@MAINT\@//g
 -          unless $seen_maint_mode;
 -
        my $new_saw_bk = check_trailing_slash ($where, $_);
  
+       if ($reldir eq '.')
+         {
+           # If present, eat the following '_' or '/', converting
+           # "%reldir%/foo" and "%canon_reldir%_foo" into plain "foo"
+           # when $reldir is '.'.
+           $_ =~ s,%(D|reldir)%/,,g;
+           $_ =~ s,%(C|canon_reldir)%_,,g;
+         }
+       $_ =~ s/%(D|reldir)%/${reldir}/g;
+       $_ =~ s/%(C|canon_reldir)%/${canon_reldir}/g;
        if (/$IGNORE_PATTERN/o)
        {
            # Merely delete comments beginning with two hashes.
@@@ -5362,10 -6493,14 +5384,13 @@@ sub define_standard_variables (
      {
        define_configure_variable ($var);
      }
 -
 -  $output_vars .= $comments . $rules;
 +  $output_vars .= verbatim ('header-vars');
  }
  
- sub read_main_am_file ($$)
+ # read_main_am_file ($MAKEFILE_AM, $MAKEFILE_IN)
+ # ----------------------------------------------
+ sub read_main_am_file
  {
      my ($amfile, $infile) = @_;
  
@@@ -6363,13 -7461,15 +6392,13 @@@ sub required_file_check_or_cop
  }
  
  
 -# require_file_internal ($WHERE, $MYSTRICT, $DIRECTORY, $QUEUE, @FILES)
 -# ---------------------------------------------------------------------
 +# require_file_internal ($WHERE, $MYSTRICT, $DIRECTORY, @FILES)
 +# -------------------------------------------------------------
  # Verify that the file must exist in $DIRECTORY, or install it.
  # $MYSTRICT is the strictness level at which this file becomes required.
- sub require_file_internal ($$$@)
 -# Worker threads may queue up the action to be serialized by the master,
 -# if $QUEUE is true
+ sub require_file_internal
  {
 -  my ($where, $mystrict, $dir, $queue, @files) = @_;
 +  my ($where, $mystrict, $dir, @files) = @_;
  
    return
      unless $strictness >= $mystrict;
  
  # require_file ($WHERE, $MYSTRICT, @FILES)
  # ----------------------------------------
- sub require_file ($$@)
+ sub require_file
  {
      my ($where, $mystrict, @files) = @_;
 -    require_file_internal ($where, $mystrict, $relative_dir, 0, @files);
 +    require_file_internal ($where, $mystrict, $relative_dir, @files);
  }
  
  # require_file_with_macro ($COND, $MACRO, $MYSTRICT, @FILES)
@@@ -6420,10 -7529,63 +6449,10 @@@ sub require_libsource_with_macr
  # require_conf_file ($WHERE, $MYSTRICT, @FILES)
  # ---------------------------------------------
  # Looks in configuration path, as specified by AC_CONFIG_AUX_DIR.
- sub require_conf_file ($$@)
+ sub require_conf_file
  {
      my ($where, $mystrict, @files) = @_;
 -    my $queue = defined $required_conf_file_queue ? 1 : 0;
 -    require_file_internal ($where, $mystrict, $config_aux_dir,
 -                           $queue, @files);
 +    require_file_internal ($where, $mystrict, $config_aux_dir, @files);
  }
  
  
@@@ -6440,8 -7602,68 +6469,8 @@@ sub require_conf_file_with_macr
  
  # require_build_directory ($DIRECTORY)
  # ------------------------------------
 -# Emit rules to create $DIRECTORY if needed, and return
 -# the file that any target requiring this directory should be made
 -# dependent upon.
 -# We don't want to emit the rule twice, and want to reuse it
 -# for directories with equivalent names (e.g., 'foo/bar' and './foo//bar').
 -sub require_build_directory
 -{
 -  my $directory = shift;
 -
 -  return $directory_map{$directory} if exists $directory_map{$directory};
 -
 -  my $cdir = File::Spec->canonpath ($directory);
 -
 -  if (exists $directory_map{$cdir})
 -    {
 -      my $stamp = $directory_map{$cdir};
 -      $directory_map{$directory} = $stamp;
 -      return $stamp;
 -    }
 -
 -  my $dirstamp = "$cdir/\$(am__dirstamp)";
 -
 -  $directory_map{$directory} = $dirstamp;
 -  $directory_map{$cdir} = $dirstamp;
 -
 -  # Set a variable for the dirstamp basename.
 -  define_pretty_variable ('am__dirstamp', TRUE, INTERNAL, '.dirstamp');
 -
 -  # Directory must be removed by 'make distclean'.
 -  $clean_files{$dirstamp} = DIST_CLEAN;
 -
 -  $output_rules .= ("$dirstamp:\n"
 -                  . "\t\@\$(MKDIR_P) $directory\n"
 -                  . "\t\@: > $dirstamp\n");
 -
 -  return $dirstamp;
 -}
 -
 -# require_build_directory_maybe ($FILE)
 -# -------------------------------------
 -# If $FILE lies in a subdirectory, emit a rule to create this
 -# directory and return the file that $FILE should be made
 -# dependent upon.  Otherwise, just return the empty string.
 -sub require_build_directory_maybe
 -{
 -    my $file = shift;
 -    my $directory = dirname ($file);
 -
 -    if ($directory ne '.')
 -    {
 -      return require_build_directory ($directory);
 -    }
 -    else
 -    {
 -      return '';
 -    }
 -}
 -
 -################################################################
 -
  # Push a list of files onto '@dist_common'.
- sub push_dist_common (@)
+ sub push_dist_common
  {
    prog_error "push_dist_common run after handle_dist"
      if $handle_dist_run;
@@@ -6509,29 -7731,15 +6536,35 @@@ sub generate_makefil
                "'ACLOCAL_AMFLAGS' is deprecated; use 'AC_CONFIG_MACRO_DIRS'"
                . " in configure.ac instead";
      }
 -      msg_var 'obsolete', $ovar,
 -              "'INCLUDES' is deprecated; you should use 'AM_CPPFLAGS'"
+   if (my $ovar = var ('INCLUDES'))
+     {
++      reject_var $ovar,
++              "'INCLUDES' is obsolete; you should use 'AM_CPPFLAGS'"
+               . " (or '*_CPPFLAGS') instead"
+     }
  
 -  # Must do this after reading .am file.
 -  define_variable ('subdir', $relative_dir, INTERNAL);
 +  # Some of these must do this after reading .am file.
 +
 +  define_variable ('subdir', INTERNAL, $relative_dir);
 +  define_variable ('am.conf.is-topdir', INTERNAL,
 +                   $relative_dir eq '.' ? "yes" : "");
 +  define_variable ('am.conf.check-news', INTERNAL,
 +                   option 'check-news' ? "yes" : "");
 +  define_variable ('am.conf.no-installinfo', INTERNAL,
 +                   option 'no-installinfo' ? "yes" : "");
 +  define_variable ('am.conf.aux-dir', INTERNAL, $am_config_aux_dir);
 +  define_variable ('am.relpath.makefile', INTERNAL, basename ($makefile));
 +  define_variable ('am.relpath.makefile.am', INTERNAL,
 +                   prepend_srcdir ($makefile_am));
 +  define_variable ('am.relpath.makefile.in', INTERNAL,
 +                   prepend_srcdir ($makefile_in));
 +
 +  define_variable 'am.conf.build-triplet', INTERNAL,
 +                  $seen_canonical >= AC_CANONICAL_BUILD ? '$(build)' : '';
 +  define_variable 'am.conf.host-triplet', INTERNAL,
 +                  $seen_canonical >= AC_CANONICAL_HOST ? '$(host)' : '';
 +  define_variable 'am.conf.target-triplet', INTERNAL,
 +                  $seen_canonical >= AC_CANONICAL_TARGET ? '$(target)' : '';
  
    # If DIST_SUBDIRS is defined, make sure SUBDIRS is, so that
    # recursive rules are enabled.
Simple merge
Simple merge
index 15ab4403a9854a7cbbed01bc1256480fc2ba7c21,782b8d772786a153991c9c67cbdae8b636f7e543..b669717d2a28843a625fe66944d2955c8afee630
  
  # Check that wildcards in EXTRA_DIST are honoured.
  # Suggested by observations from Braden McDaniel.
- # See also sister test 'extra11.sh', that checks a similar usage
- # with the involvement of the $(wildcard) GNU make builtin.
+ # See also sister test 'extra-dist-wildcards-gnu.sh', that checks a
+ # similar usage with the involvement of the $(wildcard) GNU make builtin.
  
 -required=GNUmake
  . test-init.sh
  
  echo AC_OUTPUT >> configure.ac
diff --cc t/insthook.sh
index c752a4a2c6c2a8d276ebf18a2c609c1b85be5240,92840df968c510d72ecbf9d707cf18940dd3c28b..1a91826760c1d82555b575116057cbc7f9e528e3
@@@ -58,11 -58,11 +58,11 @@@ test -f o
  # version.)
  ./configure "--bindir=$(pwd)/bin"
  $MAKE install
- echo 2 > foo
+ echo b > foo
 -VERSION=2.0 $MAKE -e install
 +$MAKE install VERSION=2.0
- grep 1 bin/foo-1.0
- grep 2 bin/foo-2.0
- grep 2 bin/foo
+ test $(cat bin/foo-1.0) = a
+ test $(cat bin/foo-2.0) = b
+ test $(cat bin/foo)     = b
  
  # install-hook is an error.
  cat >>Makefile.am <<EOF
diff --cc t/warnopts.sh
Simple merge