Merge branch 'micro' into maint
[platform/upstream/automake.git] / bin / automake.in
index 3614b6b..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']);
 
@@ -1148,7 +1149,7 @@ sub handle_silent ()
 ################################################################
 
 
-# Handle AUTOMAKE_OPTIONS variable.  Return 1 on error, 0 otherwise.
+# Handle AUTOMAKE_OPTIONS variable.  Return 0 on error, 1 otherwise.
 sub handle_options ()
 {
   my $var = var ('AUTOMAKE_OPTIONS');
@@ -1162,7 +1163,7 @@ sub handle_options ()
       my @options = map { { option => $_->[1], where => $_->[0] } }
                        $var->value_as_list_recursive (cond_filter => TRUE,
                                                       location => 1);
-      return 1 if process_option_list (@options);
+      return 0 unless process_option_list (@options);
     }
 
   if ($strictness == GNITS)
@@ -1172,7 +1173,7 @@ sub handle_options ()
       set_option ('check-news', INTERNAL);
     }
 
-  return 0;
+  return 1;
 }
 
 # shadow_unconditionally ($varname, $where)
@@ -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
@@ -5280,7 +5272,7 @@ EOF
            {
              my @opts = split (' ', $args[1]);
              @opts = map { { option => $_, where => $where } } @opts;
-             exit $exit_code if process_global_option_list (@opts);
+             exit $exit_code unless process_global_option_list (@opts);
            }
        }
       elsif ($macro eq 'AM_MAINTAINER_MODE')
@@ -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;
@@ -7731,7 +7722,7 @@ sub generate_makefile
   $relative_dir = dirname ($makefile);
 
   read_main_am_file ($makefile_am, $makefile_in);
-  if (handle_options)
+  if (not handle_options)
     {
       # Process buffered warnings.
       flush_messages;