]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
* automake.in (handle_dist): Always define DIST_SUBDIRS, even when
authorAlexandre Duret-Lutz <adl@gnu.org>
Sat, 15 May 2004 21:01:04 +0000 (21:01 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Sat, 15 May 2004 21:01:04 +0000 (21:01 +0000)
the no-dist or cygnus options are used.
* tests/clean2.test: New file.
* tests/Makefile.am (TESTS): Add clean2.test.
Report from Daniel Jacobowitz.

ChangeLog
THANKS
automake.in
tests/Makefile.am
tests/Makefile.in
tests/clean2.test [new file with mode: 0755]

index db6ac5f32fdb7a2bb4548407fffcbf6595a51959..6bee49ae09fed09859cb81b3bb6e34479c667f2b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2004-05-15  Alexandre Duret-Lutz  <adl@gnu.org>
 
+       * automake.in (handle_dist): Always define DIST_SUBDIRS, even when
+       the no-dist or cygnus options are used.
+       * tests/clean2.test: New file.
+       * tests/Makefile.am (TESTS): Add clean2.test.
+       Report from Daniel Jacobowitz.
+
        * aclocal.in (add_macro): Do not error out on undefined required
        macros.  We are not sure they are really used, and Autoconf
        already diagnoses them.
diff --git a/THANKS b/THANKS
index bd427043d32745fa4c99f26218350b330f28f186..f9053575546b99c7c90e049a83a2e4b3523aa196 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -42,6 +42,7 @@ Chris Provenzano      proven@io.proven.org
 Christian Cornelssen   ccorn@cs.tu-berlin.de
 Dalibor Topic          robilad@kaffe.org
 danbp                  danpb@nospam.postmaster.co.uk
+Daniel Jacobowitz      drow@false.org
 Dave Brolley           brolley@redhat.com
 Dave Morrison          dave@bnl.gov
 David A. Swierczek     swiercze@mr.med.ge.com
index 97e0cb70537b357d99e515a9f8069701caaefe38..7fb98326c50d1d7f8c932454bbba84c7b097bb9c 100755 (executable)
@@ -3358,6 +3358,49 @@ sub for_dist_common
 # Handle 'dist' target.
 sub handle_dist ()
 {
+  # Substutions for distdit.am
+  my %transform;
+
+  # Define DIST_SUBDIRS.  This must always be done, regardless of the
+  # no-dist setting: target like `distclean' or `maintainer-clean' use it.
+  my $subdirs = var ('SUBDIRS');
+  if ($subdirs)
+    {
+      # If SUBDIRS is conditionally defined, then set DIST_SUBDIRS
+      # to all possible directories, and use it.  If DIST_SUBDIRS is
+      # defined, just use it.
+      my $dist_subdir_name;
+      # Note that we check DIST_SUBDIRS first on purpose, so that
+      # we don't call has_conditional_contents for now reason.
+      # (In the past one project used so many conditional subdirectories
+      # that calling has_conditional_contents on SUBDIRS caused
+      # automake to grow to 150Mb -- this should not happen with
+      # the current implementation of has_conditional_contents,
+      # but it's more efficient to avoid the call anyway.)
+      if (var ('DIST_SUBDIRS'))
+       {
+         $dist_subdir_name = 'DIST_SUBDIRS';
+       }
+      elsif ($subdirs->has_conditional_contents)
+       {
+         $dist_subdir_name = 'DIST_SUBDIRS';
+         define_pretty_variable
+           ('DIST_SUBDIRS', TRUE, INTERNAL,
+            uniq ($subdirs->value_as_list_recursive));
+       }
+      else
+       {
+         $dist_subdir_name = 'SUBDIRS';
+         # We always define this because that is what `distclean'
+         # wants.
+         define_pretty_variable ('DIST_SUBDIRS', TRUE, INTERNAL,
+                                 '$(SUBDIRS)');
+       }
+
+      $transform{'DIST_SUBDIR_NAME'} = $dist_subdir_name;
+    }
+
+  # The remaining definitions are only required when a dist target is used.
   return if option 'no-dist';
 
   # At least one of the archive formats must be enabled.
@@ -3460,59 +3503,19 @@ sub handle_dist ()
        unless $_ eq '.';
     }
 
-  # Rule to check whether a distribution is viable.
-  my %transform = ('DISTCHECK-HOOK' => !! rule 'distcheck-hook',
-                  'GETTEXT' => $seen_gettext && !$seen_gettext_external);
+  $transform{'DISTCHECK-HOOK'} = !! rule 'distcheck-hook';
+  $transform{'GETTEXT'} = $seen_gettext && !$seen_gettext_external;
 
   # Prepend $(distdir) to each directory given.
   my %rewritten = map { '$(distdir)/' . "$_" => 1 } keys %dist_dirs;
   $transform{'DISTDIRS'} = join (' ', sort keys %rewritten);
 
-  # If we have SUBDIRS, create all dist subdirectories and do
-  # recursive build.
-  my $subdirs = var ('SUBDIRS');
-  if ($subdirs)
-    {
-      # If SUBDIRS is conditionally defined, then set DIST_SUBDIRS
-      # to all possible directories, and use it.  If DIST_SUBDIRS is
-      # defined, just use it.
-      my $dist_subdir_name;
-      # Note that we check DIST_SUBDIRS first on purpose, so that
-      # we don't call has_conditional_contents for now reason.
-      # (In the past one project used so many conditional subdirectories
-      # that calling has_conditional_contents on SUBDIRS caused
-      # automake to grow to 150Mb -- this should not happen with
-      # the current implementation of has_conditional_contents,
-      # but it's more efficient to avoid the call anyway.)
-      if (var ('DIST_SUBDIRS'))
-       {
-         $dist_subdir_name = 'DIST_SUBDIRS';
-       }
-      elsif ($subdirs->has_conditional_contents)
-       {
-         $dist_subdir_name = 'DIST_SUBDIRS';
-         define_pretty_variable
-           ('DIST_SUBDIRS', TRUE, INTERNAL,
-            uniq ($subdirs->value_as_list_recursive));
-       }
-      else
-       {
-         $dist_subdir_name = 'SUBDIRS';
-         # We always define this because that is what `distclean'
-         # wants.
-         define_pretty_variable ('DIST_SUBDIRS', TRUE, INTERNAL,
-                                 '$(SUBDIRS)');
-       }
-
-      $transform{'DIST_SUBDIR_NAME'} = $dist_subdir_name;
-    }
-
   # If the target `dist-hook' exists, make sure it is run.  This
   # allows users to do random weird things to the distribution
   # before it is packaged up.
   push (@dist_targets, 'dist-hook')
     if rule 'dist-hook';
-  $transform{'DIST-TARGETS'} = join(' ', @dist_targets);
+  $transform{'DIST-TARGETS'} = join (' ', @dist_targets);
 
   my $flm = option ('filename-length-max');
   my $filename_filter = $flm ? '.' x $flm->[1] : '';
index 507aae15a92c3216b552a3d295c1dbccaf811027..600f93b01cb20c6677c7fcfc2e5bb554b0cf3630 100644 (file)
@@ -75,6 +75,7 @@ check2.test \
 check3.test \
 checkall.test \
 clean.test \
+clean2.test \
 colneq.test \
 colneq2.test \
 colon.test \
index 561e602435f19b654bb339eb431ee132ccb51259..d898a466ba80dac6bcdb2bfccae48ebf6324eae4 100644 (file)
@@ -192,6 +192,7 @@ check2.test \
 check3.test \
 checkall.test \
 clean.test \
+clean2.test \
 colneq.test \
 colneq2.test \
 colon.test \
diff --git a/tests/clean2.test b/tests/clean2.test
new file mode 100755 (executable)
index 0000000..23a54f3
--- /dev/null
@@ -0,0 +1,57 @@
+#! /bin/sh
+# Copyright (C) 2004  Free Software Foundation, Inc.
+#
+# This file is part of GNU Automake.
+#
+# GNU Automake is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# GNU Automake is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Automake; see the file COPYING.  If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# Make sure distclean works in cygnus mode.
+# Report from Daniel Jacobowitz
+
+. ./defs || exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AM_MAINTAINER_MODE
+AC_CONFIG_FILES([sub/Makefile])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+SUBDIRS = sub
+END
+
+mkdir sub
+
+cat > sub/Makefile.am << 'END'
+data_DATA = foo
+
+foo:
+       touch $@
+
+CLEANFILES = $(data_DATA)
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE --cygnus
+
+./configure
+$MAKE
+test -f sub/foo
+$MAKE distclean
+test ! -f sub/foo