+2004-01-10 Alexandre Duret-Lutz <adl@gnu.org>
+
+ * 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 <adl@gnu.org>
* m4/mkdirp.m4 (AM_PROG_MKDIR_P): Append `.' to $(mkdir_p).
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.
+
\f
New in 1.8:
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)
# ---------------------------
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,
# 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,
EXEC => $exec_p,
INSTALL => $install_p,
DIST => $dist_p,
+ DISTVAR => $distvar,
'CK-OPTS' => $check_options_p);
}
## 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
## -------------- ##
if %?DIST%
-DIST_COMMON += $(%DIR%_JAVA)
+DIST_COMMON += %DISTVAR%
endif %?DIST%