From 5f8973ade44a6ba5a12c5c591471e986790c25da Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Sat, 10 Jan 2004 00:24:28 +0000 Subject: [PATCH] * automake.in (shadow_unconditionally): New function... (handle_source_transform): ... extracted from here. (am_install_var): Use shadow_unconditionally to define %DISTVAR%. * lib/am/data.am, lib/am/java.am, lib/am/lisp.am, lib/am/python.am, lib/am/script.am: Add %DISTVAR% to DIST_COMMON. * tests/cond33.test: Make sure all conditional files are distributed. Report from Ralf Corsepius. --- ChangeLog | 10 ++++++++++ NEWS | 8 ++++++++ automake.in | 42 +++++++++++++++++++++++++++--------------- lib/am/data.am | 2 +- lib/am/java.am | 4 ++-- lib/am/lisp.am | 2 +- lib/am/python.am | 2 +- lib/am/scripts.am | 2 +- tests/cond33.test | 4 ++++ 9 files changed, 55 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index 720eb484..ffd0ae15 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2004-01-10 Alexandre Duret-Lutz + + * automake.in (shadow_unconditionally): New function... + (handle_source_transform): ... extracted from here. + (am_install_var): Use shadow_unconditionally to define %DISTVAR%. + * lib/am/data.am, lib/am/java.am, lib/am/lisp.am, lib/am/python.am, + lib/am/script.am: Add %DISTVAR% to DIST_COMMON. + * tests/cond33.test: Make sure all conditional files are distributed. + Report from Ralf Corsepius. + 2004-01-08 Alexandre Duret-Lutz * m4/mkdirp.m4 (AM_PROG_MKDIR_P): Append `.' to $(mkdir_p). diff --git a/NEWS b/NEWS index 9671ab21..50f38c97 100644 --- a/NEWS +++ b/NEWS @@ -17,6 +17,14 @@ New in 1.8a: the two .o and .obj rules for usual objects, or the .lo rule for libtool objects. +* Bug fixes. + + - Distribute all files, even those which are built and installed + conditionally. This change affects files listed in conditionally + defined *_HEADERS and *_PYTHON variable (unless they are nodist_*) + as well as those listed in conditionally defined dist_*_DATA, + dist_*_JAVA, dist_*_LISP, and dist_*_SCRIPTS variables. + New in 1.8: diff --git a/automake.in b/automake.in index 413db5c7..3d770617 100755 --- a/automake.in +++ b/automake.in @@ -982,6 +982,25 @@ sub handle_options return 0; } +# shadow_unconditionally ($varname, $where) +# ----------------------------------------- +# Return a $(variable) that contains all possible values +# $varname can take. +# If the VAR wasn't defined conditionally, return $(VAR). +# Otherwise we create a am__VAR_DIST variable which contains +# all possible values, and return $(am__VAR_DIST). +sub shadow_unconditionally ($$) +{ + my ($varname, $where) = @_; + my $var = var $varname; + if ($var->has_conditional_contents) + { + $varname = "am__${varname}_DIST"; + my @files = uniq ($var->value_as_list_recursive); + define_pretty_variable ($varname, TRUE, $where, @files); + } + return "\$($varname)" +} # get_object_extension ($OUT) # --------------------------- @@ -1845,21 +1864,8 @@ sub handle_source_transform ($$$$%) unless $prefix =~ /EXTRA_/; push @sources, "\$($varname)"; - if (! option 'no-dist' && $prefix !~ /^nodist_/) - { - # If the VAR wasn't defined conditionally, we add - # it to DIST_SOURCES as is. Otherwise we create a - # am__VAR_DIST variable which contains all possible values, - # and add this variable to DIST_SOURCES. - my $distvar = $varname; - if ($var->has_conditional_contents) - { - $distvar = "am__${varname}_DIST"; - my @files = uniq ($var->value_as_list_recursive); - define_pretty_variable ($distvar, TRUE, $where, @files); - } - push @dist_sources, "\$($distvar)" - } + push @dist_sources, shadow_unconditionally ($varname, $where) + unless (option ('no-dist') || $prefix =~ /^nodist_/); $needlinker |= define_objects_from_sources ($varname, @@ -6458,6 +6464,11 @@ sub am_install_var # Use the location of the currently processed variable as context. $where->push_context ("while processing `$one_name'"); + # The variable containing all file to distribute. + my $distvar = "\$($one_name)"; + $distvar = shadow_unconditionally ($one_name, $where) + if ($dist_p && $one_var->has_conditional_contents); + # Singular form of $PRIMARY. (my $one_primary = $primary) =~ s/S$//; $output_rules .= &file_contents ($file, $where, @@ -6470,6 +6481,7 @@ sub am_install_var EXEC => $exec_p, INSTALL => $install_p, DIST => $dist_p, + DISTVAR => $distvar, 'CK-OPTS' => $check_options_p); } diff --git a/lib/am/data.am b/lib/am/data.am index b0fc1edf..2ff1e644 100644 --- a/lib/am/data.am +++ b/lib/am/data.am @@ -83,5 +83,5 @@ endif %?INSTALL% ## -------------- ## if %?DIST% -DIST_COMMON += $(%DIR%_%PRIMARY%) +DIST_COMMON += %DISTVAR% endif %?DIST% diff --git a/lib/am/java.am b/lib/am/java.am index bc9943da..04b6ec89 100644 --- a/lib/am/java.am +++ b/lib/am/java.am @@ -1,5 +1,5 @@ ## automake - create Makefile.in from Makefile.am -## Copyright (C) 1998, 1999, 2001, 2003 Free Software Foundation, Inc. +## Copyright (C) 1998, 1999, 2001, 2003, 2004 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 @@ -84,5 +84,5 @@ clean-%DIR%JAVA: ## -------------- ## if %?DIST% -DIST_COMMON += $(%DIR%_JAVA) +DIST_COMMON += %DISTVAR% endif %?DIST% diff --git a/lib/am/lisp.am b/lib/am/lisp.am index 85dec947..492e2904 100644 --- a/lib/am/lisp.am +++ b/lib/am/lisp.am @@ -119,5 +119,5 @@ clean-lisp: ## -------------- ## if %?DIST% -DIST_COMMON += $(%DIR%_LISP) +DIST_COMMON += %DISTVAR% endif %?DIST% diff --git a/lib/am/python.am b/lib/am/python.am index de12d788..e6cf68b9 100644 --- a/lib/am/python.am +++ b/lib/am/python.am @@ -90,5 +90,5 @@ endif %?INSTALL% ## -------------- ## if %?DIST% -DIST_COMMON += $(%DIR%_PYTHON) +DIST_COMMON += %DISTVAR% endif %?DIST% diff --git a/lib/am/scripts.am b/lib/am/scripts.am index 74ca10c0..74e327b1 100644 --- a/lib/am/scripts.am +++ b/lib/am/scripts.am @@ -88,7 +88,7 @@ endif %?INSTALL% ## -------------- ## if %?DIST% -DIST_COMMON += $(%DIR%_SCRIPTS) +DIST_COMMON += %DISTVAR% endif %?DIST% diff --git a/tests/cond33.test b/tests/cond33.test index 3896ce23..a4d30013 100755 --- a/tests/cond33.test +++ b/tests/cond33.test @@ -41,6 +41,9 @@ endif foo.h x.sh: :>$@ +distdircheck: distdir + test -f $(distdir)/foo.h + test -f $(distdir)/x.sh EOF $ACLOCAL @@ -67,3 +70,4 @@ test -f bin/x.sh $MAKE installdirs test ! -d inc test -d bin +$MAKE distdircheck -- 2.43.5