Re: subdirs.am and $(RECURSIVE_TARGETS)
Akim> Not only to I find this more pleasant, but most importantly it's Akim> a win for Automake (we can have more modular *.am files which Akim> register their own recursive targets), and it's a win for users Akim> who can += on RECURSIVE_TARGETS. >> In the not-too-distant past, you couldn't `+=' an >> internally-defined variable. And you still can't -- I forgot. I've thought about this more and I'd rather we not use a variable for internal targets. If we want a variable for the user then that is fine. Derek> RECURSIVE_TARGETS += mytarget For this to be really nice I think we'd have to automatically add `mytarget-recursive' and `mytarget' to any Makefile.am beneath the defining Makefile.am. However, this turns out to be hard because we won't know about it when building a single Makefile.in. One approach would be to require recursive targets to be defined in configure.in. But that is pretty heavy. Tom
Re: 70-cygnus-texinfo.am
> "Akim" == Akim Demaille <[EMAIL PROTECTED]> writes: Akim> * automake.in (handle_texinfo): Remove code handled by texinfos.am. Ok. Tom
Re: 69-installcheck.patch
> "Akim" == Akim Demaille <[EMAIL PROTECTED]> writes: Akim> * automake.in (&handle_merge_targets, &do_one_merge_target): Don't Akim> handle installcheck and installcheck-am. Akim> * install.am: Do it. Ok. Tom
Re: 63-remove-recursive-install.patch
> "Akim" == Akim Demaille <[EMAIL PROTECTED]> writes: Akim> So I replaced each occurrence of $recursive_install (which name Akim> was quite confusing anyway IMHO) with it's definition. This is probably just some historical relic. Akim> * automake.in ($install_recursive): Remove, replaced with calls to Akim> `&variable_defined ('SUBDIRS')'. Akim> (&handle_dist, &handle_clean): Don't transform_cond SUBDIRS since... Akim> (&file_contents): now does. Ok. Tom
Re: 65-install-am.patch
> "Akim" == Akim Demaille <[EMAIL PROTECTED]> writes: Parts of this patch I like, but parts I don't like so much. Akim> (&file_contents): Be able to grow Automake macros with `+='. This is a nice idea, but it is problematic. Suppose the user defines a variable that a .am file tries to +=. This will fail (I think). I think it will fail worse if they only defined the variable conditionally. One approach would be to only ever `+=' private variables -- and then maybe add an error if the user tries to override a private variable. Also this would mean adding a programming error condition if a .am file tries to += a non-private macro. Akim> (&handle_texinfo, &handle_man_pages, &am_install_var): Let your Akim> files define INSTALLDIRS. I think we should have a clean separation between internal and external variables here. So how about renaming this as `_am_installdirs' or something like that? I have a slight preference for lower case internal macro names. Akim> (&handle_factored_dependencies): Uniq dependencies. This I like. Akim> (&transform): Also call &transform_cond on your arguments. This I like. Tom
Re: 59-var-vs-target.patch
> "Akim" == Akim Demaille <[EMAIL PROTECTED]> writes: Akim> * automake.in (&initialize_per_input): %targets_conditionals is Akim> new. Akim> (&read_am_file): When slurping a rule, set the target related Akim> variable, and no variable related variable. Akim> (&file_contents): Likewise. Akim> * tests/vartar.test, tests/ctarget1.test: New. Ok. Akim> Index: tests/vartar.test Akim> \ No newline at end of file Please add a newline at the end of this file. Tom
Re: 64-simplify-handle-gettext.patch
> "Akim" == Akim Demaille <[EMAIL PROTECTED]> writes: Akim> +&am_line_error ('SUBDIRS', Akim> + "AM_GNU_GETTEXT used but \`po' not in SUBDIRS") Akim> + if $contents{'SUBDIRS'} !~ /\bpo\b/; Akim> +&am_line_error ('SUBDIRS', Akim> + "AM_GNU_GETTEXT used but \`intl' not in SUBDIRS") Akim> + if $contents{'SUBDIRS'} !~ /\bintl\b/; This code -- and the old code, I admit -- is broken. Random bits of code shouldn't look at $contents{...}. Instead they have to use &variable_value or &variable_value_as_list. That's because the variable might be conditionally defined. Can you update the patch to do this? With that minor change it is ok. Tom
Re: 66-install-strip.patch
> "Akim" == Akim Demaille <[EMAIL PROTECTED]> writes: Akim> * automake.in (&handle_merge_targets): Move `install-strip' from Akim> here... Akim> * install.am: to here. This is almost fine, except * The patch it depends on needs work * This appears to use an old version of the install-strip logic Tom
Re: 61-atless-internal-conditionals.patch
> "Akim" == Akim Demaille <[EMAIL PROTECTED]> writes: Akim> Internally just store the conditionals as space separated lists of Akim> CONDITIONS (instead of @CONDITIONS@). Ok. Tom
Re: 58-var-vs-target.patch
> "Akim" == Akim Demaille <[EMAIL PROTECTED]> writes: Akim> * automake.in (&variable_defined, &variable_value_as_list_worker): Akim> If $VAR is effectively a variable, don't die if it's also a Akim> target. Akim> Plus some formatting changes. Ok. Tom
Re: 60-mying-changes.patches
> "Akim" == Akim Demaille <[EMAIL PROTECTED]> writes: Akim> * automake.in: `my' the globals. Ok. Tom
Re: 62-found-dead-found.patch
> "Akim" == Akim Demaille <[EMAIL PROTECTED]> writes: Akim> * automake.in (&handle_man_pages): $found is dead. Ok. Which patch renders it dead? Tom
Re: 68-install-in-install-am.patch
> "Akim" == Akim Demaille <[EMAIL PROTECTED]> writes: Akim> handle install and install-am. Akim> * install.am: Do it. Ok. Tom
Re: 67-bigger-handle-factored-dependencies.patch
> "Akim" == Akim Demaille <[EMAIL PROTECTED]> writes: Akim> * automake.in (&handle_merge_targets, &do_one_merge_target): Don't Akim> work on targets handled by %dependencies. Akim> (&handle_factored_dependencies): Do it. Akim> * install.am: Install install-exec, install-data and uninstall's Akim> suites. This is ok. Akim> +# Install the -local hooks. Akim> +foreach (keys %dependencies) Akim> +{ Akim> + # Hooks are installed on the -am targets. Akim> + s/-am$// or next; What is the `dist-all' target used for? I see it is collected in %dependencies. Does it really make sense for us to also have `clean' hooks? This seems pointless. I think your patch adds this. If you do that please update the documentation. Akim> +# FIXME: Why not be as liberal as we are with -local hooks? Sometimes there's no point. Akim> +foreach ('install-exec', 'install-data') dist-hook could also be handled here. Tom
Re: 65-install-am.patch
> "Akim" == Akim Demaille <[EMAIL PROTECTED]> writes: Akim> (&handle_texinfo, &handle_man_pages, &am_install_var): Let your Akim> files define INSTALLDIRS. Oh, yeah -- if we let the user set INSTALLDIRS then that should be documented. Tom
Re: 52-factored-install.patch
On Sat, Feb 24, 2001 at 10:29:14AM -0700, Tom Tromey wrote: > > "Akim" == Akim Demaille <[EMAIL PROTECTED]> writes: > > Akim> Here is the updated version of the patch. > > This patch still has a problem. See below. > > Akim> Note that there is a new side effect to my patch: the > Akim> (un)?install-man targets appeared (since you said they were > Akim> required) in Automake. > > I misspoke. I don't think these targets aren't required. Under > --cygnus mode, `install-info' is required, but that is different. > > Akim> - if (defined $exec_dir_p{$X} ? $exec_dir_p{$X} : ($X =~ /exec/)) > > You pushed half of this test out into the *.am files. That's fine. > But the second half of this test is important, and I don't understand > how it is handled in the revised code. > > One example of how the new code can fail is a system-dependent header > file install: > > inclexecdir = $(exec_prefix)/include ## Just an example! > inclexec_HEADERS = my-config.h > > With the new code the header will be installed by `install-data'. > However, that is wrong. `install-exec' ought to install this header. Aaaah! :( OK, I will write the test, and I will provide a fix for this. But again, hm, my stack is stacking...
Re: subdirs.am and $(RECURSIVE_TARGETS)
On Sat, Feb 24, 2001 at 01:36:59PM -0500, Derek R. Price wrote: > > i.e. a user should be able to add > > RECURSIVE_TARGETS += mytarget I agree, but up to now I couldn't find any beautiful means to do this. It would mean to add some magic, which I am reluctant to do.
Re: subdirs.am and $(RECURSIVE_TARGETS)
Tom Tromey wrote: > > "Akim" == akim <[EMAIL PROTECTED]> writes: > > Akim> I wonder why we have a hard coded list list this in subdirs.am: > Akim> [ ... -recursive targets ... ] > > Historical reasons only, ie, I never thought of it. > > Akim> Not only to I find this more pleasant, but most importantly it's > Akim> a win for Automake (we can have more modular *.am files which > Akim> register their own recursive targets), and it's a win for users > Akim> who can += on RECURSIVE_TARGETS. > > In the not-too-distant past, you couldn't `+=' an internally-defined > variable. I feel the need to point out that the -recursive portions of the targets in the RECURSIVE_TARGETS macro seem somewhat redundant since users would be required to end any new targets they wished to add to RECURSIVE_TARGETS with the same string due to the way recursive targets are defined. i.e. a user should be able to add RECURSIVE_TARGETS += mytarget thus implicitly defining mytarget & mytarget-recursive, and mytarget would call mytarget-local, mytarget-recursive, & mytarget-hook as appropriate. Of course I don't have my head nearly deep enough in those implementation details at the moment to even start detailing how I would code the above. Derek -- Derek Price CVS Solutions Architect ( http://CVSHome.org ) mailto:[EMAIL PROTECTED] OpenAvenue ( http://OpenAvenue.com ) -- "Very funny Scotty, now beam down my clothes!"
70-cygnus-texinfo.am
Index: ChangeLog from Akim Demaille <[EMAIL PROTECTED]> * automake.in (handle_texinfo): Remove code handled by texinfos.am. Index: automake.in --- automake.in Sat, 24 Feb 2001 17:12:49 +0100 akim (am/f/39_automake.i 1.77 755) +++ automake.in Sat, 24 Feb 2001 17:21:34 +0100 akim (am/f/39_automake.i 1.77 755) @@ -2428,12 +2428,6 @@ sub handle_texinfo $output_rules .= &file_contents ('texinfos', $xform); push (@dist_targets, 'dist-info'); - -if ($cygnus_mode) -{ - $output_rules .= "clean-info: mostlyclean-aminfo\n"; -} - push (@suffixes, '.texi', '.texinfo', '.txi', '.info', '.dvi', '.ps'); if (! defined $options{'no-installinfo'})
69-installcheck.patch
Yes @installcheck was not used (and at least since 1.4, I checked). Yes there is there are stall targets (installcheck-am), but it's because the copy I have of Automake at home doesn't have the %required_targets hash, so I'll fix this once at Epita when applying the patch. Index: ChangeLog from Akim Demaille <[EMAIL PROTECTED]> * automake.in (&handle_merge_targets, &do_one_merge_target): Don't handle installcheck and installcheck-am. * install.am: Do it. Index: Makefile.in --- Makefile.in Sat, 24 Feb 2001 16:56:04 +0100 akim (am/h/16_Makefile.i 1.22 644) +++ Makefile.in Sat, 24 Feb 2001 17:07:30 +0100 akim (am/h/16_Makefile.i 1.22 644) @@ -522,8 +522,6 @@ dvi: dvi-recursive check-am: all-am check: check-recursive -installcheck-am: installcheck-local -installcheck: installcheck-recursive all-am: Makefile $(INFO_DEPS) $(SCRIPTS) $(DATA) installdirs: installdirs-recursive @@ -538,6 +536,8 @@ install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +installcheck: installcheck-recursive + install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install @@ -571,6 +571,8 @@ install-exec-am: install-binSCRIPTS +installcheck-am: installcheck-local + maintainer-clean: maintainer-clean-recursive -rm -f config.status @@ -592,7 +594,7 @@ install-data-am install-data-recursive install-dist_pkgdataDATA \ install-dist_scriptDATA install-exec install-exec-am \ install-exec-recursive install-info-am install-recursive \ - install-strip installcheck installcheck-am installcheck-local \ + install-strip installcheck installcheck-local \ installcheck-recursive installdirs installdirs-am \ installdirs-recursive maintainer-clean maintainer-clean-aminfo \ maintainer-clean-generic maintainer-clean-recursive \ Index: automake.in --- automake.in Sat, 24 Feb 2001 16:56:04 +0100 akim (am/f/39_automake.i 1.76 755) +++ automake.in Sat, 24 Feb 2001 17:05:59 +0100 akim (am/f/39_automake.i 1.76 755) @@ -3559,7 +3559,6 @@ sub handle_merge_targets &do_one_merge_target ('info', @info); &do_one_merge_target ('dvi', @dvi); &do_check_merge_target; -&do_one_merge_target ('installcheck', @installcheck); if (defined $options{'no-installinfo'}) { @@ -6485,7 +6484,6 @@ sub initialize_per_input @all = (); @check = (); @check_tests = (); -@installcheck = (); # Holds the dependencies of targets which dependencies are factored. # Typically, `.PHONY' will appear in plenty of *.am files, but must @@ -6500,6 +6498,7 @@ sub initialize_per_input 'install-man' => [], 'uninstall-man' => [], 'uninstall-am' => [], + 'installcheck-am' => [], # Cleaning. 'clean-am' => [], Index: install.am --- install.am Sat, 24 Feb 2001 16:56:04 +0100 akim (am/h/26_install.am 1.4 644) +++ install.am Sat, 24 Feb 2001 17:07:25 +0100 akim (am/h/26_install.am 1.4 644) @@ -51,6 +51,12 @@ install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +.PHONY: installcheck +?SUBDIRS?installcheck: installcheck-recursive +?!SUBDIRS?installcheck: installcheck-am +?!SUBDIRS?.PHONY: installcheck-am +?!SUBDIRS?installcheck-am: + ## We can't just set INSTALL_PROGRAM because that might be a relative ## path. .PHONY: install-strip Index: m4/Makefile.in --- m4/Makefile.in Sat, 24 Feb 2001 16:56:04 +0100 akim (am/h/15_Makefile.i 1.17 644) +++ m4/Makefile.in Sat, 24 Feb 2001 17:07:31 +0100 akim (am/h/15_Makefile.i 1.17 644) @@ -143,8 +143,6 @@ dvi: dvi-am check-am: all-am check: check-am -installcheck-am: -installcheck: installcheck-am all-am: Makefile $(DATA) installdirs: @@ -157,6 +155,8 @@ install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install Index: tests/Makefile.in --- tests/Makefile.in Sat, 24 Feb 2001 16:56:04 +0100 akim (am/h/14_Makefile.i 1.19 644) +++ tests/Makefile.in Sat, 24 Feb 2001 17:07:32 +0100 akim (am/h/14_Makefile.i 1.19 +644) @@ -446,8 +446,6 @@ check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am -installcheck-am: -installcheck: installcheck-am all-am: Makefile installdirs: @@ -459,6 +457,8 @@ install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install
68-install-in-install-am.patch
Index: ChangeLog from Akim Demaille <[EMAIL PROTECTED]> handle install and install-am. * install.am: Do it. * automake.in (&handle_merge_targets, &do_one_merge_target): Don't Index: Makefile.in --- Makefile.in Sat, 24 Feb 2001 16:41:07 +0100 akim (am/h/16_Makefile.i 1.21 644) +++ Makefile.in Sat, 24 Feb 2001 16:52:55 +0100 akim (am/h/16_Makefile.i 1.21 644) @@ -524,18 +524,19 @@ check: check-recursive installcheck-am: installcheck-local installcheck: installcheck-recursive -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -install: install-recursive all-am: Makefile $(INFO_DEPS) $(SCRIPTS) $(DATA) installdirs: installdirs-recursive installdirs-am: $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(infodir) $(DESTDIR)$(pkgdatadir) $(DESTDIR)$(scriptdir) +install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive -uninstall: uninstall-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install Index: automake.in --- automake.in Sat, 24 Feb 2001 16:41:07 +0100 akim (am/f/39_automake.i 1.75 755) +++ automake.in Sat, 24 Feb 2001 16:51:37 +0100 akim (am/f/39_automake.i 1.75 755) @@ -3609,8 +3609,6 @@ sub handle_merge_targets $output_rules .= "install-binPROGRAMS: install-libLTLIBRARIES\n\n"; } # Print definitions users can use. -&do_one_merge_target ('install', 'all-am'); - &do_one_merge_target ('all', @all); } @@ -3644,13 +3642,6 @@ sub do_one_merge_target { &pretty_print_rule ("$name-am:", "\t\t", @values); } -if ($name eq 'install') -{ - # Special-case `install-am' to run install-exec-am and - # install-data-am after all-am is built. - &pretty_print_rule ("\t\@\$(MAKE) \$(AM_MAKEFLAGS)", "\t ", - 'install-exec-am', 'install-data-am'); -} # To understand this special case, see handle_merge_targets. if ($name eq 'all') Index: install.am --- install.am Sat, 24 Feb 2001 16:41:07 +0100 akim (am/h/26_install.am 1.3 644) +++ install.am Sat, 24 Feb 2001 16:52:51 +0100 akim (am/h/26_install.am 1.3 644) @@ -36,16 +36,20 @@ .PHONY: install install-exec install-data uninstall ?SUBDIRS?.PHONY: install-recursive install-exec-recursive install-data-recursive uninstall-recursive -## FIXME: not ready: ?SUBDIRS?install: install-recursive +?SUBDIRS?install: install-recursive ?SUBDIRS?install-exec: install-exec-recursive ?SUBDIRS?install-data: install-data-recursive ?SUBDIRS?uninstall: uninstall-recursive -.PHONY: install-am install-exec-am install-data-am uninstall-am -## FIXME: not ready: ?!SUBDIRS?install: install-am +.PHONY: install-exec-am install-data-am uninstall-am +?!SUBDIRS?install: install-am ?!SUBDIRS?install-exec: install-exec-am ?!SUBDIRS?install-data: install-data-am ?!SUBDIRS?uninstall: uninstall-am + +.PHONY: install-am +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am ## We can't just set INSTALL_PROGRAM because that might be a relative ## path. Index: m4/Makefile.in --- m4/Makefile.in Sat, 24 Feb 2001 16:41:07 +0100 akim (am/h/15_Makefile.i 1.16 644) +++ m4/Makefile.in Sat, 24 Feb 2001 16:52:57 +0100 akim (am/h/15_Makefile.i 1.16 644) @@ -145,17 +145,18 @@ check: check-am installcheck-am: installcheck: installcheck-am -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -install: install-am all-am: Makefile $(DATA) installdirs: $(mkinstalldirs) $(DESTDIR)$(m4datadir) +install: install-am install-exec: install-exec-am install-data: install-data-am -uninstall: uninstall-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install Index: tests/Makefile.in --- tests/Makefile.in Sat, 24 Feb 2001 16:41:07 +0100 akim (am/h/14_Makefile.i 1.18 644) +++ tests/Makefile.in Sat, 24 Feb 2001 16:52:58 +0100 akim (am/h/14_Makefile.i 1.18 +644) @@ -448,16 +448,17 @@ check: check-am installcheck-am: installcheck: installcheck-am -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -install: install-am all-am: Makefile installdirs: +install: install-am install-exec: install-exec-am install-data: install-data-am -uninstall: uninstall-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install
67-bigger-handle-factored-dependencies.patch
The difference in tests/Makefile's .PHONY is due to the fact that distclean-local is now registered. The following loop had forgotten to register it: -foreach ('clean', 'distclean', 'mostlyclean', 'maintainer-clean') - { - &depend ("$_-am", "$_-local") - if &target_defined ("$_-local"); - } Index: ChangeLog from Akim Demaille <[EMAIL PROTECTED]> * automake.in (&handle_merge_targets, &do_one_merge_target): Don't work on targets handled by %dependencies. (&handle_factored_dependencies): Do it. * install.am: Install install-exec, install-data and uninstall's suites. Index: Makefile.in --- Makefile.in Sat, 24 Feb 2001 15:40:19 +0100 akim (am/h/16_Makefile.i 1.20 644) +++ Makefile.in Sat, 24 Feb 2001 16:27:20 +0100 akim (am/h/16_Makefile.i 1.20 644) @@ -524,19 +524,21 @@ check: check-recursive installcheck-am: installcheck-local installcheck: installcheck-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-recursive -uninstall: uninstall-recursive all-am: Makefile $(INFO_DEPS) $(SCRIPTS) $(DATA) -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install installdirs: installdirs-recursive installdirs-am: $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(infodir) $(DESTDIR)$(pkgdatadir) $(DESTDIR)$(scriptdir) + +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install mostlyclean-generic: Index: automake.in --- automake.in Sat, 24 Feb 2001 15:49:38 +0100 akim (am/f/39_automake.i 1.74 755) +++ automake.in Sat, 24 Feb 2001 16:09:53 +0100 akim (am/f/39_automake.i 1.74 755) @@ -3571,23 +3571,6 @@ sub handle_merge_targets "\`install-info-local' target defined but \`no-installinfo' option not in use"); } -foreach my $utarg ('uninstall-data-local', 'uninstall-data-hook', - 'uninstall-exec-local', 'uninstall-exec-hook') -{ - if (&target_defined ($utarg)) - { - my $x = $utarg; - $x =~ s/(data|exec)-//; - &am_line_error ($utarg, "use \`$x', not \`$utarg'"); - } -} - -if (&target_defined ('install-local')) -{ - &am_line_error ('install-local', - "use \`install-data-local' or \`install-exec-local', not \`install-local'"); -} - if (@all || &variable_defined ('BUILT_SOURCES')) { my $local_headers = ''; @@ -3626,11 +3609,7 @@ sub handle_merge_targets $output_rules .= "install-binPROGRAMS: install-libLTLIBRARIES\n\n"; } # Print definitions users can use. -&do_one_merge_target ('install-exec'); -&do_one_merge_target ('install-data'); - &do_one_merge_target ('install', 'all-am'); -&do_one_merge_target ('uninstall'); &do_one_merge_target ('all', @all); } @@ -3672,20 +3651,6 @@ sub do_one_merge_target &pretty_print_rule ("\t\@\$(MAKE) \$(AM_MAKEFLAGS)", "\t ", 'install-exec-am', 'install-data-am'); } -elsif ($name eq 'install-exec' && &target_defined ('install-exec-hook')) -{ -$actions{'install-exec-am'} .= - ("\t\@\$(NORMAL_INSTALL)\n" - . "\t" . '$(MAKE) $(AM_MAKEFLAGS) install-exec-hook' - . "\n"); -} -elsif ($name eq 'install-data' && &target_defined ('install-data-hook')) -{ -$actions{'install-data-am'} .= - ("\t\@\$(NORMAL_INSTALL)\n" - . "\t" . '$(MAKE) $(AM_MAKEFLAGS) install-data-hook' - . "\n"); -} # To understand this special case, see handle_merge_targets. if ($name eq 'all') @@ -3782,12 +3747,6 @@ sub handle_clean $output_rules .= &file_contents ('clean', $xform); -foreach ('clean', 'distclean', 'mostlyclean', 'maintainer-clean') - { - &depend ("$_-am", "$_-local") - if &target_defined ("$_-local"); - } - # We special-case config.status here. If we do it as part of the # normal clean processing for this directory, then it might be # removed before some subdir is cleaned. However, that subdir's @@ -3829,9 +3788,52 @@ sub target_cmp # &handle_factored_dependencies () # -# Handle .PHONY target. +# Handle everything related to gathered targets. sub handle_factored_dependencies { +# Reject bad hooks. +foreach my $utarg ('uninstall-data-local', 'uninstall-data-hook', + 'uninstall-exec-local', 'uninstall-exec-hook') +{ + if (&target_defined ($utarg)) + { + my $x = $utarg; + $x =~ s/(data|exec)-//; + &am_line_error ($utarg, "use \`$x', not \`$utarg'"); + } +} + +if (&target_defined ('install-local')) +{ + &am_line_erro
66-install-strip.patch
Index: ChangeLog from Akim Demaille <[EMAIL PROTECTED]> * automake.in (&handle_merge_targets): Move `install-strip' from here... * install.am: to here. Index: automake.in --- automake.in Sat, 24 Feb 2001 15:40:19 +0100 akim (am/f/39_automake.i 1.73 755) +++ automake.in Sat, 24 Feb 2001 15:47:05 +0100 akim (am/f/39_automake.i 1.73 755) @@ -3633,13 +3633,6 @@ sub handle_merge_targets &do_one_merge_target ('uninstall'); &do_one_merge_target ('all', @all); - -# Generate the new 'install-strip' target. We can't just set -# INSTALL_PROGRAM because that might be a relative path. -$output_rules .= ("install-strip:\n\t" - . '$(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install' - . "\n"); -&depend ('.PHONY', 'install-strip'); } Index: install.am --- install.am Sat, 24 Feb 2001 15:40:19 +0100 akim (am/h/26_install.am 1.1 644) +++ install.am Sat, 24 Feb 2001 15:48:01 +0100 akim (am/h/26_install.am 1.1 644) @@ -24,3 +24,9 @@ ?!SUBDIRS?.PHONY: installdirs ?!SUBDIRS?installdirs: ?!SUBDIRS??INSTALLDIRS?$(mkinstalldirs) @INSTALLDIRS@ + +## We can't just set INSTALL_PROGRAM because that might be a relative +## path. +.PHONY: install-strip +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install
63-remove-recursive-install.patch
Given that $recursive_install == &variable_defined ('SUBDIRS'), given that the latter is always valid but the former only after handle_subdirs was run, the latter is safer. So I replaced each occurrence of $recursive_install (which name was quite confusing anyway IMHO) with it's definition. Hence this patch augments the robustness of the whole code, which seems more important than the performance loss it induces, and the slight obfuscation of some places of the code. Moreover, IMO, the obfuscated places (such as - $all_target = $recursive_install ? 'all-recursive' : 'all-am'; + $all_target = (&variable_defined ('SUBDIRS') + ? 'all-recursive' : 'all-am'); ) will anyway disapear from automake some day, moved into the right *.am file. Index: ChangeLog from Akim Demaille <[EMAIL PROTECTED]> * automake.in ($install_recursive): Remove, replaced with calls to `&variable_defined ('SUBDIRS')'. (&handle_dist, &handle_clean): Don't transform_cond SUBDIRS since... (&file_contents): now does. Index: automake.in --- automake.in Sat, 24 Feb 2001 13:36:54 +0100 akim (am/f/39_automake.i 1.70 755) +++ automake.in Sat, 24 Feb 2001 14:42:59 +0100 akim (am/f/39_automake.i 1.70 755) @@ -2568,11 +2568,10 @@ sub handle_tags $config .= basename ($one_hdr); } } - my $xform = &transform ('CONFIG' => $config, - 'DIRS' => join (' ', @tag_deps)); - $xform .= &transform_cond ('SUBDIRS' => &variable_defined ('SUBDIRS')); - - $output_rules .= &file_contents ('tags', $xform); + $output_rules .= + &file_contents ('tags', + &transform ('CONFIG' => $config, + 'DIRS' => join (' ', @tag_deps))); $output_rules .= &file_contents ('tags-clean'); &examine_variable ('TAGS_DEPENDENCIES'); } @@ -2783,8 +2782,6 @@ sub handle_dist 'TOP_DISTDIR' => $top_distdir) . &transform_cond ('DIST-TARGETS' => scalar @dist_targets, -'SUBDIRS' => - &variable_defined ('SUBDIRS'), 'DISTDIR' => ! &variable_defined ('distdir'))); } @@ -2955,7 +2952,8 @@ sub handle_dependencies # Handle subdirectories. sub handle_subdirs { -return if ! &variable_defined ('SUBDIRS'); +return + unless &variable_defined ('SUBDIRS'); # Make sure each directory mentioned in SUBDIRS actually exists. foreach my $dir (&variable_value_as_list ('SUBDIRS', 'all')) @@ -2980,8 +2978,6 @@ sub handle_subdirs ('INSTALLINFO' => (defined $options{'no-installinfo'} ? 'install-info-recursive' : ''))); - -$recursive_install = 1; } # Handle aclocal.m4. @@ -3540,7 +3536,7 @@ sub handle_footer sub handle_installdirs { # GNU Makefile standards recommend this. -if ($recursive_install) +if (&variable_defined ('SUBDIRS')) { # We create a separate `-am' target so that the -recursive # rule will work correctly. @@ -3644,7 +3640,7 @@ sub handle_merge_targets $output_rules .= ("all-redirect: ${local_headers}" . "\n\t" . '$(MAKE) $(AM_MAKEFLAGS) ' - . ($recursive_install + . (&variable_defined ('SUBDIRS') ? 'all-recursive' : 'all-am') . "\n\n"); $all_target = 'all-redirect'; @@ -3733,14 +3729,16 @@ sub do_one_merge_target # appropriate actual redirect. if ($all_target eq '') { - $all_target = $recursive_install ? 'all-recursive' : 'all-am'; + $all_target = (&variable_defined ('SUBDIRS') + ? 'all-recursive' : 'all-am'); } $output_all = "all: $all_target\n"; } else { - my $lname = $name . ($recursive_install ? '-recursive' : '-am'); + my $lname = ($name . + (&variable_defined ('SUBDIRS') ? '-recursive' : '-am')); &pretty_print_rule ($name . ":", "\t\t", $lname); } &depend ('.PHONY', $name . '-am', $name); @@ -3779,7 +3777,8 @@ sub do_check_merge_target &depend ('.PHONY', 'check', 'check-am'); $output_rules .= ("check: " - . ($recursive_install ? 'check-recursive' : 'check-am') + . (&variable_defined ('SUBDIRS') +? 'check-recursive' : 'check-am') . "\n"); } @@ -3816,10 +3815,7 @@ sub handle_clean . ',;'); } -$output_rules .= - &file_contents ('clea
65-install-am.patch
Index: ChangeLog from Akim Demaille <[EMAIL PROTECTED]> * automake.in (@installdirs): Remove. (&file_contents): Be able to grow Automake macros with `+='. (&handle_texinfo, &handle_man_pages, &am_install_var): Let your files define INSTALLDIRS. (&handle_installdirs): Remove the code, just output `install.am'. (&handle_factored_dependencies): Uniq dependencies. (&transform): Also call &transform_cond on your arguments. (&handle_dist): Adjust. * data.am, header.am, libs.am, lisp.am, ltlib.am, mans.am, progs.am, * python.am, scripts.am, texinfos.am: Extend $(INSTALLDIRS). Index: Makefile.in --- Makefile.in Thu, 22 Feb 2001 22:00:07 +0100 akim (am/h/16_Makefile.i 1.19 644) +++ Makefile.in Sat, 24 Feb 2001 15:37:22 +0100 akim (am/h/16_Makefile.i 1.19 644) @@ -153,7 +153,6 @@ cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= CONFIG_LINKS= $(SHELL) ./config.status aclocal: $(top_builddir)/config.status aclocal.in cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= CONFIG_LINKS= $(SHELL) ./config.status - install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(bindir) @@ -246,7 +245,6 @@ && $(MAKEINFO) `echo $< | sed 's,.*/,,'` .dvi.ps: $(DVIPS) $< -o $@ - install-info-am: $(INFO_DEPS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(infodir) @@ -312,7 +310,6 @@ rm -f $$i-[0-9]*; \ fi; \ done - install-dist_pkgdataDATA: $(dist_pkgdata_DATA) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(pkgdatadir) @@ -330,7 +327,6 @@ echo " rm -f $(DESTDIR)$(pkgdatadir)/$$f"; \ rm -f $(DESTDIR)$(pkgdatadir)/$$f; \ done - install-dist_scriptDATA: $(dist_script_DATA) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(scriptdir) @@ -537,12 +533,10 @@ all-am: Makefile $(INFO_DEPS) $(SCRIPTS) $(DATA) install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install + installdirs: installdirs-recursive installdirs-am: - $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(infodir) \ - $(DESTDIR)$(dist_pkgdatadir) \ - $(DESTDIR)$(dist_scriptdir) - + $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(infodir) +$(DESTDIR)$(pkgdatadir) $(DESTDIR)$(scriptdir) mostlyclean-generic: Index: automake.in --- automake.in Sat, 24 Feb 2001 15:01:49 +0100 akim (am/f/39_automake.i 1.72 755) +++ automake.in Sat, 24 Feb 2001 15:37:04 +0100 akim (am/f/39_automake.i 1.72 755) @@ -2438,7 +2438,6 @@ sub handle_texinfo if (! defined $options{'no-installinfo'}) { - push (@installdirs, '$(DESTDIR)$(infodir)'); # Make sure documentation is made and installed first. Use # $(INFO_DEPS), not 'info', because otherwise recursive makes # get run twice during "make all". @@ -2511,8 +2510,6 @@ sub handle_man_pages foreach my $sect (sort keys %sections) { &define_variable ('man' . $sect . 'dir', '$(mandir)/man' . $sect); - push (@installdirs, '$(DESTDIR)$(mandir)/man' . $sect) - unless defined $options{'no-installman'}; $output_rules .= &file_contents ('mans', &transform ('SECTION', $sect)); } @@ -2780,9 +2777,7 @@ sub handle_dist $xform . &transform ('DIST-TARGETS' => join (" ", @dist_targets), 'TOP_DISTDIR' => $top_distdir) - . &transform_cond ('DIST-TARGETS' => - scalar @dist_targets, -'DISTDIR' => + . &transform_cond ('DISTDIR' => ! &variable_defined ('distdir'))); } @@ -3529,26 +3524,9 @@ sub handle_footer # Deal with installdirs target. sub handle_installdirs { -# GNU Makefile standards recommend this. -if (&variable_defined ('SUBDIRS')) -{ - # We create a separate `-am' target so that the -recursive - # rule will work correctly. - $output_rules .= ("installdirs: installdirs-recursive\n" - . "installdirs-am:\n"); - &depend ('.PHONY', 'installdirs-am'); -} -else -{ - $output_rules .= "installdirs:\n"; -} -&depend ('.PHONY', 'installdirs'); -if (@installdirs) -{ - &pretty_print_rule ("\t" . '$(mkinstalldirs) ', "\t\t", - @installdirs); -} -$output_rules .= "\n"; +$output_rules .= &file_contents + ('install', + transform ('INSTALLDIRS' => $am_var_defs{'INSTALLDIRS'})); } # There are several targets which need to be merged. This is because @@ -3867,7 +3845,7 @@ sub handle_factored_dependencies next unless @{$dependencies{$_}} || $actions{$_}; &pretty_print_rule ("$_:", "\t", -
64-simplify-handle-gettext.patch
FYI, here is the top of handle_gettext. sub handle_gettext { return if ! $seen_gettext || $relative_dir ne '.'; if (! &variable_defined ('SUBDIRS')) { &am_conf_error ("AM_GNU_GETTEXT used but SUBDIRS not defined"); return; } Index: ChangeLog from Akim Demaille <[EMAIL PROTECTED]> * automake.in (&handle_gettext): Simplify redundant `if'. Index: automake.in --- automake.in Sat, 24 Feb 2001 14:51:56 +0100 akim (am/f/39_automake.i 1.71 755) +++ automake.in Sat, 24 Feb 2001 14:59:50 +0100 akim (am/f/39_automake.i 1.71 755) @@ -3433,20 +3433,14 @@ sub handle_gettext ("AM_GNU_GETTEXT used but SUBDIRS not defined"); return; } +&am_line_error ('SUBDIRS', + "AM_GNU_GETTEXT used but \`po' not in SUBDIRS") + if $contents{'SUBDIRS'} !~ /\bpo\b/; +&am_line_error ('SUBDIRS', + "AM_GNU_GETTEXT used but \`intl' not in SUBDIRS") + if $contents{'SUBDIRS'} !~ /\bintl\b/; &require_file_with_conf_line ($ac_gettext_line, $GNU, 'ABOUT-NLS'); - -if (&variable_defined ('SUBDIRS')) -{ - &am_line_error - ('SUBDIRS', -"AM_GNU_GETTEXT in \`$configure_ac' but \`po' not in SUBDIRS") - if $contents{'SUBDIRS'} !~ /\bpo\b/; - &am_line_error - ('SUBDIRS', -"AM_GNU_GETTEXT in \`$configure_ac' but \`intl' not in SUBDIRS") - if $contents{'SUBDIRS'} !~ /\bintl\b/; -} # Ensure that each language in ALL_LINGUAS has a .po file, and # each po file is mentioned in ALL_LINGUAS.
Re: 52-factored-install.patch
> "Akim" == Akim Demaille <[EMAIL PROTECTED]> writes: Akim> Here is the updated version of the patch. This patch still has a problem. See below. Akim> Note that there is a new side effect to my patch: the Akim> (un)?install-man targets appeared (since you said they were Akim> required) in Automake. I misspoke. I don't think these targets aren't required. Under --cygnus mode, `install-info' is required, but that is different. Akim> - if (defined $exec_dir_p{$X} ? $exec_dir_p{$X} : ($X =~ /exec/)) You pushed half of this test out into the *.am files. That's fine. But the second half of this test is important, and I don't understand how it is handled in the revised code. One example of how the new code can fail is a system-dependent header file install: inclexecdir = $(exec_prefix)/include ## Just an example! inclexec_HEADERS = my-config.h With the new code the header will be installed by `install-data'. However, that is wrong. `install-exec' ought to install this header. Tom
Re: 57-my-last-mying-changes.patch
> "Derek" == Derek R Price <[EMAIL PROTECTED]> writes: Derek> require 5.004; Derek> use IO::File; Derek> my $fh = new IO::File "< filetoread"; Derek> while ($fh->getline) Derek> { Derek> dostuff $_; Derek> } Switching automake to use this would be good. Tom
Re: subdirs.am and $(RECURSIVE_TARGETS)
> "Akim" == akim <[EMAIL PROTECTED]> writes: Akim> I wonder why we have a hard coded list list this in subdirs.am: Akim> [ ... -recursive targets ... ] Historical reasons only, ie, I never thought of it. Akim> Not only to I find this more pleasant, but most importantly it's Akim> a win for Automake (we can have more modular *.am files which Akim> register their own recursive targets), and it's a win for users Akim> who can += on RECURSIVE_TARGETS. In the not-too-distant past, you couldn't `+=' an internally-defined variable. Tom
subdirs.am and $(RECURSIVE_TARGETS)
(Hm, I think I killed my message instead of sending it :( Sorry if multiple copies). I wonder why we have a hard coded list list this in subdirs.am: .PHONY: all-recursive install-data-recursive install-exec-recursive \ installdirs-recursive install-recursive uninstall-recursive @INSTALLINFO@ \ check-recursive installcheck-recursive info-recursive dvi-recursive all-recursive install-data-recursive install-exec-recursive \ installdirs-recursive install-recursive uninstall-recursive @INSTALLINFO@ \ check-recursive installcheck-recursive info-recursive dvi-recursive: @set fnord $(MAKEFLAGS); amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ etc. instead of RECURSIVE_TARGETS = all-recursive install-data-recursive install-exec-recursive \ installdirs-recursive install-recursive uninstall-recursive @INSTALLINFO@ \ check-recursive installcheck-recursive info-recursive dvi-recursive .PHONY: $(RECURSIVE_TARGETS) $(RECURSIVE_TARGETS): @set fnord $(MAKEFLAGS); amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ etc. Not only to I find this more pleasant, but most importantly it's a win for Automake (we can have more modular *.am files which register their own recursive targets), and it's a win for users who can += on RECURSIVE_TARGETS. I might have missed something obvious, please no flame :)
61-atless-internal-conditionals.patch
Index: ChangeLog from Akim Demaille <[EMAIL PROTECTED]> Internally just store the conditionals as space separated lists of CONDITIONS (instead of @CONDITIONS@). * automake.in (&conditional_true_when, &variable_conditions_sub): Split conditions at spaces. (&handle_dependencies, &variable_conditions_permutations): Don't put @ around conditions. (&variable_conditions_cmp): There are no @ to strip. (&make_condition): New. (&define_pretty_variable, &read_main_am_file, &read_am_file): Use it. (&read_main_am_file, &read_am_file): Stop playing with @ by hand. Join @conditional_stack with spaces. (&read_main_am_file): Adjust the output of variables. Output `TRUE = true' under the condition `TEST' as `@TEST@TRUE = true' and no longer `@TEST@TRUE = @TEST@true'. (&variable_conditions_cmp): Rename as... (&by_condition): this. Sort in a human pleasant order. Use it everywhere a human can see conditions. (&variable_conditions_reduce): Don't sort conditions, that's pointless. * tests/cond.test, ctarget1.test, pluseq3.test: Strengthen. Index: automake.in --- automake.in Sat, 24 Feb 2001 01:48:46 +0100 akim (am/f/39_automake.i 1.68 755) +++ automake.in Sat, 24 Feb 2001 13:26:13 +0100 akim (am/f/39_automake.i 1.68 755) @@ -2926,7 +2926,7 @@ sub handle_dependencies # We define this as a conditional variable because BSD # make can't handle backslashes for continuing comments on # the following line. - &define_pretty_variable ('DEP_FILES', "\@AMDEP\@", @deplist); + &define_pretty_variable ('DEP_FILES', 'AMDEP', @deplist); # Generate each `include' individually. Irix 6 make will # not properly include several files resulting from a @@ -5283,6 +5283,24 @@ sub target_defined return defined $targets{$target}; } + +# &make_condition (@CONDITIONS) +# - +# Transform a list of conditions (themselves can be an internal list +# of conditions, e.g., @CONDITIONS = ('cond1 cond2', 'cond3')) into a +# Make conditional (a pattern for AC_SUBST). +# Correctly returns the empty string when there are no conditions. +sub make_condition +{ +my $res = join ('@@', @_); +return '' + unless $res; + +$res = '@' . $res . '@'; +$res =~ s/ /@@/; +return $res; +} + # See if two conditionals are the same. sub conditional_same { @@ -5299,11 +5317,11 @@ sub conditional_dump () { print STDERR "%conditional =\n"; print STDERR "{\n"; - foreach my $var (keys %conditional) + foreach my $var (sort keys %conditional) { print STDERR " $var = \n"; print STDERR " {\n"; - foreach my $vcond (keys %{${conditional{$var}}}) + foreach my $vcond (sort by_condition keys %{$conditional{$var}}) { print STDERR "$vcond => $conditional{$var}{$vcond}\n"; } @@ -5312,6 +5330,7 @@ sub conditional_dump () print STDERR "}\n"; } + # $BOOLEAN # &conditional_true_when ($COND, $WHEN) # - @@ -5325,13 +5344,9 @@ sub conditional_true_when ($$) my ($cond, $when) = @_; # Check each component of $cond, which looks @COND1@@COND2@. -foreach my $comp (split ('@', $cond)) +foreach my $comp (split (' ', $cond)) { - # The way we split will give null strings between each - # condition. - next if ! $comp; - - if (index ($when, '@' . $comp . '@') == -1) + if (index ($when, $comp) == -1) { return 0; } @@ -5468,7 +5483,7 @@ sub variable_conditions $uniqify{$cond} = 1; } -@uniq_list = sort keys %uniqify; +@uniq_list = sort by_condition keys %uniqify; # Note we cannot just do `return sort keys %uniqify', because this # function is sometimes used in a scalar context. return @uniq_list; @@ -5510,9 +5525,8 @@ sub variable_conditions_sub my %allconds = (); foreach my $item (@new_conds) { - foreach (split ('@', $item)) + foreach (split (' ', $item)) { - next if ! $_; s/_(TRUE|FALSE)$//; $allconds{$_ . '_TRUE'} = 1; } @@ -5577,7 +5591,7 @@ sub variable_conditions_sub foreach my $this_cond (@this_conds) { my @perms = - &variable_conditions_permutations (split('@', $this_cond)); + &variable_conditions_permutations (split(' ', $this_cond)); foreach my $perm (@perms) { my $ok = 1; @@ -5604,25 +5618,32 @@ sub variable_conditions_sub return @new_conds; } -# Subroutine for variable_conditions_sort -sub variable_conditions_cmp -{ -my $as = $a; -$as =~ s/[^@]//g; -my $bs = $b; -$bs =~ s/[^@]//g; -return (length ($as) <=> length ($bs) + +# Compare condition names. +# Issue them i
62-found-dead-found.patch
Index: ChangeLog from Akim Demaille <[EMAIL PROTECTED]> * automake.in (&handle_man_pages): $found is dead. Index: automake.in --- automake.in Sat, 24 Feb 2001 13:30:31 +0100 akim (am/f/39_automake.i 1.69 755) +++ automake.in Sat, 24 Feb 2001 13:35:08 +0100 akim (am/f/39_automake.i 1.69 755) @@ -2488,7 +2488,6 @@ sub handle_man_pages { $sections{$sect} = 1; $vlist{'$(man' . $sect . '_MANS)'} = 1; - $found = 1; } } @@ -2501,7 +2500,6 @@ sub handle_man_pages if (/\.([0-9a-z])([a-z]*)$/) { $sections{$1} = 1; - $found = 1; } } }
60-mying-changes.patches
Index: ChangeLog from Akim Demaille <[EMAIL PROTECTED]> * automake.in: `my' the globals. Index: automake.in --- automake.in Fri, 23 Feb 2001 00:01:11 +0100 akim (am/f/39_automake.i 1.67 755) +++ automake.in Sat, 24 Feb 2001 01:48:00 +0100 akim (am/f/39_automake.i 1.67 755) @@ -31,56 +31,56 @@ # Parameters set by configure. Not to be changed. NOTE: assign # VERSION as string so that eg version 0.30 will print correctly. -$VERSION = "@VERSION@"; -$PACKAGE = "@PACKAGE@"; -$prefix = "@prefix@"; -$am_dir = "@datadir@/@PACKAGE@"; +my $VERSION = "@VERSION@"; +my $PACKAGE = "@PACKAGE@"; +my $prefix = "@prefix@"; +my $am_dir = "@datadir@/@PACKAGE@"; # String constants. -$IGNORE_PATTERN = "^##([^#].*)?\$"; -$WHITE_PATTERN = "^[ \t]*\$"; -$COMMENT_PATTERN = "^#"; -$TARGET_PATTERN="[\$a-zA-Z_.][-.a-zA-Z0-9_(){}/\$]*"; -$RULE_PATTERN = "^($TARGET_PATTERN) *:([^=].*|)\$"; -$SUFFIX_RULE_PATTERN = "^\\.([a-zA-Z0-9]+)\\.([a-zA-Z0-9]+)\$"; +my $IGNORE_PATTERN = "^##([^#].*)?\$"; +my $WHITE_PATTERN = "^[ \t]*\$"; +my $COMMENT_PATTERN = "^#"; +my $TARGET_PATTERN="[\$a-zA-Z_.][-.a-zA-Z0-9_(){}/\$]*"; +my $RULE_PATTERN = "^($TARGET_PATTERN) *:([^=].*|)\$"; +my $SUFFIX_RULE_PATTERN = "^\\.([a-zA-Z0-9]+)\\.([a-zA-Z0-9]+)\$"; # Only recognize leading spaces, not leading tabs. If we recognize # leading tabs here then we need to make the reader smarter, because # otherwise it will think rules like `foo=bar; \' are errors. -$MACRO_PATTERN = "^ *([A-Za-z0-9_\@]+)[ \t]*([:+]?)=[ \t]*(.*)\$"; -$BOGUS_MACRO_PATTERN = "^ *([^ \t]*)[ \t]*([:+]?)=[ \t]*(.*)\$"; -$GNITS_VERSION_PATTERN = "[0-9]+\\.[0-9]+([a-z]|\\.[0-9]+)?"; -$IF_PATTERN = "^if[ \t]+\([A-Za-z][A-Za-z0-9_]*\)[ \t]*\(#.*\)?\$"; -$ELSE_PATTERN = "^else[ \t]*\(#.*\)?\$"; -$ENDIF_PATTERN = "^endif[ \t]*\(#.*\)?\$"; -$PATH_PATTERN='(\\w|[/.-])+'; +my $MACRO_PATTERN = "^ *([A-Za-z0-9_\@]+)[ \t]*([:+]?)=[ \t]*(.*)\$"; +my $BOGUS_MACRO_PATTERN = "^ *([^ \t]*)[ \t]*([:+]?)=[ \t]*(.*)\$"; +my $GNITS_VERSION_PATTERN = "[0-9]+\\.[0-9]+([a-z]|\\.[0-9]+)?"; +my $IF_PATTERN = "^if[ \t]+\([A-Za-z][A-Za-z0-9_]*\)[ \t]*\(#.*\)?\$"; +my $ELSE_PATTERN = "^else[ \t]*\(#.*\)?\$"; +my $ENDIF_PATTERN = "^endif[ \t]*\(#.*\)?\$"; +my $PATH_PATTERN='(\\w|[/.-])+'; # This will pass through anything not of the prescribed form. -$INCLUDE_PATTERN = "^include[ \t]+((\\\$\\\(top_srcdir\\\)/${PATH_PATTERN})|(\\\$\\\(srcdir\\\)/${PATH_PATTERN})|([^/\\\$]${PATH_PATTERN}))[ \t]*(#.*)?\$"; +my $INCLUDE_PATTERN = "^include[ +\t]+((\\\$\\\(top_srcdir\\\)/${PATH_PATTERN})|(\\\$\\\(srcdir\\\)/${PATH_PATTERN})|([^/\\\$]${PATH_PATTERN}))[ + \t]*(#.*)?\$"; # Some regular expressions. One reason to put them here is that it # makes indentation work better in Emacs. -$AC_CONFIG_AUX_DIR_PATTERN = "AC_CONFIG_AUX_DIR\\(([^)]+)\\)"; -$AM_INIT_AUTOMAKE_PATTERN = "AM_INIT_AUTOMAKE\\([^,]*,([^,)]+)[,)]"; -$AM_PACKAGE_VERSION_PATTERN = "^\\s*\\[?([^]\\s]+)\\]?\\s*\$"; +my $AC_CONFIG_AUX_DIR_PATTERN = "AC_CONFIG_AUX_DIR\\(([^)]+)\\)"; +my $AM_INIT_AUTOMAKE_PATTERN = "AM_INIT_AUTOMAKE\\([^,]*,([^,)]+)[,)]"; +my $AM_PACKAGE_VERSION_PATTERN = "^\\s*\\[?([^]\\s]+)\\]?\\s*\$"; # Note that there is no AC_PATH_TOOL. But we don't really care. -$AC_CHECK_PATTERN = "AC_(CHECK|PATH)_(PROG|PROGS|TOOL)\\(\\[?(\\w+)"; -$AM_MISSING_PATTERN = "AM_MISSING_PROG\\(\\[?(\\w+)"; +my $AC_CHECK_PATTERN = "AC_(CHECK|PATH)_(PROG|PROGS|TOOL)\\(\\[?(\\w+)"; +my $AM_MISSING_PATTERN = "AM_MISSING_PROG\\(\\[?(\\w+)"; # Just check for alphanumeric in AC_SUBST. If you do AC_SUBST(5), # then too bad. -$AC_SUBST_PATTERN = "AC_SUBST\\(\\[?(\\w+)"; -$AM_CONDITIONAL_PATTERN = "AM_CONDITIONAL\\((\\w+)"; +my $AC_SUBST_PATTERN = "AC_SUBST\\(\\[?(\\w+)"; +my $AM_CONDITIONAL_PATTERN = "AM_CONDITIONAL\\((\\w+)"; # Constants to define the "strictness" level. -$FOREIGN = 0; -$GNU = 1; -$GNITS = 2; +my $FOREIGN = 0; +my $GNU = 1; +my $GNITS = 2; # These constants are returned by lang_*_rewrite functions. # LANG_SUBDIR means that the resulting object file should be in a # subdir if the source file is. In this case the file name cannot # have `..' components. -$LANG_IGNORE = 0; -$LANG_PROCESS = 1; -$LANG_SUBDIR = 2; +my $LANG_IGNORE = 0; +my $LANG_PROCESS = 1; +my $LANG_SUBDIR = 2; @@ -89,161 +89,161 @@ # Variables related to the options. # TRUE if we should always generate Makefile.in. -$force_generation = 1; +my $force_generation = 1; # Strictness level as set on command line. -$default_strictness = $GNU; +my $default_strictness = $GNU; # Name of strictness level, as set on command line. -$default_strictness_name = 'gnu'; +my $default_strictness_name = 'gnu'; # This is TRUE if automatic dependency generation code should be # included in generated Makefile.in. -$cmdline_use_dependencies = 1; +my $cmdline_use_dependencies = 1; # TRUE if in verbose mode. -$verbose = 0; +my $verbose = 0; # This holds our (eventual) exit status. We don't actually exit until # we have processed all input files. -$exit_status = 0; +my $