automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Creating subdirs of distdir


From: Alexandre Duret-Lutz
Subject: Re: Creating subdirs of distdir
Date: Fri, 04 Aug 2006 14:54:23 +0200
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/22.0.50 (gnu/linux)

Thank you, and sorry for the delay.

I'm installing this as follows, removing another reference to
DISTDIRS in dist.am, fixing distdir.test so it passes, and
fixing the (c) year of pr2.test,

2006-08-04  Stepan Kasal  <address@hidden>

        * automake.in (dist_dirs, fill_dist_dirs): Remove.
        * lib/am/distdir.am (DISTDIRS): Remove.
        * tests/distdir.test, tests/pr2.test: Do not grep, use
        `make distdir' instead.

Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1625
diff -u -r1.1625 automake.in
--- automake.in 4 Aug 2006 10:23:14 -0000       1.1625
+++ automake.in 4 Aug 2006 12:53:16 -0000
@@ -489,11 +489,6 @@
 # This holds the set of included files.
 my @include_stack;
 
-# This holds a list of directories which we must create at `dist'
-# time.  This is used in some strange scenarios involving weird
-# AC_OUTPUT commands.
-my %dist_dirs;
-
 # List of dependencies for the obvious targets.
 my @all;
 my @check;
@@ -647,8 +642,6 @@
 
     @include_stack = ();
 
-    %dist_dirs = ();
-
     @all = ();
     @check = ();
     @check_tests = ();
@@ -3536,24 +3529,6 @@
     return $a cmp $b;
 }
 
-# fill_dist_dirs(@FILES)
-# ----------------------
-# Record in %dist_dirs the directory part of any file passed.
-sub fill_dist_dirs (@)
-{
-  my @copy = @_;
-  foreach (@copy)
-    {
-      s/\$\(top_srcdir\)/$topsrcdir/;
-      s/\$\(srcdir\)/./;
-      # Strip any leading `./'.
-      s,^(:?\./+)*,,;
-      next unless s,/+[^/]+$,,;
-      $dist_dirs{$_} = 1
-       unless $_ eq '.';
-    }
-}
-
 # handle_dist
 # -----------
 # Handle 'dist' target.
@@ -3670,26 +3645,10 @@
   # originally, but there were so many requests that I finally
   # relented.
   my $extra_dist = var ('EXTRA_DIST');
-  # FIXME: This should be fixed to work with conditions.  That
-  # will require only making the entries in %dist_dirs under the
-  # appropriate condition.  This is meaningful if the nature of
-  # the distribution should depend upon the configure options
-  # used.
-  fill_dist_dirs ($extra_dist->value_as_list_recursive (skip_ac_subst => 1))
-    if $extra_dist;
-
-  # We have to check DIST_COMMON for extra directories in case the
-  # user put a source used in AC_OUTPUT into a subdir.
-  fill_dist_dirs (rvar ('DIST_COMMON')
-                  ->value_as_list_recursive (skip_ac_subst => 1));
 
   $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 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.
@@ -4112,14 +4071,6 @@
 
       my $local = basename ($file);
 
-      # Make sure the dist directory for each input file is created.
-      # We only have to do this at the topmost level though.  This
-      # is a bit ugly but it easier than spreading out the logic,
-      # especially in cases like AC_OUTPUT(foo/out:bar/in), where
-      # there is no Makefile in bar/.
-      fill_dist_dirs (@inputs)
-       if $relative_dir eq '.';
-
       # We skip files that aren't in this directory.  However, if
       # the file's directory does not have a Makefile, and we are
       # currently doing `.', then we create a rule to rebuild the
@@ -4191,13 +4142,6 @@
        {
          my $fd = dirname ($file);
 
-         # Make sure the dist directory for each input file is created.
-         # We only have to do this at the topmost level though.
-         if ($relative_dir eq '.')
-           {
-             $dist_dirs{$fd} = 1;
-           }
-
          # We distribute files that are in this directory.
          # At the top-level (`.') we also distribute files whose
          # directory does not have a Makefile.
Index: lib/am/distdir.am
===================================================================
RCS file: /cvs/automake/automake/lib/am/distdir.am,v
retrieving revision 1.66
diff -u -r1.66 distdir.am
--- lib/am/distdir.am   24 Jun 2006 05:35:44 -0000      1.66
+++ lib/am/distdir.am   4 Aug 2006 12:53:16 -0000
@@ -55,9 +55,6 @@
 endif %?TOPDIR_P%
 ##
 ##
-?DISTDIRS?     $(mkdir_p) %DISTDIRS%
-##
-##
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 ##
@@ -108,8 +105,6 @@
 ## (The second `t' command clears the flag for the next round.)
 ##
 ## Make the subdirectories for the files.
-## (The DISTDIRS list can be incomplete, because files in subdirectories can
-## be specified for `dist' conditionally.)
 ##
        case $$dist_files in \
          */*) $(mkdir_p) `echo "$$dist_files" | \
Index: tests/distdir.test
===================================================================
RCS file: /cvs/automake/automake/tests/distdir.test,v
retrieving revision 1.10
diff -u -r1.10 distdir.test
--- tests/distdir.test  11 May 2006 17:20:04 -0000      1.10
+++ tests/distdir.test  4 Aug 2006 12:53:16 -0000
@@ -45,13 +45,22 @@
 mkdir foo woo
 touch foo/bar joe woo/doo dada
 
-grep '\$(mkdir_p).*\.' Makefile.in && exit 1
-grep '\$(mkdir_p).*srcdir' Makefile.in && exit 1
-grep '\$(mkdir_p).*foo' Makefile.in
-
+mkdir build
+cd build
+../configure
+$MAKE distdir
 # Check to make sure `foo' isn't made in build directory.
-grep 'mkdir_p.*foo.*foo' Makefile.in && exit 1
+test -d foo && exit 1
+
+rm -rf distdir-1.0
+# Remove the dot from VERSION for the next grep.
+VERSION=10 mkdir_p='echo mkdir_p' $MAKE -e distdir >make.log || :
+
+# Make sure no `./' appear in the directory names.  srcdir is `..', so
+# this also checks that no directory is created in the source tree.
+grep 'mkdir_p.*\.' make.log && exit 1
 
+cd ..
 ./configure --prefix `pwd`
 $MAKE distcheck
 
Index: tests/pr2.test
===================================================================
RCS file: /cvs/automake/automake/tests/pr2.test,v
retrieving revision 1.13
diff -u -r1.13 pr2.test
--- tests/pr2.test      14 May 2005 20:28:55 -0000      1.13
+++ tests/pr2.test      4 Aug 2006 12:53:16 -0000
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1999, 2000, 2001, 2002, 2003  Free Software Foundation, Inc.
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2006 Free Software
+# Foundation, Inc.
 #
 # This file is part of GNU Automake.
 #
@@ -36,8 +37,8 @@
 : > templ/README.foo.in
 
 $ACLOCAL
+$AUTOCONF
 $AUTOMAKE
-
-# Look for mkdir_p invocation for the templ directory.
-# We use the `[^/]' to avoid matching `templ/README.foo.in'.
-$EGREP 'mkdir_p.*templ([^/]|$)' Makefile.in
+./configure
+$MAKE distdir
+test -f nonesuch-nonesuch/templ/README.foo.in
-- 
Alexandre Duret-Lutz

Shared books are happy books.     http://www.bookcrossing.com/friend/gadl





reply via email to

[Prev in Thread] Current Thread [Next in Thread]