Merge branch 'maint'
[platform/upstream/automake.git] / automake.in
index e32b761..4858a39 100644 (file)
@@ -362,6 +362,9 @@ my $ac_gettext_location;
 # Whether AM_GNU_GETTEXT_INTL_SUBDIR has been seen.
 my $seen_gettext_intl = 0;
 
+# The arguments of the AM_EXTRA_RECURSIVE_TARGETS call (if any).
+my @extra_recursive_targets = ();
+
 # Lists of tags supported by Libtool.
 my %libtool_tags = ();
 # 1 if Libtool uses LT_SUPPORTED_TAG.  If it does, then it also
@@ -1118,11 +1121,11 @@ sub backname ($)
 
 ################################################################
 
-# 'silent-rules' mode handling functions.
+# Silent rules handling functions.
 
 # verbose_var (NAME)
 # ------------------
-# The public variable stem used to implement 'silent-rules'.
+# The public variable stem used to implement silent rules.
 sub verbose_var ($)
 {
     my ($name) = @_;
@@ -1131,7 +1134,7 @@ sub verbose_var ($)
 
 # verbose_private_var (NAME)
 # --------------------------
-# The naming policy for the private variables for 'silent-rules'.
+# The naming policy for the private variables for silent rules.
 sub verbose_private_var ($)
 {
     my ($name) = @_;
@@ -1140,9 +1143,9 @@ sub verbose_private_var ($)
 
 # define_verbose_var (NAME, VAL-IF-SILENT, [VAL-IF-VERBOSE])
 # ----------------------------------------------------------
-# For 'silent-rules' mode, setup VAR and dispatcher, to expand to
-# VAL-IF-SILENT if silent, to VAL-IF-VERBOSE (defaulting to empty)
-# if not.
+# For  silent rules, setup VAR and dispatcher, to expand to
+# VAL-IF-SILENT if silent, to VAL-IF-VERBOSE (defaulting to
+# empty) if not.
 sub define_verbose_var ($$;$)
 {
     my ($name, $silent_val, $verbose_val) = @_;
@@ -1151,21 +1154,19 @@ sub define_verbose_var ($$;$)
     my $pvar = verbose_private_var ($name);
     my $silent_var = $pvar . '_0';
     my $verbose_var = $pvar . '_1';
-    if (option 'silent-rules')
-      {
-       # 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);
-        Automake::Variable::define ($silent_var, VAR_AUTOMAKE, '', TRUE,
-                                    $silent_val, '', INTERNAL, VAR_ASIS)
-         if (! vardef ($silent_var, TRUE));
-        Automake::Variable::define ($verbose_var, VAR_AUTOMAKE, '', TRUE,
-                                    $verbose_val, '', INTERNAL, VAR_ASIS)
-         if (! vardef ($verbose_var, TRUE));
-}
+    # 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);
+    Automake::Variable::define ($silent_var, VAR_AUTOMAKE, '', TRUE,
+                                $silent_val, '', INTERNAL, VAR_ASIS)
+      if (! vardef ($silent_var, TRUE));
+    Automake::Variable::define ($verbose_var, VAR_AUTOMAKE, '', TRUE,
+                                $verbose_val, '', INTERNAL, VAR_ASIS)
+      if (! vardef ($verbose_var, TRUE));
 }
 
 # Above should not be needed in the general automake code.
@@ -1176,17 +1177,13 @@ sub define_verbose_var ($$;$)
 sub verbose_flag ($)
 {
     my ($name) = @_;
-    return '$(' . verbose_var ($name) . ')'
-      if (option 'silent-rules');
-    return '';
+    return '$(' . verbose_var ($name) . ')';
 }
 
 sub verbose_nodep_flag ($)
 {
     my ($name) = @_;
-    return '$(' . verbose_var ($name) . subst ('am__nodep') . ')'
-      if (option 'silent-rules');
-    return '';
+    return '$(' . verbose_var ($name) . subst ('am__nodep') . ')';
 }
 
 # silent_flag
@@ -1199,19 +1196,16 @@ sub silent_flag ()
 
 # define_verbose_tagvar (NAME)
 # ----------------------------
-# Engage the needed 'silent-rules' machinery for tag NAME.
+# Engage the needed silent rules machinery for tag NAME.
 sub define_verbose_tagvar ($)
 {
     my ($name) = @_;
-    if (option 'silent-rules')
-      {
-       define_verbose_var ($name, '@echo "  '. $name . ' ' x (8 - length ($name)) . '" $@;');
-      }
+    define_verbose_var ($name, '@echo "  '. $name . ' ' x (8 - length ($name)) . '" $@;');
 }
 
 # define_verbose_texinfo
 # ----------------------
-# Engage the needed 'silent-rules' machinery for assorted texinfo commands.
+# Engage the needed silent rules machinery for assorted texinfo commands.
 sub define_verbose_texinfo ()
 {
   my @tagvars = ('DVIPS', 'MAKEINFO', 'INFOHTML', 'TEXI2DVI', 'TEXI2PDF');
@@ -1225,7 +1219,7 @@ sub define_verbose_texinfo ()
 
 # define_verbose_libtool
 # ----------------------
-# Engage the needed 'silent-rules' machinery for 'libtool --silent'.
+# Engage the needed silent rules machinery for 'libtool --silent'.
 sub define_verbose_libtool ()
 {
     define_verbose_var ('lt', '--silent');
@@ -1234,7 +1228,6 @@ sub define_verbose_libtool ()
 
 sub handle_silent ()
 {
-    return unless option 'silent-rules';
     # Define "$(AM_V_P)", expanding to a shell conditional that can be
     # used in make recipes to determine whether we are being run in
     # silent mode or not.  The choice of the name derives from the LISP
@@ -1242,7 +1235,7 @@ sub handle_silent ()
     # also "the '-P' convention" in the Jargon File); we do so for lack
     # of a better convention.
     define_verbose_var ('P', 'false', ':');
-    # *Always* provide the user with 'AM_V_GEN' for 'silent-rules' mode.
+    # *Always* provide the user with '$(AM_V_GEN)', unconditionally.
     define_verbose_tagvar ('GEN');
     define_verbose_var ('at', '@');
 }
@@ -1268,10 +1261,6 @@ sub handle_options
       return 1 if process_option_list (@options);
     }
 
-  # Override portability-recursive warning.
-  switch_warning ('no-portability-recursive')
-    if option 'silent-rules';
-
   if ($strictness == GNITS)
     {
       set_option ('readme-alpha', INTERNAL);
@@ -1335,7 +1324,7 @@ sub handle_languages
     {
        # Include auto-dep code.  Don't include it if DEP_FILES would
        # be empty.
-       if (&saw_sources_p (0) && keys %dep_files)
+       if (keys %extension_seen && keys %dep_files)
        {
            # Set location of depcomp.
            &define_variable ('depcomp',
@@ -2989,35 +2978,15 @@ sub handle_scripts
 ## Handling Texinfo files.  ##
 ## ------------------------ ##
 
-# ($OUTFILE, $VFILE, @CLEAN_FILES)
+# ($OUTFILE, $VFILE)
 # &scan_texinfo_file ($FILENAME)
 # ------------------------------
 # $OUTFILE     - name of the info file produced by $FILENAME.
 # $VFILE       - name of the version.texi file used (undef if none).
-# @CLEAN_FILES - list of byproducts (indexes etc.)
 sub scan_texinfo_file ($)
 {
   my ($filename) = @_;
 
-  # Some of the following extensions are always created, no matter
-  # whether indexes are used or not.  Other (like cps, fns, ... pgs)
-  # are only created when they are used.  We used to scan $FILENAME
-  # for their use, but that is not enough: they could be used in
-  # included files.  We can't scan included files because we don't
-  # know the include path.  Therefore we always erase these files, no
-  # matter whether they are used or not.
-  #
-  # (tmp is only created if an @macro is used and a certain e-TeX
-  # feature is not available.)
-  my %clean_suffixes =
-    map { $_ => 1 } (qw(aux log toc tmp
-                       cp cps
-                       fn fns
-                       ky kys
-                       vr vrs
-                       tp tps
-                       pg pgs)); # grep 'new.*index' texinfo.tex
-
   my $texi = new Automake::XFile "< $filename";
   verb "reading $filename";
 
@@ -3045,23 +3014,6 @@ sub scan_texinfo_file ($)
        {
          $vfile = $1;
        }
-
-      # Try to find new or unused indexes.
-
-      # Creating a new category of index.
-      elsif (/^\@def(code)?index (\w+)/)
-       {
-         $clean_suffixes{$2} = 1;
-         $clean_suffixes{"$2s"} = 1;
-       }
-
-      # Merging an index into an another.
-      elsif (/^\@syn(code)?index (\w+) (\w+)/)
-       {
-         delete $clean_suffixes{"$2s"};
-         $clean_suffixes{"$3s"} = 1;
-       }
-
     }
 
   if (! $outfile)
@@ -3072,8 +3024,7 @@ sub scan_texinfo_file ($)
 
   my $infobase = basename ($filename);
   $infobase =~ s/\.te?xi(nfo)?$//;
-  return ($outfile, $vfile,
-         map { "$infobase.$_" } (sort keys %clean_suffixes));
+  return ($outfile, $vfile);
 }
 
 
@@ -3213,10 +3164,13 @@ sub handle_texinfo_helper ($)
 
       # If 'version.texi' is referenced by input file, then include
       # automatic versioning capability.
-      my ($out_file, $vtexi, @clean_files) =
+      my ($out_file, $vtexi) =
        scan_texinfo_file ("$relative_dir/$texi")
        or next;
-      push (@mostly_cleans, @clean_files);
+      # Directory of auxiliary files and build by-products used by texi2dvi
+      # and texi2pdf.
+      push @mostly_cleans, "$infobase.t2d";
+      push @mostly_cleans, "$infobase.t2p";
 
       # If the Texinfo source is in a subdirectory, create the
       # resulting info in this subdirectory.  If it is in the current
@@ -3404,11 +3358,6 @@ sub handle_texinfo_helper ($)
       $texinfodir = ('$(srcdir)/'
                     . dirname (variable_value ('TEXINFO_TEX')));
     }
-  elsif (option 'cygnus')
-    {
-      $texinfodir = '$(top_srcdir)/../texinfo';
-      define_variable ('TEXINFO_TEX', "$texinfodir/texinfo.tex", INTERNAL);
-    }
   elsif ($config_aux_dir_set_in_configure_ac)
     {
       $texinfodir = $am_config_aux_dir;
@@ -3647,6 +3596,23 @@ sub handle_data
 # Handle TAGS.
 sub handle_tags
 {
+    my @config;
+    foreach my $spec (@config_headers)
+      {
+        my ($out, @ins) = split_config_file_spec ($spec);
+       foreach my $in (@ins)
+         {
+            # If the config header source is in this directory,
+           # require it.
+           push @config, basename ($in)
+              if $relative_dir eq dirname ($in);
+          }
+      }
+
+    define_variable ('am__tagged_files',
+                     '$(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)'
+                     . "@config", INTERNAL);
+
     my @tag_deps = ();
     my @ctag_deps = ();
     my @cscope_deps = ();
@@ -3686,25 +3652,11 @@ sub handle_tags
        &depend ('.MAKE', 'cscopelist-recursive');
     }
 
-    if (&saw_sources_p (1)
-       || var ('ETAGS_ARGS')
-       || @tag_deps)
+    if (rvar('am__tagged_files')->value_as_list_recursive
+          || var ('ETAGS_ARGS') || @tag_deps)
     {
-       my @config;
-       foreach my $spec (@config_headers)
-       {
-           my ($out, @ins) = split_config_file_spec ($spec);
-           foreach my $in (@ins)
-             {
-               # If the config header source is in this directory,
-               # require it.
-               push @config, basename ($in)
-                 if $relative_dir eq dirname ($in);
-             }
-       }
        $output_rules .= &file_contents ('tags',
                                         new Automake::Location,
-                                        CONFIG    => "@config",
                                         TAGSDIRS  => "@tag_deps",
                                         CTAGSDIRS => "@ctag_deps",
                                         CSCOPEDIRS => "@cscope_deps");
@@ -3754,26 +3706,6 @@ sub user_phony_rule ($)
 }
 
 
-# $BOOLEAN
-# &for_dist_common ($A, $B)
-# -------------------------
-# Subroutine for &handle_dist: sort files to dist.
-#
-# We put README first because it then becomes easier to make a
-# Usenet-compliant shar file (in these, README must be first).
-#
-# FIXME: do more ordering of files here.
-sub for_dist_common
-{
-    return 0
-       if $a eq $b;
-    return -1
-       if $a eq 'README';
-    return 1
-       if $b eq 'README';
-    return $a cmp $b;
-}
-
 # handle_dist
 # -----------
 # Handle 'dist' target.
@@ -3884,7 +3816,7 @@ sub handle_dist ()
   # Files to distributed.  Don't use ->value_as_list_recursive
   # as it recursively expands '$(dist_pkgdata_DATA)' etc.
   my @dist_common = split (' ', rvar ('DIST_COMMON')->variable_value);
-  @dist_common = uniq (sort for_dist_common (@dist_common));
+  @dist_common = uniq @dist_common;
   variable_delete 'DIST_COMMON';
   define_pretty_variable ('DIST_COMMON', TRUE, INTERNAL, @dist_common);
 
@@ -4153,8 +4085,8 @@ sub handle_configure ($$$@)
   define_pretty_variable ('am__configure_deps', TRUE, INTERNAL,
                          @configuredeps);
 
-  my $automake_options = '--' . (global_option 'cygnus' ? 'cygnus' : $strictness_name)
-                        (global_option 'no-dependencies' ? ' --ignore-deps' : '');
+  my $automake_options = '--' . $strictness_name .
+                        (global_option 'no-dependencies' ? ' --ignore-deps' : '');
 
   $output_rules .= file_contents
     ('configure',
@@ -4617,6 +4549,32 @@ sub handle_all ($)
       }
 }
 
+# Generate helper targets for user recursion, where needed.
+sub handle_user_recursion ()
+{
+  return unless @extra_recursive_targets;
+
+  define_pretty_variable ('am__extra_recursive_targets', TRUE, INTERNAL,
+                          map { "$_-recursive" } @extra_recursive_targets);
+  my $aux = var ('SUBDIRS') ? 'recursive' : 'am';
+  foreach my $target (@extra_recursive_targets)
+    {
+      # This allows the default target's rules to be overridden in
+      # Makefile.am.
+      user_phony_rule ($target);
+      depend ("$target", "$target-$aux");
+      depend ("$target-am", "$target-local");
+      # Every user-defined recursive target 'foo' *must* have a valid
+      # associated 'foo-local' rule; we define it as an empty rule by
+      # default, so that the user can transparently extend it in his
+      # own Makefile.am.
+      pretty_print_rule ("$target-local:");
+      # $target-recursive might as well be undefined, so do not add
+      # it here; it's taken care of in subdirs.am anyway.
+      depend (".PHONY", "$target-am", "$target-local");
+    }
+}
+
 
 # &do_check_merge_target ()
 # -------------------------
@@ -4627,25 +4585,16 @@ sub do_check_merge_target ()
   push @check_tests, 'check-local'
     if user_phony_rule 'check-local';
 
-  # In --cygnus mode, check doesn't depend on all.
-  if (option 'cygnus')
-    {
-      # Just run the local check rules.
-      pretty_print_rule ('check-am:', "\t\t", @check);
-    }
-  else
+  # The check target must depend on the local equivalent of
+  # 'all', to ensure all the primary targets are built.  Then it
+  # must build the local check rules.
+  $output_rules .= "check-am: all-am\n";
+  if (@check)
     {
-      # The check target must depend on the local equivalent of
-      # 'all', to ensure all the primary targets are built.  Then it
-      # must build the local check rules.
-      $output_rules .= "check-am: all-am\n";
-      if (@check)
-        {
-         pretty_print_rule ("\t\$(MAKE) \$(AM_MAKEFLAGS)", "\t  ",
-                            @check);
-         depend ('.MAKE', 'check-am');
-       }
+      pretty_print_rule ("\t\$(MAKE) \$(AM_MAKEFLAGS)", "\t  ", @check);
+      depend ('.MAKE', 'check-am');
     }
+
   if (@check_tests)
     {
       pretty_print_rule ("\t\$(MAKE) \$(AM_MAKEFLAGS)", "\t  ",
@@ -4836,9 +4785,7 @@ sub handle_tests_dejagnu
 sub handle_per_suffix_test
 {
   my ($test_suffix, %transform) = @_;
-  my ($pfx, $generic, $parallel_tests_option, $am_exeext);
-  prog_error ("called with 'parallel-tests' option not set")
-    unless $parallel_tests_option = option 'parallel-tests';
+  my ($pfx, $generic, $am_exeext);
   if ($test_suffix eq '')
     {
       $pfx = '';
@@ -4855,13 +4802,12 @@ sub handle_per_suffix_test
                                                     : 'FALSE';
     }
   # The "test driver" program, deputed to handle tests protocol used by
-  # test scripts.  By default, it's assumed that no protocol is used,
-  # so we fall back to the old "parallel-tests" behaviour, implemented
-  # by the 'test-driver' auxiliary script.
+  # test scripts.  By default, it's assumed that no protocol is used, so
+  # we fall back to the old behaviour, implemented by the 'test-driver'
+  # auxiliary script.
   if (! var "${pfx}LOG_DRIVER")
     {
-      require_conf_file ($parallel_tests_option->{position}, FOREIGN,
-                        'test-driver');
+      require_conf_file ("parallel-tests", FOREIGN, 'test-driver');
       define_variable ("${pfx}LOG_DRIVER",
                        "\$(SHELL) $am_config_aux_dir/test-driver",
                        INTERNAL);
@@ -4921,7 +4867,7 @@ sub handle_tests
       my $check_deps = "@check";
       $output_rules .= &file_contents ('check', new Automake::Location,
                                       COLOR => !! option 'color-tests',
-                                      PARALLEL_TESTS => !! option 'parallel-tests',
+                                      SERIAL_TESTS => !! option 'serial-tests',
                                        CHECK_DEPS => $check_deps);
 
       # Tests that are known programs should have $(EXEEXT) appended.
@@ -4930,7 +4876,7 @@ sub handle_tests
       append_exeext { exists $known_programs{$_[0]} } 'XFAIL_TESTS'
        if (var ('XFAIL_TESTS'));
 
-      if (my $parallel_tests = option 'parallel-tests')
+      if (! option 'serial-tests')
         {
          define_variable ('TEST_SUITE_LOG', 'test-suite.log', INTERNAL);
          my $suff = '.test';
@@ -4980,7 +4926,7 @@ sub handle_tests
                if ($val =~ /(\$\((top_)?srcdir\))\//o)
                  {
                    msg ('error', $subvar->rdef ($cond)->location,
-                        "parallel-tests: using '$1' in TESTS is currently broken: '$val'");
+                        "using '$1' in TESTS is currently broken: '$val'");
                  }
 
                foreach my $test_suffix (@test_suffixes)
@@ -5245,15 +5191,14 @@ sub scan_autoconf_traces ($)
                AC_REQUIRE_AUX_FILE => 1,
                AC_SUBST_TRACE => 1,
                AM_AUTOMAKE_VERSION => 1,
-                AM_PROG_MKDIR_P => 0, # FIXME: to be removed in 1.13
                AM_CONDITIONAL => 2,
+               _AM_EXTRA_RECURSIVE_TARGETS => 1,
                AM_GNU_GETTEXT => 0,
                AM_GNU_GETTEXT_INTL_SUBDIR => 0,
                AM_INIT_AUTOMAKE => 0,
                AM_MAINTAINER_MODE => 0,
                AM_PROG_AR => 0,
                AM_PROG_CC_C_O => 0,
-               AM_SILENT_RULES => 0,
                _AM_SUBST_NOTMAKE => 1,
                _AM_COND_IF => 1,
                _AM_COND_ELSE => 1,
@@ -5404,18 +5349,14 @@ sub scan_autoconf_traces ($)
 
          $seen_automake_version = 1;
        }
-      elsif ($macro eq 'AM_PROG_MKDIR_P') # FIXME: to be removed in 1.13
-       {
-         msg 'obsolete', $where, <<'EOF';
-The 'AM_PROG_MKDIR_P' macro is deprecated, and will soon be removed.
-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
-       }
       elsif ($macro eq 'AM_CONDITIONAL')
        {
          $configure_cond{$args[1]} = $where;
        }
+      elsif ($macro eq '_AM_EXTRA_RECURSIVE_TARGETS')
+       {
+         push @extra_recursive_targets, split (' ', $args[1]);
+       }
       elsif ($macro eq 'AM_GNU_GETTEXT')
        {
          $seen_gettext = $where;
@@ -5457,10 +5398,6 @@ EOF
        {
          $seen_cc_c_o = $where;
        }
-      elsif ($macro eq 'AM_SILENT_RULES')
-        {
-         set_global_option ('silent-rules', $where);
-       }
       elsif ($macro eq '_AM_COND_IF')
         {
          cond_stack_if ('', $args[1], $where);
@@ -5617,26 +5554,6 @@ sub scan_autoconf_files ()
 
 ################################################################
 
-# Set up for Cygnus mode.
-sub check_cygnus
-{
-  my $cygnus = option 'cygnus';
-  return unless $cygnus;
-
-  # This feature is deprecated, will be removed in the next
-  # Automake major release.
-  msg 'obsolete', $cygnus->get,
-      "support for Cygnus-style trees is deprecated";
-
-  set_strictness ('foreign');
-  set_option ('no-installinfo', $cygnus);
-  set_option ('no-dependencies', $cygnus);
-  set_option ('no-dist', $cygnus);
-
-  err_ac "'AM_MAINTAINER_MODE' required when --cygnus specified"
-    if !$seen_maint_mode;
-}
-
 # Do any extra checking for GNU standards.
 sub check_gnu_standards
 {
@@ -6131,76 +6048,9 @@ sub resolve_linker
 sub saw_extension
 {
     my ($ext) = @_;
-    if (! defined $extension_seen{$ext})
-    {
-       $extension_seen{$ext} = 1;
-    }
-    else
-    {
-       ++$extension_seen{$ext};
-    }
+    $extension_seen{$ext} = 1;
 }
 
-# Return the number of files seen for a given language.  Knows about
-# special cases we care about.  FIXME: this is hideous.  We need
-# something that involves real language objects.  For instance yacc
-# and yaccxx could both derive from a common yacc class which would
-# know about the strange ylwrap requirement.  (Or better yet we could
-# just not support legacy yacc!)
-sub count_files_for_language
-{
-    my ($name) = @_;
-
-    my @names;
-    if ($name eq 'yacc' || $name eq 'yaccxx')
-    {
-       @names = ('yacc', 'yaccxx');
-    }
-    elsif ($name eq 'lex' || $name eq 'lexxx')
-    {
-       @names = ('lex', 'lexxx');
-    }
-    else
-    {
-       @names = ($name);
-    }
-
-    my $r = 0;
-    foreach $name (@names)
-    {
-       my $lang = $languages{$name};
-       foreach my $ext (@{$lang->extensions})
-       {
-           $r += $extension_seen{$ext}
-               if defined $extension_seen{$ext};
-       }
-    }
-
-    return $r
-}
-
-# Called to ask whether source files have been seen . If HEADERS is 1,
-# headers can be included.
-sub saw_sources_p
-{
-    my ($headers) = @_;
-
-    # count all the sources
-    my $count = 0;
-    foreach my $val (values %extension_seen)
-    {
-       $count += $val;
-    }
-
-    if (!$headers)
-    {
-       $count -= count_files_for_language ('header');
-    }
-
-    return $count > 0;
-}
-
-
 # register_language (%ATTRIBUTE)
 # ------------------------------
 # Register a single language.
@@ -6966,8 +6816,6 @@ sub transform_token ($$$)
 #   - replaces %KEY% with $VAL,
 #   - enables/disables ?KEY? and ?!KEY?,
 #   - replaces %?KEY% with TRUE or FALSE.
-#   - replaces %KEY?IFTRUE%, %KEY:IFFALSE%, and %KEY?IFTRUE:IFFALSE% with
-#     IFTRUE / IFFALSE, as appropriate.
 sub transform ($$)
 {
   my ($token, $transform) = @_;
@@ -6979,11 +6827,6 @@ sub transform ($$)
     {
       return transform_token ($token, $transform, $1);
     }
-  # %KEY?IFTRUE%, %KEY:IFFALSE%, and %KEY?IFTRUE:IFFALSE%.
-  elsif ($token =~ /^%([\w\-]+)(?:\?([^?:%]+))?(?::([^?:%]+))?%$/)
-    {
-      return transform_token ($token, $transform, $1) ? ($2 || '') : ($3 || '');
-    }
   # %?KEY%.
   elsif ($token =~ /^%\?([\w\-]+)%$/)
     {
@@ -7014,8 +6857,7 @@ sub preprocess_file ($%)
 
   # Complete %transform with global options.
   # Note that %transform goes last, so it overrides global options.
-  %transform = ('CYGNUS'      => !! option 'cygnus',
-                'MAINTAINER-MODE'
+  %transform = ( 'MAINTAINER-MODE'
                 => $seen_maint_mode ? subst ('MAINTAINER_MODE_TRUE') : '',
 
                 'XZ'          => !! option 'dist-xz',
@@ -7062,7 +6904,6 @@ sub preprocess_file ($%)
 
   # Substitute Automake template tokens.
   s/(?: % \?? [\w\-]+ %
-      | % [\w\-]+ (?:\?[^?:%]+)? (?::[^?:%]+)? %
       | \? !? [\w\-]+ \?
     )/transform($&, \%transform)/gex;
   # transform() may have added some ##%-comments to strip.
@@ -8157,7 +7998,6 @@ sub generate_makefile ($$)
     if var 'DIST_SUBDIRS' && ! var 'SUBDIRS';
 
   # Check first, because we might modify some state.
-  check_cygnus;
   check_gnu_standards;
   check_gnits_standards;
 
@@ -8192,6 +8032,7 @@ sub generate_makefile ($$)
   handle_data;
   handle_headers;
   handle_subdirs;
+  handle_user_recursion;
   handle_tags;
   handle_minor_options;
   # Must come after handle_programs so that %known_programs is up-to-date.
@@ -8341,7 +8182,6 @@ Dependency tracking:
       --include-deps     enable dependency tracking code
 
 Flavors:
-      --cygnus           assume program is part of Cygnus-style tree
       --foreign          set strictness to foreign
       --gnits            set strictness to gnits
       --gnu              set strictness to gnu
@@ -8399,7 +8239,6 @@ EOF
 sub parse_arguments ()
 {
   my $strict = 'gnu';
-  my $cygnus = 0;
   my $ignore_deps = 0;
   my @warnings = ();
 
@@ -8412,7 +8251,6 @@ sub parse_arguments ()
      'gnu'             => sub { $strict = 'gnu'; },
      'gnits'           => sub { $strict = 'gnits'; },
      'foreign'         => sub { $strict = 'foreign'; },
-     'cygnus'          => \$cygnus,
      'include-deps'    => sub { $ignore_deps = 0; },
      'i|ignore-deps'   => sub { $ignore_deps = 1; },
      'no-force'        => sub { $force_generation = 0; },
@@ -8428,7 +8266,6 @@ sub parse_arguments ()
 
   set_strictness ($strict);
   my $cli_where = new Automake::Location;
-  set_global_option ('cygnus', $cli_where) if $cygnus;
   set_global_option ('no-dependencies', $cli_where) if $ignore_deps;
   for my $warning (@warnings)
     {