X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=automake.in;h=7a863cf19842fc2bb72575812b427b3e643ef81a;hb=1c48cbe0bbe270de3a899acfcf83bc7e6b671147;hp=b67deca29475672724daf278b67f81e879f25a6a;hpb=4de5cb063668bce6690d7ff1f0af6e46616836a5;p=platform%2Fupstream%2Fautomake.git diff --git a/automake.in b/automake.in index b67deca..7a863cf 100644 --- a/automake.in +++ b/automake.in @@ -6,7 +6,7 @@ eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac' if 0; # automake - create Makefile.in from Makefile.am -# Copyright (C) 1994-2012 Free Software Foundation, Inc. +# Copyright (C) 1994-2013 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 @@ -29,8 +29,9 @@ package Language; BEGIN { - my $perllibdir = $ENV{'perllibdir'} || '@datadir@/@PACKAGE@-@APIVERSION@'; - unshift @INC, (split '@PATH_SEPARATOR@', $perllibdir); + @Automake::perl_libdirs = ('@datadir@/@PACKAGE@-@APIVERSION@') + unless @Automake::perl_libdirs; + unshift @INC, @Automake::perl_libdirs; # Override SHELL. This is required on DJGPP so that system() uses # bash, not COMMAND.COM which doesn't quote arguments properly. @@ -231,7 +232,7 @@ my @common_files = (qw(ABOUT-GNU ABOUT-NLS AUTHORS BACKLOG COPYING COPYING.DOC COPYING.LIB COPYING.LESSER ChangeLog INSTALL NEWS README THANKS TODO ar-lib compile config.guess config.rpath - config.sub depcomp elisp-comp install-sh libversion.in mdate-sh + config.sub depcomp install-sh libversion.in mdate-sh missing mkinstalldirs py-compile texinfo.tex ylwrap), @libtool_files, @libtool_sometimes); @@ -362,6 +363,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 @@ -370,8 +374,6 @@ my $libtool_new_api = 0; # Most important AC_CANONICAL_* macro seen so far. my $seen_canonical = 0; -# Location of that macro. -my $canonical_location; # Where AM_MAINTAINER_MODE appears. my $seen_maint_mode; @@ -461,9 +463,11 @@ my %required_targets = 'install-ps-am' => 1, 'install-info-am' => 1, 'installcheck-am' => 1, - 'uninstall-am' => 1, - - 'install-man' => 1, + 'uninstall-am' => 1, + 'tags-am' => 1, + 'ctags-am' => 1, + 'cscopelist-am' => 1, + 'install-man' => 1, ); # Queue to push require_conf_file requirements to. @@ -478,17 +482,9 @@ my $am_file = 'BUG'; ## Variables reset by &initialize_per_input. ## ## ------------------------------------------ ## -# Basename and relative dir of the input file. -my $am_file_name; -my $am_relative_dir; - -# Same but wrt Makefile.in. -my $in_file_name; +# Relative dir of the output makefile. my $relative_dir; -# Relative path to the top directory. -my $topsrcdir; - # Greatest timestamp of the output's dependencies (excluding # configure's dependencies). my $output_deps_greatest_timestamp; @@ -637,12 +633,7 @@ sub initialize_per_input () { reset_local_duplicates (); - $am_file_name = undef; - $am_relative_dir = undef; - - $in_file_name = undef; $relative_dir = undef; - $topsrcdir = undef; $output_deps_greatest_timestamp = 0; @@ -1138,15 +1129,19 @@ sub verbose_private_var ($) return 'am__v_' . $name; } -# define_verbose_var (NAME, VAL) -# ------------------------------ -# For silent rules, setup VAR and dispatcher, to expand to VAL if silent. -sub define_verbose_var ($$) +# define_verbose_var (NAME, VAL-IF-SILENT, [VAL-IF-VERBOSE]) +# ---------------------------------------------------------- +# 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, $val) = @_; + my ($name, $silent_val, $verbose_val) = @_; + $verbose_val = '' unless defined $verbose_val; my $var = verbose_var ($name); my $pvar = verbose_private_var ($name); my $silent_var = $pvar . '_0'; + my $verbose_var = $pvar . '_1'; # 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. @@ -1154,9 +1149,12 @@ sub define_verbose_var ($$) define_variable ($var, '$(' . $pvar . '_@'.'AM_V'.'@)', INTERNAL); define_variable ($pvar . '_', '$(' . $pvar . '_@'.'AM_DEFAULT_V'.'@)', INTERNAL); - Automake::Variable::define ($silent_var, VAR_AUTOMAKE, '', TRUE, $val, - '', INTERNAL, VAR_ASIS) + 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. @@ -1191,7 +1189,6 @@ sub define_verbose_tagvar ($) { my ($name) = @_; define_verbose_var ($name, '@echo " '. $name . ' ' x (8 - length ($name)) . '" $@;'); - define_verbose_var ('at', '@'); } # define_verbose_texinfo @@ -1217,6 +1214,20 @@ sub define_verbose_libtool () return verbose_flag ('lt'); } +sub handle_silent () +{ + # 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 + # convention of appending the letter 'P' to denote a predicate (see + # 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)', unconditionally. + define_verbose_tagvar ('GEN'); + define_verbose_var ('at', '@'); +} + ################################################################ @@ -1570,9 +1581,6 @@ sub handle_languages unless defined $done{$languages{'c'}}; define_linker_variable ($languages{'c'}); } - - # Always provide the user with 'AM_V_GEN' for silent rules. - define_verbose_tagvar ('GEN'); } @@ -1733,6 +1741,7 @@ sub handle_single_transform ($$$$$%) # generates another source file which we must then process # further. my $subr = \&{'lang_' . $lang->name . '_rewrite'}; + defined &$subr or $subr = \&lang_sub_obj; my ($r, $source_extension) = &$subr ($directory, $base, $extension, $obj, $have_per_exec_flags, $var); @@ -2122,6 +2131,7 @@ sub handle_source_transform ($$$$%) msg_var ('unsupported', $ext_var, $ext_var->name . " can assume at most one value") if $default_source_ext =~ /[\t ]/; (my $default_source = $unxformed) =~ s,(\.[^./\\]*)?$,$default_source_ext,; + # TODO: Remove this backward-compatibility hack in Automake 1.14. if ($old_default_source ne $default_source && !$ext_var && (rule $old_default_source @@ -2280,8 +2290,10 @@ sub handle_LIBOBJS_or_ALLOCA ($) # we are already there, and since the targets are built without # a $(top_builddir), it helps BSD Make to match them with # dependencies. - $dir = "$config_libobj_dir/" if $config_libobj_dir ne '.'; - $dir = "$topsrcdir/$dir" if $relative_dir ne '.'; + $dir = "$config_libobj_dir/" + if $config_libobj_dir ne '.'; + $dir = backname ($relative_dir) . "/$dir" + if $relative_dir ne '.'; define_variable ('LIBOBJDIR', "$dir", INTERNAL); $clean_files{"\$($var)"} = MOSTLY_CLEAN; # If LTLIBOBJS is used, we must also clear LIBOBJS (which might @@ -2525,8 +2537,8 @@ sub handle_programs my($xlink, $vlink) = &define_per_target_linker_variable ($linker, $xname); $vlink = verbose_flag ($vlink || 'GEN'); - # If the resulting program lies into a subdirectory, - # make sure this directory will exist. + # If the resulting program lies in a subdirectory, + # ensure that the directory exists before we need it. my $dirstamp = require_build_directory_maybe ($one_file); $libtool_clean_directories{dirname ($one_file)} = 1; @@ -2636,7 +2648,7 @@ sub handle_libraries &handle_source_transform ($xlib, $onelib, $obj, $where, NONLIBTOOL => 1, LIBTOOL => 0); - # If the resulting library lies into a subdirectory, + # If the resulting library lies in a subdirectory, # make sure this directory will exist. my $dirstamp = require_build_directory_maybe ($onelib); my $verbose = verbose_flag ('AR'); @@ -2880,7 +2892,7 @@ sub handle_ltlibraries } } - # If the resulting library lies into a subdirectory, + # If the resulting library lies in a subdirectory, # make sure this directory will exist. my $dirstamp = require_build_directory_maybe ($onelib); @@ -2958,35 +2970,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"; @@ -3001,7 +2993,12 @@ sub scan_texinfo_file ($) next if $outfile; $outfile = $1; - if ($outfile =~ /\.([^.]+)$/ && $1 ne 'info') + if (index ($outfile, '.') < 0) + { + msg 'obsolete', "$filename:$.", + "use of suffix-less info files is discouraged" + } + elsif ($outfile !~ /\.info$/) { error ("$filename:$.", "output '$outfile' has unrecognized extension"); @@ -3014,23 +3011,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) @@ -3039,10 +3019,7 @@ sub scan_texinfo_file ($) return; } - my $infobase = basename ($filename); - $infobase =~ s/\.te?xi(nfo)?$//; - return ($outfile, $vfile, - map { "$infobase.$_" } (sort keys %clean_suffixes)); + return ($outfile, $vfile); } @@ -3110,7 +3087,7 @@ sub output_texinfo_build_rules ($$$@) # extension). my $generic_info = ($generic && $dsfx) ? 1 : 0; - # If the resulting file lie into a subdirectory, + # If the resulting file lies in a subdirectory, # make sure this directory will exist. my $dirstamp = require_build_directory_maybe ($dest); @@ -3169,9 +3146,17 @@ sub handle_texinfo_helper ($) ($info_texinfos->value_as_list_recursive (inner_expand => 1)) { my $infobase = $texi; - $infobase =~ s/\.(txi|texinfo|texi)$//; - - if ($infobase eq $texi) + if ($infobase =~ s/\.texi$//) + { + 1; # Nothing more to do. + } + elsif ($infobase =~ s/\.(txi|texinfo)$//) + { + msg_var 'obsolete', $info_texinfos, + "suffix '.$1' for Texinfo files is discouraged;" . + " use '.texi' instead"; + } + else { # FIXME: report line number. err_am "texinfo file '$texi' has unrecognized extension"; @@ -3182,10 +3167,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 @@ -3628,71 +3616,26 @@ sub handle_tags '$(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)' . "@config", INTERNAL); - my @tag_deps = (); - my @ctag_deps = (); - my @cscope_deps = (); - if (var ('SUBDIRS')) - { - $output_rules .= ("tags-recursive:\n" - . "\tlist='\$(SUBDIRS)'; for subdir in \$\$list; do \\\n" - # Never fail here if a subdir fails; it - # isn't important. - . "\t test \"\$\$subdir\" = . || (\$(am__cd) \$\$subdir" - . " && \$(MAKE) \$(AM_MAKEFLAGS) tags); \\\n" - . "\tdone\n"); - push (@tag_deps, 'tags-recursive'); - &depend ('.PHONY', 'tags-recursive'); - &depend ('.MAKE', 'tags-recursive'); - - $output_rules .= ("ctags-recursive:\n" - . "\tlist='\$(SUBDIRS)'; for subdir in \$\$list; do \\\n" - # Never fail here if a subdir fails; it - # isn't important. - . "\t test \"\$\$subdir\" = . || (\$(am__cd) \$\$subdir" - . " && \$(MAKE) \$(AM_MAKEFLAGS) ctags); \\\n" - . "\tdone\n"); - push (@ctag_deps, 'ctags-recursive'); - &depend ('.PHONY', 'ctags-recursive'); - &depend ('.MAKE', 'ctags-recursive'); - - $output_rules .= ("cscopelist-recursive:\n" - . "\tlist='\$(SUBDIRS)'; for subdir in \$\$list; do \\\n" - # Never fail here if a subdir fails; it - # isn't important. - . "\t test \"\$\$subdir\" = . || (\$(am__cd) \$\$subdir" - . " && \$(MAKE) \$(AM_MAKEFLAGS) cscopelist); \\\n" - . "\tdone\n"); - push (@cscope_deps, 'cscopelist-recursive'); - &depend ('.PHONY', 'cscopelist-recursive'); - &depend ('.MAKE', 'cscopelist-recursive'); - } - if (rvar('am__tagged_files')->value_as_list_recursive - || var ('ETAGS_ARGS') || @tag_deps) - { - $output_rules .= &file_contents ('tags', - new Automake::Location, - TAGSDIRS => "@tag_deps", - CTAGSDIRS => "@ctag_deps", - CSCOPEDIRS => "@cscope_deps"); - + || var ('ETAGS_ARGS') || var ('SUBDIRS')) + { + $output_rules .= &file_contents ('tags', new Automake::Location); set_seen 'TAGS_DEPENDENCIES'; - } - elsif (reject_var ('TAGS_DEPENDENCIES', - "it doesn't make sense to define 'TAGS_DEPENDENCIES'" - . " without\nsources or 'ETAGS_ARGS'")) - { - } + } else - { + { + reject_var ('TAGS_DEPENDENCIES', + "it doesn't make sense to define 'TAGS_DEPENDENCIES'" + . " without\nsources or 'ETAGS_ARGS'"); # Every Makefile must define some sort of TAGS rule. # Otherwise, it would be possible for a top-level "make TAGS" - # to fail because some subdirectory failed. - $output_rules .= "tags: TAGS\nTAGS:\n\n"; - # Ditto ctags and cscope. - $output_rules .= "ctags: CTAGS\nCTAGS:\n\n"; - $output_rules .= "cscope cscopelist:\n\n"; - } + # to fail because some subdirectory failed. Ditto ctags and + # cscope. + $output_rules .= + "tags TAGS:\n\n" . + "ctags CTAGS:\n\n" . + "cscope cscopelist:\n\n"; + } } @@ -3771,7 +3714,7 @@ sub handle_dist () { my $archive_defined = option 'no-dist-gzip' ? 0 : 1; $archive_defined ||= - grep { option "dist-$_" } qw(shar zip tarZ bzip2 lzip lzma xz); + grep { option "dist-$_" } qw(shar zip tarZ bzip2 lzip xz); error (option 'no-dist-gzip', "no-dist-gzip specified but no dist-* specified,\n" . "at least one archive format must be enabled") @@ -3839,12 +3782,6 @@ sub handle_dist () # to set it. $handle_dist_run = 1; - # Scan EXTRA_DIST to see if we need to distribute anything from a - # subdir. If so, add it to the list. I didn't want to do this - # originally, but there were so many requests that I finally - # relented. - my $extra_dist = var ('EXTRA_DIST'); - $transform{'DISTCHECK-HOOK'} = !! rule 'distcheck-hook'; $transform{'GETTEXT'} = $seen_gettext && !$seen_gettext_external; @@ -4190,6 +4127,7 @@ sub handle_configure ($$$@) file_contents ('remake-hdr', new Automake::Location, FILES => "@files", + 'FIRST-HDR' => ($hdr_index == 1), CONFIG_H => $cn_sans_dir, CONFIG_HIN => $ins[0], CONFIG_H_DEPS => "@ins", @@ -4208,6 +4146,9 @@ sub handle_configure ($$$@) # Distribute and define mkinstalldirs only if it is already present # in the package, for backward compatibility (some people may still # use $(mkinstalldirs)). + # TODO: start warning about this in Automake 1.13.2, and have + # TODO: Automake 1.14 or 1.15 drop it (and the mkinstalldirs script + # TODO: as well). my $mkidpath = "$config_aux_dir/mkinstalldirs"; if (-f $mkidpath) { @@ -4564,6 +4505,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 () # ------------------------- @@ -4855,7 +4822,6 @@ sub handle_tests push (@check_tests, 'check-TESTS'); my $check_deps = "@check"; $output_rules .= &file_contents ('check', new Automake::Location, - COLOR => !! option 'color-tests', SERIAL_TESTS => !! option 'serial-tests', CHECK_DEPS => $check_deps); @@ -4988,8 +4954,6 @@ sub handle_emacs_lisp require_variables ($elfiles[0][0], "Emacs Lisp sources seen", TRUE, 'EMACS', 'lispdir'); - require_conf_file ($elfiles[0][0], FOREIGN, 'elisp-comp'); - &define_variable ('elisp_comp', "$am_config_aux_dir/elisp-comp", INTERNAL); } # Handle Python @@ -5180,7 +5144,9 @@ 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.14 AM_CONDITIONAL => 2, + AM_EXTRA_RECURSIVE_TARGETS => 1, AM_GNU_GETTEXT => 0, AM_GNU_GETTEXT_INTL_SUBDIR => 0, AM_INIT_AUTOMAKE => 0, @@ -5235,7 +5201,6 @@ sub scan_autoconf_traces ($) if ($seen_canonical <= AC_CANONICAL_BUILD) { $seen_canonical = AC_CANONICAL_BUILD; - $canonical_location = $where; } } elsif ($macro eq 'AC_CANONICAL_HOST') @@ -5243,13 +5208,11 @@ sub scan_autoconf_traces ($) if ($seen_canonical <= AC_CANONICAL_HOST) { $seen_canonical = AC_CANONICAL_HOST; - $canonical_location = $where; } } elsif ($macro eq 'AC_CANONICAL_TARGET') { $seen_canonical = AC_CANONICAL_TARGET; - $canonical_location = $where; } elsif ($macro eq 'AC_CONFIG_AUX_DIR') { @@ -5337,10 +5300,25 @@ sub scan_autoconf_traces ($) $seen_automake_version = 1; } + elsif ($macro eq 'AM_PROG_MKDIR_P') # FIXME: to be removed in 1.14 + { + 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') + { + # Empty leading/trailing fields might be produced by split, + # hence the grep is really needed. + push @extra_recursive_targets, + grep (/./, (split /\s+/, $args[1])); + } elsif ($macro eq 'AM_GNU_GETTEXT') { $seen_gettext = $where; @@ -5641,12 +5619,6 @@ sub lang_c_rewrite return $r; } -# Rewrite a single C++ source file. -sub lang_cxx_rewrite -{ - return &lang_sub_obj; -} - # Rewrite a single header file. sub lang_header_rewrite { @@ -5663,7 +5635,7 @@ sub lang_vala_rewrite return (LANG_SUBDIR, $newext); } -# Rewrite a single yacc file. +# Rewrite a single yacc/yacc++ file. sub lang_yacc_rewrite { my ($directory, $base, $ext) = @_; @@ -5672,18 +5644,9 @@ sub lang_yacc_rewrite (my $newext = $ext) =~ tr/y/c/; return ($r, $newext); } +sub lang_yaccxx_rewrite { lang_yacc_rewrite (@_); }; -# Rewrite a single yacc++ file. -sub lang_yaccxx_rewrite -{ - my ($directory, $base, $ext) = @_; - - my $r = &lang_sub_obj; - (my $newext = $ext) =~ tr/y/c/; - return ($r, $newext); -} - -# Rewrite a single lex file. +# Rewrite a single lex/lex++ file. sub lang_lex_rewrite { my ($directory, $base, $ext) = @_; @@ -5692,76 +5655,7 @@ sub lang_lex_rewrite (my $newext = $ext) =~ tr/l/c/; return ($r, $newext); } - -# Rewrite a single lex++ file. -sub lang_lexxx_rewrite -{ - my ($directory, $base, $ext) = @_; - - my $r = &lang_sub_obj; - (my $newext = $ext) =~ tr/l/c/; - return ($r, $newext); -} - -# Rewrite a single assembly file. -sub lang_asm_rewrite -{ - return &lang_sub_obj; -} - -# Rewrite a single preprocessed assembly file. -sub lang_cppasm_rewrite -{ - return &lang_sub_obj; -} - -# Rewrite a single Fortran 77 file. -sub lang_f77_rewrite -{ - return &lang_sub_obj; -} - -# Rewrite a single Fortran file. -sub lang_fc_rewrite -{ - return &lang_sub_obj; -} - -# Rewrite a single preprocessed Fortran file. -sub lang_ppfc_rewrite -{ - return &lang_sub_obj; -} - -# Rewrite a single preprocessed Fortran 77 file. -sub lang_ppf77_rewrite -{ - return &lang_sub_obj; -} - -# Rewrite a single ratfor file. -sub lang_ratfor_rewrite -{ - return &lang_sub_obj; -} - -# Rewrite a single Objective C file. -sub lang_objc_rewrite -{ - return &lang_sub_obj; -} - -# Rewrite a single Objective C++ file. -sub lang_objcxx_rewrite -{ - return &lang_sub_obj; -} - -# Rewrite a single Unified Parallel C file. -sub lang_upc_rewrite -{ - return &lang_sub_obj; -} +sub lang_lexxx_rewrite { lang_lex_rewrite (@_); }; # Rewrite a single Java file. sub lang_java_rewrite @@ -6737,9 +6631,9 @@ sub define_standard_variables } # Read main am file. -sub read_main_am_file +sub read_main_am_file ($$) { - my ($amfile) = @_; + my ($amfile, $infile) = @_; # This supports the strange variable tricks we are about to play. prog_error ("variable defined before read_main_am_file\n" . variables_dump ()) @@ -6747,8 +6641,8 @@ sub read_main_am_file # Generate copyright header for generated Makefile.in. # We do discard the output of predefined variables, handled below. - $output_vars = ("# $in_file_name generated by automake " - . $VERSION . " from $am_file_name.\n"); + $output_vars = ("# " . basename ($infile) . " generated by automake " + . $VERSION . " from " . basename ($amfile) . ".\n"); $output_vars .= '# ' . subst ('configure_input') . "\n"; $output_vars .= $gen_copyright; @@ -6833,7 +6727,7 @@ sub transform ($$) # preprocess_file ($MAKEFILE, [%TRANSFORM]) # ----------------------------------------- # Load a $MAKEFILE, apply the %TRANSFORM, and return the result. -# No extra parsing of post-processing is done (i.e., recognition of +# No extra parsing or post-processing is done (i.e., recognition of # rules declaration or of make variables definitions). sub preprocess_file ($%) { @@ -6845,7 +6739,6 @@ sub preprocess_file ($%) => $seen_maint_mode ? subst ('MAINTAINER_MODE_TRUE') : '', 'XZ' => !! option 'dist-xz', - 'LZMA' => !! option 'dist-lzma', 'LZIP' => !! option 'dist-lzip', 'BZIP2' => !! option 'dist-bzip2', 'COMPRESS' => !! option 'dist-tarZ', @@ -6855,7 +6748,6 @@ sub preprocess_file ($%) 'INSTALL-INFO' => ! option 'no-installinfo', 'INSTALL-MAN' => ! option 'no-installman', - 'HAVE-MANS' => !! var ('MANS'), 'CK-NEWS' => !! option 'check-news', 'SUBDIRS' => !! var ('SUBDIRS'), @@ -7927,11 +7819,6 @@ sub generate_makefile ($$) # we have processed AUTOMAKE_OPTIONS. buffer_messages ('warning'); - # Name of input file ("Makefile.am") and output file - # ("Makefile.in"). These have no directory components. - $am_file_name = basename ($makefile_am); - $in_file_name = basename ($makefile_in); - # $OUTPUT is encoded. If it contains a ":" then the first element # is the real output file, and all remaining elements are input # files. We don't scan or otherwise deal with these input files, @@ -7940,10 +7827,8 @@ sub generate_makefile ($$) my ($makefile, @inputs) = split (/:/, $output_files{$makefile_in}); $relative_dir = dirname ($makefile); - $am_relative_dir = dirname ($makefile_am); - $topsrcdir = backname ($relative_dir); - read_main_am_file ($makefile_am); + read_main_am_file ($makefile_am, $makefile_in); if (handle_options) { # Process buffered warnings. @@ -7992,6 +7877,8 @@ sub generate_makefile ($$) handle_programs; handle_scripts; + handle_silent; + # These must be run after all the sources are scanned. They # use variables defined by &handle_libraries, &handle_ltlibraries, # or &handle_programs. @@ -8014,6 +7901,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. @@ -8052,6 +7940,7 @@ sub generate_makefile ($$) return; } + my $am_relative_dir = dirname ($makefile_am); mkdir ($am_relative_dir, 0755) if ! -d $am_relative_dir; # We make sure that 'all:' is the first target.