Fri Nov 8 09:49:09 1996 Tom Tromey <tromey@cygnus.com>
+ * automake.in (handle_dist_worker): In Cygnus mode, possibly find
+ files to dist in build dir, not srcdir.
+ (%omit_dependencies): New global.
+ (scan_dependency_file): Handle OMIT_DEPENDENCIES.
+ (scan_configure): Put rx.h, regex.h on %omit_dependencies. Ditto
+ libintl.h.
+ (handle_tests): Remove CYGNUS strings in Cygnus mode.
+ (handle_texinfo): Ditto.
+
+ * texinfos.am (dist-info): New target.
+
+ * automake.in (handle_dist_worker): Use DISTFILES, not
+ DEP_DISTFILES.
+ (initialize_per_input): Initialize dist_targets.
+ (handle_texinfo): Don't compute @infos_list; don't define or use
+ INFOS. Put dist-info onto @dist_targets.
+ (handle_dist_worker): Handle @dist_targets. Don't use the "echo
+ trick" for expanding DISTFILES any more.
+
+ * dist-vars.am (DEP_DISTFILES): Removed.
+ (DISTFILES): Don't include INFOS.
+
+ * automake.in (handle_texinfo): Handle Cygnus mode.
+ * texinfos.am (.texi.info, .texinfo.info): Handle Cygnus mode.
+
* automake.in (handle_single_transform_list): New sub.
(handle_source_transform): Use it.
(handle_built_sources): New sub.
# TRUE if --cygnus seen.
$cygnus_mode = 0;
+# Keys of this hash are names of dependency files to ignore.
+%omit_dependencies = ();
+
\f
&initialize_global_constants;
local (@texis) = &variable_value_as_list ('info_TEXINFOS');
- local (@infos_list, @info_deps_list, @dvis_list, @texi_deps);
+ local (@info_deps_list, @dvis_list, @texi_deps);
local ($infobase, $info_cursor);
local (%versions);
local ($done) = 0;
. join (' ', @texi_deps)
. "\n\n");
- # FIXME: this distributes too much. How to find out precisely
- # which files will be generated by `makeinfo'?
- push (@infos_list, $infobase . '.info', $infobase . '.info[-0-9]*');
push (@info_deps_list, $infobase . '.info');
push (@dvis_list, $infobase . '.dvi');
'makeinfo');
&define_program_variable ('TEXI2DVI', 'src', 'texinfo/util',
'texi2dvi');
- $output_rules .= &file_contents ('texinfos');
+
+ local ($xform);
+ if ($cygnus_mode)
+ {
+ $xform = 'next if /^NOTCYGNUS/; s/^CYGNUS//;';
+ }
+ else
+ {
+ $xform = 'next if /^CYGNUS/; s/^NOTCYGNUS//;';
+ }
+ $output_rules .= &file_contents_with_transform ($xform, 'texinfos');
push (@phony, 'install-info-am', 'uninstall-info');
+ push (@dist_targets, 'dist-info');
# How to clean.
$output_rules .= "\nmostlyclean-info:\n";
&pretty_print_rule ("\trm -f", "\t ", @texi_cleans);
$output_rules .= ("\nclean-info:\n\ndistclean-info:\n\n"
. "maintainer-clean-info:\n\t"
- . 'rm -f $(INFOS)' . "\n");
+ . 'for i in $(INFO_DEPS); do rm `eval echo $i*`; done'
+ . "\n");
&push_phony_cleaners ('info');
push (@suffixes, '.texi', '.texinfo', '.info', '.dvi');
push (@info, '$(INFO_DEPS)');
push (@dvi, '$(DVIS)');
- &define_variable ("INFOS", join (' ', @infos_list));
&define_variable ("INFO_DEPS", join (' ', @info_deps_list));
&define_variable ("DVIS", join (' ', @dvis_list));
# This next isn't strictly needed now -- the places that look here
# Worker for handle_dist.
sub handle_dist_worker
{
- $output_rules .= 'distdir: $(DEP_DISTFILES)' . "\n";
+ $output_rules .= 'distdir: $(DISTFILES)' . "\n";
# Initialization; only at top level.
if ($relative_dir eq '.')
# Also, there are situations in which "ln" can fail. For instance
# a file to distribute could actually be a cross-filesystem
# symlink -- this can easily happen if "gettextize" was run on the
- # distribution. Note that DISTFILES can contain a wildcard (for
- # info files, sigh), so we must use the echo trick.
- $output_rules .= ' @for file in `cd $(srcdir) && echo $(DISTFILES)`; do \\
- test -f $(distdir)/$$file \\
- || ln $(srcdir)/$$file $(distdir)/$$file 2> /dev/null \\
- || cp -p $(srcdir)/$$file $(distdir)/$$file; \\
+ # distribution.
+ $output_rules .= "\t\@for file in \$(DISTFILES); do \\\n";
+ if ($cygnus_mode)
+ {
+ $output_rules .= "\t if test -f \$\$file; then d=.; else d=\$(srcdir); fi; \\\n";
+ }
+ else
+ {
+ $output_rules .= "\t d=\$(srcdir); \\\n";
+ }
+ $output_rules .= ' test -f $(distdir)/$$file \\
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \\
+ || cp -p $$d/$$file $(distdir)/$$file; \\
done
';
';
}
- # If the target `dist-hook' exists, run it now. This allows
- # users to do random weird things to the distribution before it is
- # packaged up.
- if (defined $contents{'dist-hook'})
+ # 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 defined $contents{'dist-hook'};
+
+ local ($targ);
+ foreach $targ (@dist_targets)
{
- # We must explicitly set distdir here.
- $output_rules .= "\t\$(MAKE) distdir=\"$(distdir)\" dist-hook\n";
+ # We must explicitly set distdir for these sub-makes.
+ $output_rules .= "\t\$(MAKE) distdir=\"$(distdir)\" $targ\n";
}
push (@phony, 'distdir');
}
print "automake: reading $depfile\n" if $verbose;
+ # Sometimes it is necessary to omit some dependencies.
+ local (%omit) = %omit_dependencies;
+ if (&variable_defined ('OMIT_DEPENDENCIES'))
+ {
+ grep ($omit{$_} = 1, &variable_value_as_list ('OMIT_DEPENDENCIES'));
+ }
+
local ($first_line) = 1;
local ($last_line) = 0;
local ($target, @dependencies);
local ($one_dep, $xform);
+ local ($just_file);
local ($srcdir_rx, $fixup_rx);
# If the top srcdir is absolute, then the current directory is
}
else
{
- # Anything else is assumed to be correct.
- push (@dependencies, $one_dep);
+ # Anything else is assumed to be correct. But first
+ # make sure it is not on our list of dependencies to
+ # omit.
+ ($just_file = $one_dep) =~ s,^.*/,,;
+ push (@dependencies, $one_dep)
+ if ! defined $omit{$just_file};
}
}
}
push (@phony, 'check-DEJAGNU');
local ($xform);
- if (! $cygnus_mode)
+ if ($cygnus_mode)
+ {
+ $xform = 's/^CYGNUS//;';
+ }
+ else
{
$xform = 'next if /^CYGNUS/;';
}
$libsources{'rx.h'} = 1;
$libsources{'regex.c'} = 1;
$libsources{'regex.h'} = 1;
+ $omit_dependencies{'rx.h'} = 1;
+ $omit_dependencies{'regex.h'} = 1;
}
elsif (/AM_FUNC_MKTIME/)
{
{
$seen_gettext = 1;
$ac_gettext_line = $.;
+ $omit_dependencies{'libintl.h'} = 1;
}
# Look for ALL_LINGUAS.
# TRUE if we've seen any non-C++ sources.
$seen_c_source = 0;
+
+ # This is a list of all targets to run during "make dist".
+ @dist_targets = ();
}
## 02111-1307, USA.
.texi.info:
## We want to force the .info file to be built in srcdir. This is
-## probably the simplest way.
- cd $(srcdir) \
- && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
+## probably the simplest way. However, at Cygnus .info files are
+## always put into the build directory. So at runtime we select which
+## rule to use.
+NOTCYGNUS cd $(srcdir) \
+NOTCYGNUS && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
+CYGNUS $(MAKEINFO) $<
.texi.dvi:
TEXINPUTS=$(srcdir):$$TEXINPUTS \
.texinfo.info:
## We want to force the .info file to be built in srcdir. This is
-## probably the simplest way.
- cd $(srcdir) \
- && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
+## probably the simplest way. However, at Cygnus .info files are
+## always put into the build directory. So at runtime we select which
+## rule to use.
+NOTCYGNUS cd $(srcdir) \
+NOTCYGNUS && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
+CYGNUS $(MAKEINFO) $<
.texinfo.dvi:
TEXINPUTS=$(srcdir):$$TEXINPUTS $(TEXI2DVI) $<
(cd $(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
test -z $ii || install-info --info-dir=$(infodir) --remove $$file; \
done
+
+dist-info:
+ for base in $(INFO_DEPS); do \
+## In Cygnus mode, allow info file to be in source or build dir. In
+## other modes, allow only source dir.
+NOTCYGNUS d=$(srcdir); \
+CYGNUS if test -f $$base; then d=.; else d=$(srcdir); fi; \
+ for file in `cd $$d && eval echo $$base*`; do \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \\
+ || cp -p $$d/$$file $(distdir)/$$file; \\
+ done; \
+ done
## 02111-1307, USA.
.texi.info:
## We want to force the .info file to be built in srcdir. This is
-## probably the simplest way.
- cd $(srcdir) \
- && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
+## probably the simplest way. However, at Cygnus .info files are
+## always put into the build directory. So at runtime we select which
+## rule to use.
+NOTCYGNUS cd $(srcdir) \
+NOTCYGNUS && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
+CYGNUS $(MAKEINFO) $<
.texi.dvi:
TEXINPUTS=$(srcdir):$$TEXINPUTS \
.texinfo.info:
## We want to force the .info file to be built in srcdir. This is
-## probably the simplest way.
- cd $(srcdir) \
- && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
+## probably the simplest way. However, at Cygnus .info files are
+## always put into the build directory. So at runtime we select which
+## rule to use.
+NOTCYGNUS cd $(srcdir) \
+NOTCYGNUS && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
+CYGNUS $(MAKEINFO) $<
.texinfo.dvi:
TEXINPUTS=$(srcdir):$$TEXINPUTS $(TEXI2DVI) $<
(cd $(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
test -z $ii || install-info --info-dir=$(infodir) --remove $$file; \
done
+
+dist-info:
+ for base in $(INFO_DEPS); do \
+## In Cygnus mode, allow info file to be in source or build dir. In
+## other modes, allow only source dir.
+NOTCYGNUS d=$(srcdir); \
+CYGNUS if test -f $$base; then d=.; else d=$(srcdir); fi; \
+ for file in `cd $$d && eval echo $$base*`; do \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \\
+ || cp -p $$d/$$file $(distdir)/$$file; \\
+ done; \
+ done