]> sourceware.org Git - automake.git/commitdiff
* automake.in (shadow_unconditionally): New function...
authorAlexandre Duret-Lutz <adl@gnu.org>
Sat, 10 Jan 2004 00:24:28 +0000 (00:24 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Sat, 10 Jan 2004 00:24:28 +0000 (00:24 +0000)
(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
NEWS
automake.in
lib/am/data.am
lib/am/java.am
lib/am/lisp.am
lib/am/python.am
lib/am/scripts.am
tests/cond33.test

index 720eb484a96c05b6a5fe54d1c6c7d750ac9f2bdc..ffd0ae1556738fa6525ed5c2073027fcfdb3c235 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+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).
diff --git a/NEWS b/NEWS
index 9671ab2164411ff56d08f67558485e5a6cd3960a..50f38c97ddd28c4c7514eaad680ea9e6dd69b9ec 100644 (file)
--- 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.
+
 \f
 New in 1.8:
 
index 413db5c7d930f886825eb88b46b0c8e82940a63d..3d770617c8cb65a704ec3f9790437a3bcccecfd3 100755 (executable)
@@ -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);
     }
 
index b0fc1edfb3e723c3a02390348426a4ff5120d8f4..2ff1e644c1973324fec1aff6f9eb30dc4f2cdf17 100644 (file)
@@ -83,5 +83,5 @@ endif %?INSTALL%
 ## -------------- ##
 
 if %?DIST%
-DIST_COMMON += $(%DIR%_%PRIMARY%)
+DIST_COMMON += %DISTVAR%
 endif %?DIST%
index bc9943dacb70db08f3430ac6f629145fd60f7a00..04b6ec89f3e0f3da876626edb141b631515aeb3d 100644 (file)
@@ -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%
index 85dec94761e57e0325433e364454eaefede99b71..492e2904ff27ae567a3d213829d756f68d80be66 100644 (file)
@@ -119,5 +119,5 @@ clean-lisp:
 ## -------------- ##
 
 if %?DIST%
-DIST_COMMON += $(%DIR%_LISP)
+DIST_COMMON += %DISTVAR%
 endif %?DIST%
index de12d78836960523c98d36dc1235891c9f05de77..e6cf68b953c89185b4d749435899637087043628 100644 (file)
@@ -90,5 +90,5 @@ endif %?INSTALL%
 ## -------------- ##
 
 if %?DIST%
-DIST_COMMON += $(%DIR%_PYTHON)
+DIST_COMMON += %DISTVAR%
 endif %?DIST%
index 74ca10c0ba0489b22a9632969c53ae03123e279a..74e327b1fbd12fbddc3a631c56654ae1f2c27895 100644 (file)
@@ -88,7 +88,7 @@ endif %?INSTALL%
 ## -------------- ##
 
 if %?DIST%
-DIST_COMMON += $(%DIR%_SCRIPTS)
+DIST_COMMON += %DISTVAR%
 endif %?DIST%
 
 
index 3896ce23ac6c140a228cf31f32a6b971e73a69ee..a4d30013f6d283d65a765007df35d73868a5583a 100755 (executable)
@@ -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
This page took 0.059752 seconds and 5 git commands to generate.