From: Akim Demaille Date: Tue, 10 Apr 2001 09:20:59 +0000 (+0000) Subject: * automake.in (&scan_aclocal_m4): Handle $relative_dir and special X-Git-Tag: handle-languages~71 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=89e14a3826884463fa919f9a5a3d16f617a2637e;p=automake.git * automake.in (&scan_aclocal_m4): Handle $relative_dir and special variables. Specify to the caller whether $regen_aclocal_m4. (&handle_configure): Adjust. Transform `REGEN-ACLOCAL-M4'. * configure.am: Use it. * tests/defs (me): New. * tests/configdeps.test: New. --- diff --git a/ChangeLog b/ChangeLog index 3b1277b0..ee1c9e95 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2001-04-10 Akim Demaille + + * automake.in (&scan_aclocal_m4): Handle $relative_dir and special + variables. + Specify to the caller whether $regen_aclocal_m4. + (&handle_configure): Adjust. + Transform `REGEN-ACLOCAL-M4'. + * configure.am: Use it. + * tests/defs (me): New. + * tests/configdeps.test: New. + 2001-04-09 Tom Tromey * m4/missing.m4 (AM_MISSING_HAS_RUN): Use `true', not `:'. diff --git a/automake.in b/automake.in index 03e7653d..c86f5bad 100755 --- a/automake.in +++ b/automake.in @@ -3155,13 +3155,20 @@ sub handle_subdirs } -# @DEPENDENCIES +# ($REGEN, @DEPENDENCIES) # &scan_aclocal_m4 # ---------------- # If aclocal.m4 creation is automated, return the list of its dependencies. sub scan_aclocal_m4 { my $regen_aclocal = 0; + + return (0, ()) + unless $relative_dir eq '.'; + + &examine_variable ('CONFIG_STATUS_DEPENDENCIES'); + &examine_variable ('CONFIGURE_DEPENDENCIES'); + if (-f 'aclocal.m4') { &define_variable ("ACLOCAL_M4", '$(top_srcdir)/aclocal.m4'); @@ -3180,21 +3187,14 @@ sub scan_aclocal_m4 } } - my $acinclude = 0; + my @ac_deps = (); + if (-f 'acinclude.m4') { $regen_aclocal = 1; - $acinclude = 1; + push @ac_deps, 'acinclude.m4'; } - return () - unless $regen_aclocal; - - # Note that it might be possible that aclocal.m4 doesn't exist but - # should be auto-generated. This case probably isn't very - # important. - my @ac_deps = ($acinclude ? ' acinclude.m4' : ''); - if (&variable_defined ('ACLOCAL_M4_SOURCES')) { push (@ac_deps, '$(ACLOCAL_M4_SOURCES)'); @@ -3226,7 +3226,12 @@ sub scan_aclocal_m4 } } } - return @ac_deps; + + # Note that it might be possible that aclocal.m4 doesn't exist but + # should be auto-generated. This case probably isn't very + # important. + + return ($regen_aclocal, @ac_deps); } # Rewrite a list of input files into a form suitable to put on a @@ -3283,14 +3288,7 @@ sub handle_configure my @rewritten = &rewrite_inputs_into_dependencies (1, @secondary_inputs); - my @aclocal_m4_deps; - if ($relative_dir eq '.') - { - @aclocal_m4_deps = &scan_aclocal_m4 (); - &examine_variable ('CONFIG_STATUS_DEPENDENCIES'); - &examine_variable ('CONFIGURE_DEPENDENCIES'); - } - + my ($regen_aclocal_m4, @aclocal_m4_deps) = scan_aclocal_m4 (); $output_rules .= &file_contents ('configure', @@ -3313,6 +3311,8 @@ sub handle_configure => $cmdline_use_dependencies ? '' : ' --ignore-deps', 'MAKEFILE-AM-SOURCES' => "$input$colon_infile", + 'REGEN-ACLOCAL-M4' + => $regen_aclocal_m4, 'ACLOCAL_M4_DEPS' => join (' ', @aclocal_m4_deps))); diff --git a/configure.am b/configure.am index 05d1f9bd..bbae72c3 100644 --- a/configure.am +++ b/configure.am @@ -61,6 +61,8 @@ endif %?TOPDIR_P% ## ------------ ## if %?TOPDIR_P% +if %?REGEN-ACLOCAL-M4% $(ACLOCAL_M4): %MAINTAINER-MODE% %CONFIGURE-AC% %ACLOCAL_M4_DEPS% cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +endif %?REGEN-ACLOCAL-M4% endif %?TOPDIR_P% diff --git a/lib/am/configure.am b/lib/am/configure.am index 05d1f9bd..bbae72c3 100644 --- a/lib/am/configure.am +++ b/lib/am/configure.am @@ -61,6 +61,8 @@ endif %?TOPDIR_P% ## ------------ ## if %?TOPDIR_P% +if %?REGEN-ACLOCAL-M4% $(ACLOCAL_M4): %MAINTAINER-MODE% %CONFIGURE-AC% %ACLOCAL_M4_DEPS% cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +endif %?REGEN-ACLOCAL-M4% endif %?TOPDIR_P% diff --git a/tests/Makefile.am b/tests/Makefile.am index 7d78ef2e..b95e38d1 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -64,6 +64,7 @@ condlib.test \ condman.test \ condman2.test \ conf2.test \ +confdeps.test \ confdist.test \ confh.test \ confh2.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index fbdb3a65..adbe30eb 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -137,6 +137,7 @@ condlib.test \ condman.test \ condman2.test \ conf2.test \ +confdeps.test \ confdist.test \ confh.test \ confh2.test \ diff --git a/tests/defs b/tests/defs index 1b91c03f..d5d9a36c 100644 --- a/tests/defs +++ b/tests/defs @@ -8,6 +8,8 @@ test -f $srcdir/defs || { exit 1 } +me=`echo "$0" | sed -e 's,.*[\\/],,;s/\.test$//'` + # Always use an absolute srcdir. Otherwise symlinks made in subdirs # of the test dir just won't work. case "$srcdir" in