diff options
Diffstat (limited to 'bin')
-rw-r--r-- | bin/aclocal.in | 69 | ||||
-rw-r--r-- | bin/automake.in | 360 | ||||
-rwxr-xr-x | bin/gen-perl-protos | 36 | ||||
-rw-r--r-- | bin/local.mk (renamed from bin/Makefile.inc) | 28 |
4 files changed, 306 insertions, 187 deletions
diff --git a/bin/aclocal.in b/bin/aclocal.in index a4535bc47..b3715d9c6 100644 --- a/bin/aclocal.in +++ b/bin/aclocal.in @@ -7,7 +7,7 @@ eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac' # aclocal - create aclocal.m4 by scanning configure.ac -# Copyright (C) 1996-2017 Free Software Foundation, Inc. +# Copyright (C) 1996-2018 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 @@ -20,16 +20,15 @@ eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac' # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# along with this program. If not, see <https://www.gnu.org/licenses/>. # Written by Tom Tromey <tromey@redhat.com>, and # Alexandre Duret-Lutz <adl@gnu.org>. BEGIN { - @Aclocal::perl_libdirs = ('@datadir@/@PACKAGE@-@APIVERSION@') - unless @Aclocal::perl_libdirs; - unshift @INC, @Aclocal::perl_libdirs; + unshift (@INC, '@datadir@/@PACKAGE@-@APIVERSION@') + unless $ENV{AUTOMAKE_UNINSTALLED}; } use strict; @@ -69,7 +68,7 @@ $perl_threads = 0; # ACLOCAL_PATH environment variable, and reset with the '--system-acdir' # option. my @user_includes = (); -my @automake_includes = ("@datadir@/aclocal-$APIVERSION"); +my @automake_includes = ('@datadir@/aclocal-' . $APIVERSION); my @system_includes = ('@datadir@/aclocal'); # Whether we should copy M4 file in $user_includes[0]. @@ -174,7 +173,26 @@ use constant SCAN_M4_DIRS_ERROR => 2; # Prototypes for all subroutines. -#! Prototypes here will automatically be generated by the build system. +sub add_file ($); +sub add_macro ($); +sub check_acinclude (); +sub install_file ($$); +sub list_compare (\@\@); +sub parse_ACLOCAL_PATH (); +sub parse_arguments (); +sub reset_maps (); +sub scan_configure (); +sub scan_configure_dep ($); +sub scan_file ($$$); +sub scan_m4_dirs ($$@); +sub scan_m4_files (); +sub strip_redundant_includes (%); +sub trace_used_macros (); +sub unlink_tmp (;$); +sub usage ($); +sub version (); +sub write_aclocal ($@); +sub xmkdir_p ($); ################################################################ @@ -646,7 +664,7 @@ sub scan_file ($$$) { msg ('syntax', "$file:$.", "underquoted definition of $2" . "\n run info Automake 'Extending aclocal'\n" - . " or see http://www.gnu.org/software/automake/manual/" + . " or see https://www.gnu.org/software/automake/manual/" . "automake.html#Extending-aclocal") unless $underquoted_manual_once; $underquoted_manual_once = 1; @@ -750,7 +768,7 @@ sub trace_used_macros () # When AC_CONFIG_MACRO_DIRS is used, avoid possible spurious warnings # from autom4te about macros being "m4_require'd but not m4_defun'd"; # for more background, see: - # http://lists.gnu.org/archive/html/autoconf-patches/2012-11/msg00004.html + # https://lists.gnu.org/archive/html/autoconf-patches/2012-11/msg00004.html # as well as autoconf commit 'v2.69-44-g1ed0548', "warn: allow aclocal # to silence m4_require warnings". my $early_m4_code .= "m4_define([m4_require_silent_probe], [-])"; @@ -1044,7 +1062,7 @@ Warning categories include: Report bugs to <@PACKAGE_BUGREPORT@>. GNU Automake home page: <@PACKAGE_URL@>. -General help using GNU software: <http://www.gnu.org/gethelp/>. +General help using GNU software: <https://www.gnu.org/gethelp/>. EOF exit $status; } @@ -1055,7 +1073,7 @@ sub version () print <<EOF; aclocal (GNU $PACKAGE) $VERSION Copyright (C) $RELEASE_YEAR Free Software Foundation, Inc. -License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl-2.0.html> +License GPLv2+: GNU GPL version 2 or later <https://gnu.org/licenses/gpl-2.0.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. @@ -1112,7 +1130,7 @@ sub parse_arguments () } # Finally, adds any directory listed in the 'dirlist' file. - if (open (DIRLIST, "$system_includes[0]/dirlist")) + if (@system_includes && open (DIRLIST, "$system_includes[0]/dirlist")) { while (<DIRLIST>) { @@ -1147,6 +1165,16 @@ sub parse_ACLOCAL_PATH () ################################################################ +# Don't refer to installation directories from the build environment +if (exists $ENV{"AUTOMAKE_UNINSTALLED"}) + { + @automake_includes = (); + @system_includes = (); + } + +@automake_includes = ($ENV{"ACLOCAL_AUTOMAKE_DIR"}) + if (exists $ENV{"ACLOCAL_AUTOMAKE_DIR"}); + parse_WARNINGS; # Parse the WARNINGS environment variable. parse_arguments; parse_ACLOCAL_PATH; @@ -1195,20 +1223,3 @@ while (1) check_acinclude; exit $exit_code; - -### Setup "GNU" style for perl-mode and cperl-mode. -## Local Variables: -## perl-indent-level: 2 -## perl-continued-statement-offset: 2 -## perl-continued-brace-offset: 0 -## perl-brace-offset: 0 -## perl-brace-imaginary-offset: 0 -## perl-label-offset: -2 -## cperl-indent-level: 2 -## cperl-brace-offset: 0 -## cperl-continued-brace-offset: 0 -## cperl-label-offset: -2 -## cperl-extra-newline-before-brace: t -## cperl-merge-trailing-else: nil -## cperl-continued-statement-offset: 2 -## End: diff --git a/bin/automake.in b/bin/automake.in index d356336c3..16fb45182 100644 --- a/bin/automake.in +++ b/bin/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-2017 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 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 @@ -19,7 +19,7 @@ eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac' # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# along with this program. If not, see <https://www.gnu.org/licenses/>. # Originally written by David Mackenzie <djm@gnu.ai.mit.edu>. # Perl reimplementation by Tom Tromey <tromey@redhat.com>, and @@ -31,9 +31,8 @@ use strict; BEGIN { - @Automake::perl_libdirs = ('@datadir@/@PACKAGE@-@APIVERSION@') - unless @Automake::perl_libdirs; - unshift @INC, @Automake::perl_libdirs; + unshift (@INC, '@datadir@/@PACKAGE@-@APIVERSION@') + unless $ENV{AUTOMAKE_UNINSTALLED}; # Override SHELL. This is required on DJGPP so that system() uses # bash, not COMMAND.COM which doesn't quote arguments properly. @@ -74,14 +73,68 @@ use Automake::Wrap 'makefile_wrap'; use Automake::Language; use File::Basename; use File::Spec; +use List::Util 'none'; use Carp; ## ----------------------- ## ## Subroutine prototypes. ## ## ----------------------- ## -#! Prototypes here will automatically be generated by the build system. - +sub append_exeext (&$); +sub check_gnits_standards (); +sub check_gnu_standards (); +sub check_trailing_slash ($\$); +sub check_typos (); +sub define_files_variable ($\@$$); +sub define_standard_variables (); +sub define_verbose_libtool (); +sub define_verbose_texinfo (); +sub do_check_merge_target (); +sub get_number_of_threads (); +sub handle_compile (); +sub handle_data (); +sub handle_dist (); +sub handle_emacs_lisp (); +sub handle_factored_dependencies (); +sub handle_footer (); +sub handle_gettext (); +sub handle_headers (); +sub handle_install (); +sub handle_java (); +sub handle_languages (); +sub handle_libraries (); +sub handle_libtool (); +sub handle_ltlibraries (); +sub handle_makefiles_serial (); +sub handle_man_pages (); +sub handle_minor_options (); +sub handle_options (); +sub handle_programs (); +sub handle_python (); +sub handle_scripts (); +sub handle_silent (); +sub handle_subdirs (); +sub handle_tags (); +sub handle_targets (); +sub handle_tests (); +sub handle_tests_dejagnu (); +sub handle_texinfo (); +sub handle_user_recursion (); +sub initialize_per_input (); +sub lang_lex_finish (); +sub lang_sub_obj (); +sub lang_vala_finish (); +sub lang_yacc_finish (); +sub locate_aux_dir (); +sub parse_arguments (); +sub scan_aclocal_m4 (); +sub scan_autoconf_files (); +sub silent_flag (); +sub transform ($\%); +sub transform_token ($\%$); +sub usage (); +sub version (); +sub yacc_lex_finish_helper (); ## ----------- ## ## Constants. ## @@ -472,6 +525,15 @@ my %dep_files; # This is a list of all targets to run during "make dist". my @dist_targets; +# List of all programs, libraries and ltlibraries as returned +# by am_install_var +my @proglist; +my @liblist; +my @ltliblist; +# Blacklist of targets (as canonical base name) for which object file names +# may not be automatically shortened +my @dup_shortnames; + # Keep track of all programs declared in this Makefile, without # $(EXEEXT). @substitutions@ are not listed. my %known_programs; @@ -592,6 +654,11 @@ sub initialize_per_input () @dist_common = (); $handle_dist_run = 0; + @proglist = (); + @liblist = (); + @ltliblist = (); + @dup_shortnames = (); + %known_programs = (); %known_libraries = (); @@ -825,6 +892,7 @@ register_language ('name' => 'cppasm', 'compile' => "\$(CCAS) @cpplike_flags \$(AM_CCASFLAGS) \$(CCASFLAGS)", 'ccer' => 'CPPAS', 'compiler' => 'CPPASCOMPILE', + 'libtool_tag' => 'CC', 'compile_flag' => '-c', 'output_flag' => '-o', 'extensions' => ['.S', '.sx']); @@ -1230,48 +1298,50 @@ sub check_user_variables sub handle_languages () { if (! option 'no-dependencies') - { - # Include auto-dep code. Don't include it if DEP_FILES would - # be empty. - if (keys %extension_seen && keys %dep_files) - { - # Set location of depcomp. - define_variable ('depcomp', - "\$(SHELL) $am_config_aux_dir/depcomp", - INTERNAL); - define_variable ('am__depfiles_maybe', 'depfiles', INTERNAL); - - require_conf_file ("$am_file.am", FOREIGN, 'depcomp'); - - my @deplist = sort keys %dep_files; - # Generate each 'include' individually. Irix 6 make will - # not properly include several files resulting from a - # variable expansion; generating many separate includes - # seems safest. - $output_rules .= "\n"; - foreach my $iter (@deplist) - { - $output_rules .= (subst ('AMDEP_TRUE') - . subst ('am__include') - . ' ' - . subst ('am__quote') - . $iter - . subst ('am__quote') - . "\n"); - } - - # Compute the set of directories to remove in distclean-depend. - my @depdirs = uniq (map { dirname ($_) } @deplist); - $output_rules .= file_contents ('depend', - new Automake::Location, - DEPDIRS => "@depdirs"); - } - } + { + # Include auto-dep code. Don't include it if DEP_FILES would + # be empty. + if (keys %extension_seen && keys %dep_files) + { + my @dep_files = sort keys %dep_files; + # Set location of depcomp. + define_variable ('depcomp', + "\$(SHELL) $am_config_aux_dir/depcomp", + INTERNAL); + define_variable ('am__maybe_remake_depfiles', 'depfiles', INTERNAL); + define_variable ('am__depfiles_remade', "@dep_files", INTERNAL); + $output_rules .= "\n"; + my @dist_rms; + foreach my $depfile (@dep_files) + { + push @dist_rms, "\t-rm -f $depfile"; + # Generate each 'include' directive individually. Several + # make implementations (IRIX 6, Solaris 10, FreeBSD 8) will + # fail to properly include several files resulting from a + # variable expansion. Just Generating many separate includes + # seems thus safest. + $output_rules .= subst ('AMDEP_TRUE') . + subst ('am__include') . + " " . + subst('am__quote') . + $depfile . + subst('am__quote') . + " " . + "# am--include-marker\n"; + } + + require_conf_file ("$am_file.am", FOREIGN, 'depcomp'); + + $output_rules .= file_contents ( + 'depend', new Automake::Location, + 'DISTRMS' => join ("\n", @dist_rms)); + } + } else - { - define_variable ('depcomp', '', INTERNAL); - define_variable ('am__depfiles_maybe', '', INTERNAL); - } + { + define_variable ('depcomp', '', INTERNAL); + define_variable ('am__maybe_remake_depfiles', '', INTERNAL); + } my %done; @@ -1615,9 +1685,9 @@ sub handle_single_transform my $renamed = 0; my ($linker, $object); - # This records whether we've seen a derived source file (e.g. - # yacc output). - my $derived_source = 0; + # This records whether we've seen a derived source file (e.g., yacc + # or lex output). + my $derived_source; # This holds the 'aggregate context' of the file we are # currently examining. If the file is compiled with @@ -1665,17 +1735,36 @@ sub handle_single_transform # Now extract linker and other info. $linker = $lang->linker; - my $this_obj_ext; - if (defined $source_extension) - { - $this_obj_ext = $source_extension; - $derived_source = 1; - } - else - { - $this_obj_ext = $obj; - } - $object = $base . $this_obj_ext; + my $this_obj_ext; + if (defined $source_extension) + { + $this_obj_ext = $source_extension; + $derived_source = 1; + } + else + { + $this_obj_ext = $obj; + $derived_source = 0; + # Don't ever place built object files in $(srcdir), + # even when sources are specified explicitly as (say) + # '$(srcdir)/foo.c' or '$(top_srcdir)/foo.c'. + # See automake bug#13928. + my @d = split '/', $directory; + if (@d > 0 && option 'subdir-objects') + { + my $d = $d[0]; + if ($d eq '$(srcdir)' or $d eq '${srcdir}') + { + shift @d; + } + elsif ($d eq '$(top_srcdir)' or $d eq '${top_srcdir}') + { + $d[0] = '$(top_builddir)'; + } + $directory = join '/', @d; + } + } + $object = $base . $this_obj_ext; if ($have_per_exec_flags) { @@ -1683,14 +1772,48 @@ sub handle_single_transform # object. In this case we rewrite the object's # name to ensure it is unique. - # We choose the name 'DERIVED_OBJECT' to ensure - # (1) uniqueness, and (2) continuity between - # invocations. However, this will result in a - # name that is too long for losing systems, in - # some situations. So we provide _SHORTNAME to - # override. - - my $dname = $derived; + # We choose the name 'DERIVED_OBJECT' to ensure (1) uniqueness, + # and (2) continuity between invocations. However, this will + # result in a name that is too long for losing systems, in some + # situations. So we attempt to shorten automatically under + # subdir-objects, and provide _SHORTNAME to override as a last + # resort. If subdir-object is in effect, it's usually + # unnecessary to use the complete 'DERIVED_OBJECT' (that is + # often the result from %canon_reldir%/%C% usage) since objects + # are placed next to their source file. Generally, this means + # it is already unique within that directory (see below for an + # exception). Thus, we try to avoid unnecessarily long file + # names by stripping the directory components of + # 'DERIVED_OBJECT'. This allows avoiding explicit _SHORTNAME + # usage in many cases. EXCEPTION: If two (or more) targets in + # different directories but with the same base name (after + # canonicalization), using target-specific FLAGS, link the same + # object, then this logic clashes. Thus, we don't strip if + # this is detected. + my $dname = $derived; + if ($directory ne '' + && option 'subdir-objects' + && none { $dname =~ /$_$/ } @dup_shortnames) + { + # At this point, we don't clear information about what + # parts of $derived are truly file name components. We can + # determine that by comparing against the canonicalization + # of $directory. + my $dir = $directory . "/"; + my $cdir = canonicalize ($dir); + my $dir_len = length ($dir); + # Make sure we only strip full file name components. This + # is done by repeatedly trying to find cdir at the + # beginning. Each iteration removes one file name + # component from the end of cdir. + while ($dir_len > 0 && index ($derived, $cdir) != 0) + { + # Eventually $dir_len becomes 0. + $dir_len = rindex ($dir, "/", $dir_len - 2) + 1; + $cdir = substr ($cdir, 0, $dir_len); + } + $dname = substr ($derived, $dir_len); + } my $var = var ($derived . '_SHORTNAME'); if ($var) { @@ -1708,8 +1831,7 @@ sub handle_single_transform $renamed = 1; } - # If rewrite said it was ok, put the object into a - # subdir. + # If rewrite said it was ok, put the object into a subdir. if ($directory ne '') { if ($r == LANG_SUBDIR) @@ -2208,13 +2330,14 @@ sub handle_lib_objects return $seen_libobjs; } -# handle_LIBOBJS_or_ALLOCA ($VAR) -# ------------------------------- +# handle_LIBOBJS_or_ALLOCA ($VAR, $BASE) +# -------------------------------------- # Definitions common to LIBOBJS and ALLOCA. # VAR should be one of LIBOBJS, LTLIBOBJS, ALLOCA, or LTALLOCA. +# BASE should be one base file name from AC_LIBSOURCE, or alloca. sub handle_LIBOBJS_or_ALLOCA { - my ($var) = @_; + my ($var, $base) = @_; my $dir = ''; @@ -2236,10 +2359,18 @@ sub handle_LIBOBJS_or_ALLOCA $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 - # be created by libtool as a side-effect of creating LTLIBOBJS). - $clean_files{"\$($var)"} = MOSTLY_CLEAN if $var =~ s/^LT//; + if ($dir && !defined $clean_files{"$dir$base.\$(OBJEXT)"}) + { + my $dirstamp = require_build_directory ($dir); + $output_rules .= "$dir$base.\$(OBJEXT): $dirstamp\n"; + $output_rules .= "$dir$base.lo: $dirstamp\n" + if ($var =~ /^LT/); + } + # libtool might create .$(OBJEXT) as a side-effect of using + # LTLIBOBJS or LTALLOCA. + $clean_files{"$dir$base.\$(OBJEXT)"} = MOSTLY_CLEAN; + $clean_files{"$dir$base.lo"} = MOSTLY_CLEAN + if ($var =~ /^LT/); } else { @@ -2260,14 +2391,14 @@ sub handle_LIBOBJS $var->requires_variables ("\@${lt}LIBOBJS\@ used", $lt . 'LIBOBJS') if ! keys %libsources; - my $dir = handle_LIBOBJS_or_ALLOCA "${lt}LIBOBJS"; - foreach my $iter (keys %libsources) { - if ($iter =~ /\.[cly]$/) + my $dir = ''; + if ($iter =~ /^(.*)(\.[cly])$/) { - saw_extension ($&); + saw_extension ($2); saw_extension ('.c'); + $dir = handle_LIBOBJS_or_ALLOCA ("${lt}LIBOBJS", $1); } if ($iter =~ /\.h$/) @@ -2295,7 +2426,7 @@ sub handle_ALLOCA my ($var, $cond, $lt) = @_; my $myobjext = $lt ? 'lo' : 'o'; $lt ||= ''; - my $dir = handle_LIBOBJS_or_ALLOCA "${lt}ALLOCA"; + my $dir = handle_LIBOBJS_or_ALLOCA ("${lt}ALLOCA", "alloca"); $dir eq '' and $dir = './'; $var->requires_variables ("\@${lt}ALLOCA\@ used", $lt . 'ALLOCA'); @@ -2412,12 +2543,33 @@ sub handle_libtool () LTRMS => join ("\n", @libtool_rms)); } +# Check for duplicate targets +sub handle_targets () +{ + my %seen = (); + my @dups = (); + @proglist = am_install_var ('progs', 'PROGRAMS', + 'bin', 'sbin', 'libexec', 'pkglibexec', + 'noinst', 'check'); + @liblist = am_install_var ('libs', 'LIBRARIES', + 'lib', 'pkglib', 'noinst', 'check'); + @ltliblist = am_install_var ('ltlib', 'LTLIBRARIES', + 'noinst', 'lib', 'pkglib', 'check'); + + # Record duplications that may arise after canonicalization of the + # base names, in order to prevent object file clashes in the presence + # of target-specific *FLAGS + my @targetlist = (@proglist, @liblist, @ltliblist); + foreach my $pair (@targetlist) + { + my $base = canonicalize (basename (@$pair[1])); + push (@dup_shortnames, $base) if ($seen{$base}); + $seen{$base} = $base; + } +} sub handle_programs () { - my @proglist = am_install_var ('progs', 'PROGRAMS', - 'bin', 'sbin', 'libexec', 'pkglibexec', - 'noinst', 'check'); return if ! @proglist; $must_handle_compiled_objects = 1; @@ -2504,8 +2656,6 @@ sub handle_programs () sub handle_libraries () { - my @liblist = am_install_var ('libs', 'LIBRARIES', - 'lib', 'pkglib', 'noinst', 'check'); return if ! @liblist; $must_handle_compiled_objects = 1; @@ -2614,9 +2764,7 @@ sub handle_libraries () sub handle_ltlibraries () { - my @liblist = am_install_var ('ltlib', 'LTLIBRARIES', - 'noinst', 'lib', 'pkglib', 'check'); - return if ! @liblist; + return if ! @ltliblist; $must_handle_compiled_objects = 1; my @prefix = am_primary_prefixes ('LTLIBRARIES', 0, 'lib', 'pkglib', @@ -2709,7 +2857,7 @@ sub handle_ltlibraries () skip_ac_subst => 1); } - foreach my $pair (@liblist) + foreach my $pair (@ltliblist) { my ($where, $onelib) = @$pair; @@ -5271,7 +5419,7 @@ EOF { msg 'obsolete', $where, <<'EOF'; AM_INIT_AUTOMAKE: two- and three-arguments forms are deprecated. For more info, see: -http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_005fINIT_005fAUTOMAKE-invocation +https://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_005fINIT_005fAUTOMAKE-invocation EOF $package_version = $args[2]; $package_version_location = $where; @@ -7773,6 +7921,8 @@ sub generate_makefile handle_configure ($makefile_am, $makefile_in, $makefile, @inputs); handle_gettext; + + handle_targets; handle_libraries; handle_ltlibraries; handle_programs; @@ -7973,7 +8123,7 @@ Library files: print ' Report bugs to <@PACKAGE_BUGREPORT@>. GNU Automake home page: <@PACKAGE_URL@>. -General help using GNU software: <http://www.gnu.org/gethelp/>. +General help using GNU software: <https://www.gnu.org/gethelp/>. '; # --help always returns 0 per GNU standards. @@ -7986,7 +8136,7 @@ sub version () print <<EOF; automake (GNU $PACKAGE) $VERSION Copyright (C) $RELEASE_YEAR Free Software Foundation, Inc. -License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl-2.0.html> +License GPLv2+: GNU GPL version 2 or later <https://gnu.org/licenses/gpl-2.0.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. @@ -8227,21 +8377,3 @@ else } exit $exit_code; - - -### Setup "GNU" style for perl-mode and cperl-mode. -## Local Variables: -## perl-indent-level: 2 -## perl-continued-statement-offset: 2 -## perl-continued-brace-offset: 0 -## perl-brace-offset: 0 -## perl-brace-imaginary-offset: 0 -## perl-label-offset: -2 -## cperl-indent-level: 2 -## cperl-brace-offset: 0 -## cperl-continued-brace-offset: 0 -## cperl-label-offset: -2 -## cperl-extra-newline-before-brace: t -## cperl-merge-trailing-else: nil -## cperl-continued-statement-offset: 2 -## End: diff --git a/bin/gen-perl-protos b/bin/gen-perl-protos deleted file mode 100755 index 215d275b8..000000000 --- a/bin/gen-perl-protos +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env perl -# -# Copyright (C) 2013-2017 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 -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - -use warnings; -use strict; - -my @lines = <>; -my @protos = map { /^(sub \w+\s*\(.*\))/ ? ("$1;") : () } @lines; - -while (defined ($_ = shift @lines)) - { - if (/^#!.* prototypes/i) - { - print "# BEGIN AUTOMATICALLY GENERATED PROTOTYPES\n"; - print join ("\n", sort @protos) . "\n"; - print "# END AUTOMATICALLY GENERATED PROTOTYPES\n"; - } - else - { - print; - } - } diff --git a/bin/Makefile.inc b/bin/local.mk index 102dec9fc..97b38db34 100644 --- a/bin/Makefile.inc +++ b/bin/local.mk @@ -1,4 +1,5 @@ -## Copyright (C) 1995-2017 Free Software Foundation, Inc. +## -*- makefile-automake -*- +## Copyright (C) 1995-2018 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 @@ -11,14 +12,21 @@ ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License -## along with this program. If not, see <http://www.gnu.org/licenses/>. +## along with this program. If not, see <https://www.gnu.org/licenses/>. ## ----------------------------------- ## ## The automake and aclocal scripts. ## ## ----------------------------------- ## bin_SCRIPTS = %D%/automake %D%/aclocal -CLEANFILES += $(bin_SCRIPTS) +nodist_noinst_SCRIPTS += \ + %D%/aclocal-$(APIVERSION) \ + %D%/automake-$(APIVERSION) + +CLEANFILES += \ + $(bin_SCRIPTS) \ + %D%/aclocal-$(APIVERSION) \ + %D%/automake-$(APIVERSION) # Used by maintainer checks and such. automake_in = $(srcdir)/%D%/automake.in @@ -54,18 +62,22 @@ uninstall-hook: # $(datadir) or other do_subst'ituted variables change. %D%/automake: %D%/automake.in %D%/aclocal: %D%/aclocal.in -%D%/automake %D%/aclocal: Makefile %D%/gen-perl-protos +%D%/automake %D%/aclocal: Makefile $(AM_V_GEN)rm -f $@ $@-t $@-t2 \ && $(MKDIR_P) $(@D) \ ## Common substitutions. && in=$@.in && $(do_subst) <$(srcdir)/$$in >$@-t \ -## Auto-compute prototypes of perl subroutines. - && $(PERL) -w $(srcdir)/%D%/gen-perl-protos $@-t > $@-t2 \ - && mv -f $@-t2 $@-t \ ## We can't use '$(generated_file_finalize)' here, because currently ## Automake contains occurrences of unexpanded @substitutions@ in ## comments, and that is perfectly legit. && chmod a+x,a-w $@-t && mv -f $@-t $@ -EXTRA_DIST += %D%/gen-perl-protos + +%D%/aclocal-$(APIVERSION): %D%/aclocal + $(AM_V_GEN) rm -f $@; \ + $(LN) %D%/aclocal $@ + +%D%/automake-$(APIVERSION): %D%/automake + $(AM_V_GEN) rm -f $@; \ + $(LN) %D%/automake $@ # vim: ft=automake noet |