More fixes
authorTom Tromey <tromey@redhat.com>
Sat, 27 Apr 1996 19:23:49 +0000 (19:23 +0000)
committerTom Tromey <tromey@redhat.com>
Sat, 27 Apr 1996 19:23:49 +0000 (19:23 +0000)
17 files changed:
ChangeLog
Makefile.in
NEWS
TODO
automake.in
data.am
header.am
lib/am/data.am
lib/am/header.am
lib/am/scripts.am
lib/am/texinfos.am
libraries.am
programs.am
scripts.am
tests/Makefile.in
tests/instman.test
texinfos.am

index 72080c5..fc278a8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+Sat Apr 27 11:39:10 1996  Tom Tromey  <tromey@creche.cygnus.com>
+
+       * automake.in (handle_configure): Set mkinstalldirs variable
+       here.
+       (handle_dist_worker): Explicitly set distdir in subdir makes.
+       (handle_dist): Handle separate distdir target.
+       (handle_dist_worker): Only generate distdir target.
+
+       * texinfos.am (install-info): Use $(mkinstalldirs).
+       * scripts.am (install-@DIR@SCRIPTS): Use $(mkinstalldirs).
+       * programs.am (install-@DIR@PROGRAMS): Use $(mkinstalldirs).
+       * libraries.am (install-@DIR@LIBRARIES): Use $(mkinstalldirs).
+       * header.am (install-@DIR@HEADERS): Use $(mkinstalldirs).
+       * data.am (install-@DIR@DATA): Use $(mkinstalldirs).
+
+       * automake.in (read_am_file): Set mkinstalldirs variable.
+       (handle_man_pages): Use it.
+       (handle_installdirs): Ditto.
+
 Fri Apr 26 15:10:48 1996  Tom Tromey  <tromey@creche.cygnus.com>
 
        * automake.in (handle_man_pages): Fix mkinstalldirs invocation.
index bdb4199..737e227 100644 (file)
@@ -71,6 +71,7 @@ CLEANFILES = automake
 ETAGS_ARGS = automake.in --lang=none \
  --regex='/^@node[ \t]+\([^,]+\)/\1/' automake.texi
 ACLOCAL = aclocal.m4
+mkinstalldirs = $(top_srcdir)/mkinstalldirs
 SCRIPTS = $(bin_SCRIPTS) $(pkgdata_SCRIPTS)
 
 
@@ -96,6 +97,8 @@ DISTFILES = $(DIST_COMMON) $(SOURCES) $(BUILT_SOURCES) $(HEADERS) \
        $(TEXINFOS) $(INFOS) $(MANS) $(EXTRA_DIST) $(DATA)
 DEP_DISTFILES = $(DIST_COMMON) $(SOURCES) $(BUILT_SOURCES) $(HEADERS) \
        $(TEXINFOS) $(INFO_DEPS) $(MANS) $(EXTRA_DIST) $(DATA)
+
+TAR = tar
 default: all
 
 
@@ -114,7 +117,7 @@ automake: $(top_builddir)/config.status automake.in
        cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= ./config.status
 
 install-binSCRIPTS: $(bin_SCRIPTS)
-       $(top_srcdir)/mkinstalldirs $(bindir)
+       $(mkinstalldirs) $(bindir)
        list="$(bin_SCRIPTS)"; for p in $$list; do \
          if test -f $$p; then \
            $(INSTALL_SCRIPT) $$p $(bindir)/`echo $$p|sed '$(transform)'`; \
@@ -130,7 +133,7 @@ uninstall-binSCRIPTS:
        done
 
 install-pkgdataSCRIPTS: $(pkgdata_SCRIPTS)
-       $(top_srcdir)/mkinstalldirs $(pkgdatadir)
+       $(mkinstalldirs) $(pkgdatadir)
        list="$(pkgdata_SCRIPTS)"; for p in $$list; do \
          if test -f $$p; then \
            $(INSTALL_SCRIPT) $$p $(pkgdatadir)/`echo $$p|sed '$(transform)'`; \
@@ -179,7 +182,7 @@ automake.info: automake.texi version.texi
        TEXINPUTS=$(srcdir):$$TEXINPUTS $(TEXI2DVI) $<
 
 install-info: $(INFO_DEPS)
-       $(top_srcdir)/mkinstalldirs $(infodir)
+       $(mkinstalldirs) $(infodir)
        for file in $(INFO_DEPS); do            \
          for ifile in `cd $(srcdir) && echo $$file*`; do \
            $(INSTALL_DATA) $(srcdir)/$$ifile $(infodir)/$$ifile; \
@@ -204,7 +207,7 @@ maintainer-clean-info:
        rm -f $(INFOS)
 
 install-pkgdataDATA: $(pkgdata_DATA)
-       $(top_srcdir)/mkinstalldirs $(pkgdatadir)
+       $(mkinstalldirs) $(pkgdatadir)
        list="$(pkgdata_DATA)"; for p in $$list; do \
          if test -f $(srcdir)/$$p; then \
            $(INSTALL_DATA) $(srcdir)/$$p $(pkgdatadir)/$$p; \
@@ -263,7 +266,11 @@ distclean-tags:
 maintainer-clean-tags:
 
 distdir = $(PACKAGE)-$(VERSION)
-dist: $(DEP_DISTFILES)
+dist: distdir
+       chmod -R a+r $(distdir)
+       $(TAR) chozf $(distdir).tar.gz $(distdir)
+       rm -rf $(distdir)
+distdir: $(DEP_DISTFILES)
        @if sed 15q $(srcdir)/NEWS | grep -e "$(VERSION)" > /dev/null; then :; else \
          echo "NEWS not updated; not releasing" 1>&2; \
          exit 1;                               \
@@ -284,11 +291,9 @@ dist: $(DEP_DISTFILES)
          || mkdir $(distdir)/$$subdir          \
          || exit 1;                            \
          chmod 777 $(distdir)/$$subdir;        \
-         (cd $$subdir && $(MAKE) dist) || exit 1; \
+         (cd $$subdir && $(MAKE) distdir=../$(distdir)/$$subdir distdir) \
+           || exit 1; \
        done
-       chmod -R a+r $(distdir)
-       tar chozf $(distdir).tar.gz $(distdir)
-       rm -rf $(distdir)
 info: $(INFO_DEPS) info-recursive
 
 dvi: $(DVIS) dvi-recursive
@@ -319,7 +324,7 @@ all: all-recursive all-am
 install-strip:
        $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install
 installdirs: installdirs-recursive
-       ./mkinstalldirs  $(bindir) $(pkgdatadir) $(infodir) $(pkgdatadir)
+       $(mkinstalldirs)  $(bindir) $(pkgdatadir) $(infodir) $(pkgdatadir)
 
 
 mostlyclean-generic:
@@ -369,10 +374,10 @@ uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
 all-recursive check-recursive installcheck-recursive info-recursive \
 dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
 maintainer-clean-recursive tags mostlyclean-tags distclean-tags \
-clean-tags maintainer-clean-tags dist info dvi check installcheck-local \
-installcheck all-am install-exec-am install-data-am uninstall-am \
-install-exec install-data install uninstall all installdirs \
-mostlyclean-generic distclean-generic clean-generic \
+clean-tags maintainer-clean-tags distdir info dvi check \
+installcheck-local installcheck all-am install-exec-am install-data-am \
+uninstall-am install-exec install-data install uninstall all \
+installdirs mostlyclean-generic distclean-generic clean-generic \
 maintainer-clean-generic clean mostlyclean distclean maintainer-clean
 
 
diff --git a/NEWS b/NEWS
index fcf9b01..0c88852 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,7 @@ New in 0.32:
   Dieter Baron.  Other hooks exist, too.
 * Preliminary (unfinished) support for libtool
 * Added short option names.
+* Better "dist" support when gluing together multiple packages
 \f
 New in 0.31:
 * Bug fixes
diff --git a/TODO b/TODO
index 4e4c8f2..dc35961 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,12 +1,19 @@
 Priorities for release:
-* Fix all mkinstalldirs invocations
-* separate dist and distdir targets, so recursive uses of Automake work ok
 * make the auto-dep code crash if GNU make not in use?
   (doesn't it already?)
 * Add no-remake option
 * scripts are installed in $exec_prefix/bin, not $prefix/bin
   Bug or feature?
 
+Bug: the mkinstalldirs code will fail unless the top-level Makefile is
+done first; "automake lib/Makefile Makefile" will fail.
+
+Right now, targets generated internally (eg "install") are not
+overridable by use code.  This should probably be possible, even
+though it isn't very important.  This could be done by generating all
+internal rules via a function call instead of just appending to
+$output_rules.
+
 * Should be a way to have "nobuild_PROGRAMS" which aren't even built,
   but which could be by running the magic make command.
 
index c3c186d..62a32fd 100755 (executable)
@@ -879,12 +879,14 @@ sub handle_texinfo
                if ! $done;
            ++$done;
 
+           local ($conf_pat);
+           ($conf_pat = $config_aux_dir) =~ s/(\W)/\\$1/g;
            $output_rules .=
                &file_contents_with_transform
                    ('s/\@TEXI\@/' . $info_cursor . '/g; '
                     . 's/\@VTI\@/' . $vti . '/g; '
                     . 's/\@VTEXI\@/' . $vtexi . '/g;'
-                    . 's,\@MDDIR\@,' . $config_aux_dir . ',g;',
+                    . 's,\@MDDIR\@,' . $conf_pat . ',g;',
                     'texi-version');
 
            &push_phony_cleaners ($vti);
@@ -992,8 +994,7 @@ sub handle_man_pages
     foreach (keys %sections)
     {
        push (@installdirs, '$(mandir)/man' . $_);
-       $output_rules .= ("\t" . $config_aux_dir
-                         . '/mkinstalldirs $(mandir)/man'
+       $output_rules .= ("\t" . '$(mkinstalldirs) $(mandir)/man'
                          . $_ . "\n");
     }
     push (@phony, 'install-man');
@@ -1077,10 +1078,7 @@ sub handle_tags
 # Generate actual 'dist' (or dist-shar) rule.
 sub handle_dist_worker
 {
-    local ($distshar) = @_;
-    local ($target) = $distshar ? 'dist-shar' : 'dist';
-
-    $output_rules .= $target . ': $(DEP_DISTFILES)' . "\n";
+    $output_rules .= 'distdir: $(DEP_DISTFILES)' . "\n";
 
     # Initialization; only at top level.
     if ($relative_dir eq '.')
@@ -1142,13 +1140,18 @@ sub handle_dist_worker
     if (&variable_defined ('SUBDIRS'))
     {
        # Test for directory existence here because previous automake
-       # invocation might have created some directories.
+       # invocation might have created some directories.  Note that
+       # we explicitly set distdir for the subdir make; that lets us
+       # mix-n-match many automake-using packages into one large
+       # package, and have "dist" at the top level do the right
+       # thing.
        $output_rules .= '      for subdir in $(SUBDIRS); do            \\
          test -d $(distdir)/$$subdir           \\
          || mkdir $(distdir)/$$subdir          \\
          || exit 1;                            \\
          chmod 777 $(distdir)/$$subdir;        \\
-         (cd $$subdir && $(MAKE) dist) || exit 1; \\
+         (cd $$subdir && $(MAKE) distdir=../$(distdir)/$$subdir distdir) \\
+           || exit 1; \\
        done
 ';
     }
@@ -1161,22 +1164,7 @@ sub handle_dist_worker
        $output_rules .= "\t\$(MAKE) dist-hook\n";
     }
 
-    # Finalize.
-    if ($relative_dir eq '.')
-    {
-       $output_rules .= '      chmod -R a+r $(distdir)' . "\n\t";
-       if ($distshar)
-       {
-           $output_rules .= 'shar $(distdir) | gzip > $(distdir).shar.gz';
-       }
-       else
-       {
-           $output_rules .= '$(TAR) chozf $(distdir).tar.gz $(distdir)';
-       }
-       $output_rules .= "\n\t" . 'rm -rf $(distdir)' . "\n";
-    }
-
-    push (@phony, $target);
+    push (@phony, 'distdir');
 }
 
 # Handle 'dist' target.
@@ -1246,8 +1234,24 @@ sub handle_dist
     }
 
     # Generate 'dist' target, and maybe dist-shar.
-    &handle_dist_worker (0);
-    &handle_dist_worker (1) if defined $options{'dist-shar'};
+    if ($relative_dir eq '.')
+    {
+       $output_rules .= 'dist: distdir' . "\n\t";
+       $output_rules .= 'chmod -R a+r $(distdir)' . "\n\t";
+       $output_rules .= '$(TAR) chozf $(distdir).tar.gz $(distdir)';
+       $output_rules .= "\n\t" . 'rm -rf $(distdir)' . "\n";
+
+       if (defined $options{'dist-shar'})
+       {
+           $output_rules .= 'dist-shar: distdir' . "\n\t";
+           $output_rules .= 'chmod -R a+r $(distdir)' . "\n\t";
+           $output_rules .= 'shar $(distdir) | gzip > $(distdir).shar.gz';
+           $output_rules .= "\n\t" . 'rm -rf $(distdir)' . "\n";
+       }
+    }
+
+    # Generate distdir target.
+    &handle_dist_worker;
 }
 
 # Handle auto-dependency code.
@@ -1409,6 +1413,17 @@ sub handle_configure
        $top_reldir = '';
     }
 
+    # Set location of mkinstalldirs.
+    if ($config_aux_dir ne '.')
+    {
+       $output_vars .= 'mkinstalldirs = ' . $config_aux_dir;
+    }
+    else
+    {
+       $output_vars .= 'mkinstalldirs = $(top_srcdir)';
+    }
+    $output_vars .= '/mkinstalldirs' . "\n";
+
     &am_line_error ('CONFIG_HEADER',
                    "\`CONFIG_HEADER' is an anachronism; now determined from \`configure.in'")
        if &variable_defined ('CONFIG_HEADER');
@@ -1556,7 +1571,7 @@ sub handle_installdirs
     push (@phony, 'installdirs');
     if (@installdirs)
     {
-       &pretty_print_rule ("\t$config_aux_dir/mkinstalldirs ", "\t\t",
+       &pretty_print_rule ("\t" . '$(mkinstalldirs) ', "\t\t",
                            @installdirs);
     }
     $output_rules .= "\n";
diff --git a/data.am b/data.am
index 8ea1a47..f27bbdc 100644 (file)
--- a/data.am
+++ b/data.am
@@ -16,7 +16,7 @@
 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 ## 02111-1307, USA.
 install-@DIR@DATA: $(@DIR@_DATA)
-       $(top_srcdir)/mkinstalldirs $(@DIR@dir)
+       $(mkinstalldirs) $(@DIR@dir)
 ## Funny invocation because Makefile variable can be empty, leading to
 ## a syntax error in sh.
        list="$(@DIR@_DATA)"; for p in $$list; do \
index 7b3b0e7..63eb1e0 100644 (file)
--- a/header.am
+++ b/header.am
@@ -16,7 +16,7 @@
 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 ## 02111-1307, USA.
 install-@DIR@HEADERS: $(@DIR@_HEADERS)
-       $(top_srcdir)/mkinstalldirs $(@DIR@dir)
+       $(mkinstalldirs) $(@DIR@dir)
 ## Funny invocation because Makefile variable can be empty, leading to
 ## a syntax error in sh.
        list="$(@DIR@_HEADERS)"; for p in $$list; do \
index 8ea1a47..f27bbdc 100644 (file)
@@ -16,7 +16,7 @@
 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 ## 02111-1307, USA.
 install-@DIR@DATA: $(@DIR@_DATA)
-       $(top_srcdir)/mkinstalldirs $(@DIR@dir)
+       $(mkinstalldirs) $(@DIR@dir)
 ## Funny invocation because Makefile variable can be empty, leading to
 ## a syntax error in sh.
        list="$(@DIR@_DATA)"; for p in $$list; do \
index 7b3b0e7..63eb1e0 100644 (file)
@@ -16,7 +16,7 @@
 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 ## 02111-1307, USA.
 install-@DIR@HEADERS: $(@DIR@_HEADERS)
-       $(top_srcdir)/mkinstalldirs $(@DIR@dir)
+       $(mkinstalldirs) $(@DIR@dir)
 ## Funny invocation because Makefile variable can be empty, leading to
 ## a syntax error in sh.
        list="$(@DIR@_HEADERS)"; for p in $$list; do \
index 997e05f..d881f1e 100644 (file)
@@ -16,7 +16,7 @@
 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 ## 02111-1307, USA.
 install-@DIR@SCRIPTS: $(@DIR@_SCRIPTS)
-       $(top_srcdir)/mkinstalldirs $(@DIR@dir)
+       $(mkinstalldirs) $(@DIR@dir)
 ## Funny invocation because Makefile variable can be empty, leading to
 ## a syntax error in sh.
        list="$(@DIR@_SCRIPTS)"; for p in $$list; do \
index 7b6f754..7b22be9 100644 (file)
@@ -26,7 +26,7 @@
 ## rebuilt in the build directory.  Can't cd to srcdir; that might
 ## break a possible install-sh reference.
 install-info: $(INFO_DEPS)
-       $(top_srcdir)/mkinstalldirs $(infodir)
+       $(mkinstalldirs) $(infodir)
        for file in $(INFO_DEPS); do            \
 ## We use these strange circumlocutions because we want the "ifile" to
 ## be relative, for the install.
index cb20187..99a049a 100644 (file)
@@ -16,7 +16,7 @@
 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 ## 02111-1307, USA.
 install-@DIR@LIBRARIES: $(@DIR@_LIBFILES)
-       $(top_srcdir)/mkinstalldirs $(@DIR@dir)
+       $(mkinstalldirs) $(@DIR@dir)
 ## Funny invocation because Makefile variable can be empty, leading to
 ## a syntax error in sh.
        list="$(@DIR@_LIBFILES)"; for p in $$list; do \
index 490edcb..afaa430 100644 (file)
@@ -16,7 +16,7 @@
 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 ## 02111-1307, USA.
 install-@DIR@PROGRAMS: $(@DIR@_PROGRAMS)
-       $(top_srcdir)/mkinstalldirs $(@DIR@dir)
+       $(mkinstalldirs) $(@DIR@dir)
 ## Funny invocation because Makefile variable can be empty, leading to
 ## a syntax error in sh.
        list="$(@DIR@_PROGRAMS)"; for p in $$list; do \
index 997e05f..d881f1e 100644 (file)
@@ -16,7 +16,7 @@
 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 ## 02111-1307, USA.
 install-@DIR@SCRIPTS: $(@DIR@_SCRIPTS)
-       $(top_srcdir)/mkinstalldirs $(@DIR@dir)
+       $(mkinstalldirs) $(@DIR@dir)
 ## Funny invocation because Makefile variable can be empty, leading to
 ## a syntax error in sh.
        list="$(@DIR@_SCRIPTS)"; for p in $$list; do \
index 99a6d19..dfad26d 100644 (file)
@@ -47,6 +47,7 @@ canon.test installsh.test empty.test rulepat.test insh.test canon2.test \
 target.test extra.test noinst.test instman.test
 
 EXTRA_DIST = defs $(TESTS)
+mkinstalldirs = $(top_srcdir)/mkinstalldirs
 DIST_COMMON = ChangeLog Makefile.am Makefile.in
 
 
@@ -73,7 +74,7 @@ TAGS:
 
 subdir = tests
 distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
-dist: $(DEP_DISTFILES)
+distdir: $(DEP_DISTFILES)
        @for file in `cd $(srcdir) && echo $(DISTFILES)`; do \
          test -f $(distdir)/$$file \
          || ln $(srcdir)/$$file $(distdir)/$$file 2> /dev/null \
@@ -148,7 +149,7 @@ maintainer-clean:  maintainer-clean-generic distclean
        @echo "This command is intended for maintainers to use;"
        @echo "it deletes files that may require special tools to rebuild."
 
-.PHONY: default tags dist check-TESTS info dvi check installcheck \
+.PHONY: default tags distdir check-TESTS info dvi check installcheck \
 install-exec install-data install uninstall all installdirs \
 mostlyclean-generic distclean-generic clean-generic \
 maintainer-clean-generic clean mostlyclean distclean maintainer-clean
index 4ba14a6..4aa1b47 100755 (executable)
@@ -13,5 +13,5 @@ EOF
 
 $AUTOMAKE || exit 1
 
-grep '[^/]mkinstalldirs' Makefile.in && exit 1
+grep '[^(/]mkinstalldirs' Makefile.in && exit 1
 exit 0
index 7b6f754..7b22be9 100644 (file)
@@ -26,7 +26,7 @@
 ## rebuilt in the build directory.  Can't cd to srcdir; that might
 ## break a possible install-sh reference.
 install-info: $(INFO_DEPS)
-       $(top_srcdir)/mkinstalldirs $(infodir)
+       $(mkinstalldirs) $(infodir)
        for file in $(INFO_DEPS); do            \
 ## We use these strange circumlocutions because we want the "ifile" to
 ## be relative, for the install.