automake-patches
[Top][All Lists]
Advanced

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

Re: allow (sub)packages to share files in subpackages


From: Ralf Wildenhues
Subject: Re: allow (sub)packages to share files in subpackages
Date: Sun, 19 Mar 2006 06:04:39 +0100
User-agent: Mutt/1.5.9i

Hi Alexandre,

* Alexandre Duret-Lutz wrote on Sat, Mar 18, 2006 at 08:37:57AM CET:
> >>> "RW" == Ralf Wildenhues <address@hidden> writes:

>  RW> [3] The $(MAKE) invocation for the subpackage `distdir' is not
>  RW> portable to all `make' implementation (as not all allow to override
>  RW> set macros from the command line); this requirement does not change
>  RW> with the patch.
> 
> It looks portable to me

Hmm.  AFAIK the make launched won't necessarily override the
  distdir = $(PACKAGE)-$(VERSION)

which it reads from the Makefile, with
  distdir="$$distdir/$$subdir"

which it gets on its command line.  Same with am__remove_distdir.

> (as long as you don't expect your assignment to hold for the submakes
> of the one being launched, of course, but that's not needed here).

Oh, sure.

>  RW> * tests/Makefile.am: Updated.
> 
> "Update." :)

There is considerable variation among ChangeLog entries in packages I
know with respect to the passive or active voice.  Especially for those
parts of a change which are mechanical, the passive voice does not sound
too wrong to me.  ;-)

But I've changed that to your liking anyways.


>  RW> +                am__remove_distdir=: \

> Somme comment along the lines of 
> ## Disable am__remove_distdir so that sub-package do not clear a
> ## directory we have already cleared and might even have populated
> ## populated (e.g. shared AUX dir in the sub-package.)
> maybe ?  At least it sure would help my bad memories.

Added.

> Otherwise the patch looks fine to me, please install!

Thanks for the review!

> +cat >subpkg/foobar <<'END'

> It doesn't matter to me here, but those could be echos if you care
> for speed (I think to remember you do).

Well, yes I do.  In places where it matters.  FWIW, echo could also be
used for multiline files, except that
  echo "\
  foo
  bar"

may look a bit ugly.  I changed them, but this really isn't a critical
thing.

Applied like below.

Cheers,
Ralf

        Allow package trees (packages with subpackages) to share
        common distributed auxiliary files (and directories) that
        reside within a subpackage.

        * lib/am/distdir.am (distdir %?TOPDIR_P%): Do not fail if
        `$(distdir)' already exists.
        (%?SUBDIRS%): Set `am__remove_distdir' to `:' to prevent
        removal of subpackage trees for distribution.
        * tests/subpkg3.test: New test.
        * tests/Makefile.am: Update.

Index: lib/am/distdir.am
===================================================================
RCS file: /cvs/automake/automake/lib/am/distdir.am,v
retrieving revision 1.63
diff -u -r1.63 distdir.am
--- lib/am/distdir.am   12 Jan 2006 21:11:14 -0000      1.63
+++ lib/am/distdir.am   19 Mar 2006 05:02:15 -0000
@@ -51,7 +51,7 @@
 ##
 if %?TOPDIR_P%
        $(am__remove_distdir)
-       mkdir $(distdir)
+       test -d $(distdir) || mkdir $(distdir)
 endif %?TOPDIR_P%
 ##
 ##
@@ -176,6 +176,10 @@
              $(MAKE) $(AM_MAKEFLAGS) \
                top_distdir="$$top_distdir" \
                distdir="$$distdir/$$subdir" \
+ ## Disable am__remove_distdir so that sub-packages do not clear a
+ ## directory we have already cleared and might even have populated
+ ## (e.g. shared AUX dir in the sub-package).
+               am__remove_distdir=: \
                distdir) \
              || exit 1; \
          fi; \
Index: tests/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.am,v
retrieving revision 1.593
diff -u -r1.593 Makefile.am
--- tests/Makefile.am   10 Mar 2006 12:02:26 -0000      1.593
+++ tests/Makefile.am   19 Mar 2006 05:02:15 -0000
@@ -499,6 +499,7 @@
 subobjname.test \
 subpkg.test \
 subpkg2.test \
+subpkg3.test \
 subst.test \
 subst2.test \
 substref.test \
--- /dev/null   2006-03-19 06:33:14.877151536 +0100
+++ tests/subpkg3.test  2006-03-18 20:04:40.000000000 +0100
@@ -0,0 +1,61 @@
+#! /bin/sh
+# Copyright (C) 2006  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., 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301, USA.
+
+# make sure different subpackages may share files and directories.
+
+. ./defs || exit 1
+
+set -e
+
+cat >Makefile.am <<'END'
+SUBDIRS = subpkg
+EXTRA_DIST = subpkg/foobar
+END
+
+cat >>configure.in <<'END'
+AC_CONFIG_SUBDIRS([subpkg])
+AC_OUTPUT
+END
+
+mkdir subpkg
+
+echo foobar >subpkg/foobar
+
+echo SUBDIRS = >subpkg/Makefile.am
+
+cat >subpkg/configure.in <<'END'
+AC_INIT([subpkg], [1.0])
+AM_INIT_AUTOMAKE
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+END
+
+$ACLOCAL
+$AUTOMAKE
+$AUTOCONF
+
+cd subpkg
+$ACLOCAL
+$AUTOMAKE
+$AUTOCONF
+cd ..
+
+./configure
+$MAKE distcheck




reply via email to

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