# 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;
@include_stack = ();
- %dist_dirs = ();
-
@all = ();
@check = ();
@check_tests = ();
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.
# 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.
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
{
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.
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
#! /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.
#
: > 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