Merge branch 'micro' into maint
[platform/upstream/automake.git] / bin / automake.in
index 0aef771..40b3181 100644 (file)
@@ -632,6 +632,7 @@ register_language ('name' => 'c',
                   'linker' => 'LINK',
                   'link' => '$(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@',
                   'compile_flag' => '-c',
+                  'output_flag' => '-o',
                   'libtool_tag' => 'CC',
                   'extensions' => ['.c']);
 
@@ -1313,14 +1314,6 @@ sub handle_languages ()
        if (((! option 'no-dependencies') && $lang->autodep ne 'no')
            || defined $lang->compile)
        {
-           # Some C compilers don't support -c -o.  Use it only if really
-           # needed.
-           my $output_flag = $lang->output_flag || '';
-           $output_flag = '-o'
-             if (! $output_flag
-                 && $lang->name eq 'c'
-                 && option 'subdir-objects');
-
            # Compute a possible derived extension.
            # This is not used by depend2.am.
            my $der_ext = ($lang->output_extensions->($ext))[0];
@@ -1364,7 +1357,7 @@ sub handle_languages ()
 
                             COMPILE   => '$(' . $lang->compiler . ')',
                             LTCOMPILE => '$(LT' . $lang->compiler . ')',
-                            -o        => $output_flag,
+                            -o        => $lang->output_flag,
                             SUBDIROBJ => !! option 'subdir-objects');
        }
 
@@ -3217,6 +3210,7 @@ sub handle_texinfo_helper
       #      was once done when the (now removed) 'cygnus' option was
       #      given.  See automake bug#11034 for more discussion.
       my $insrc = 1;
+      my $soutdir = '$(srcdir)/' . $outdir;
 
       if (option 'info-in-builddir')
         {
@@ -3239,12 +3233,12 @@ Oops!
 EOF
         }
 
-      $outdir = '$(srcdir)/' . $outdir if $insrc;
+      $outdir = $soutdir if $insrc;
 
       # If user specified file_TEXINFOS, then use that as explicit
       # dependency list.
       @texi_deps = ();
-      push (@texi_deps, "$outdir$vtexi") if $vtexi;
+      push (@texi_deps, "${soutdir}${vtexi}") if $vtexi;
 
       my $canonical = canonicalize ($infobase);
       if (var ($canonical . "_TEXINFOS"))
@@ -3298,8 +3292,8 @@ EOF
                                          new Automake::Location,
                                          TEXI     => $texi,
                                          VTI      => $vti,
-                                         STAMPVTI => "${outdir}stamp-$vti",
-                                         VTEXI    => "$outdir$vtexi",
+                                         STAMPVTI => "${soutdir}stamp-$vti",
+                                         VTEXI    => "$soutdir$vtexi",
                                          MDDIR    => $conf_dir,
                                          DIRSTAMP => $dirstamp);
        }
@@ -5235,10 +5229,8 @@ sub scan_autoconf_traces
        }
       elsif ($macro eq 'AM_PROG_MKDIR_P')
        {
-          # FIXME: we are no longer going to remove this! adjust warning
-          # FIXME: message accordingly.
          msg 'obsolete', $where, <<'EOF';
-The 'AM_PROG_MKDIR_P' macro is deprecated, and will soon be removed.
+The 'AM_PROG_MKDIR_P' macro is deprecated, and its use is discouraged.
 You should use the Autoconf-provided 'AC_PROG_MKDIR_P' macro instead,
 and use '$(MKDIR_P)' instead of '$(mkdir_p)'in your Makefile.am files.
 EOF
@@ -5862,7 +5854,7 @@ sub register_language
   # Update the pattern of known extensions.
   accept_extensions (@{$lang->extensions});
 
-  # Update the $suffix_rule map.
+  # Update the suffix rules map.
   foreach my $suffix (@{$lang->extensions})
     {
       foreach my $dest ($lang->output_extensions->($suffix))
@@ -5880,12 +5872,11 @@ sub derive_suffix
 {
   my ($source_ext, $obj) = @_;
 
-  while (! $extension_map{$source_ext}
-        && $source_ext ne $obj
-        && exists $suffix_rules->{$source_ext}
-        && exists $suffix_rules->{$source_ext}{$obj})
+  while (!$extension_map{$source_ext} && $source_ext ne $obj)
     {
-      $source_ext = $suffix_rules->{$source_ext}{$obj}[0];
+      my $new_source_ext = next_in_suffix_chain ($source_ext, $obj);
+      last if not defined $new_source_ext;
+      $source_ext = $new_source_ext;
     }
 
   return $source_ext;