Merged from user-dep-gen-branch.
authorTom Tromey <tromey@redhat.com>
Sun, 21 Nov 1999 21:35:41 +0000 (21:35 +0000)
committerTom Tromey <tromey@redhat.com>
Sun, 21 Nov 1999 21:35:41 +0000 (21:35 +0000)
42 files changed:
AUTHORS
ChangeLog
HACKING
Makefile.am
Makefile.in
NEWS
THANKS
TODO
automake.in
automake.texi
dejagnu.am
depcomp [new file with mode: 0755]
depend.am
depend2.am
dist.am
lib/am/Makefile.am
lib/am/dejagnu.am
lib/am/depend.am
lib/am/depend2.am
lib/am/texinfos.am
lib/depcomp [new file with mode: 0755]
lib/missing
m4/Makefile.am
m4/Makefile.in
m4/depend.m4 [new file with mode: 0644]
m4/depout.m4 [new file with mode: 0644]
m4/init.m4
m4/lex.m4
m4/missing.m4
missing
stamp-vti
tests/ChangeLog
tests/Makefile.am
tests/Makefile.in
tests/defs
tests/depend2.test [deleted file]
tests/exsource.test
tests/mdate3.test
tests/specflags3.test
tests/suffix.test
texinfos.am
version.texi

diff --git a/AUTHORS b/AUTHORS
index 49de6bb..591f31a 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -5,3 +5,6 @@ Wrote sh version of automake.in.
 
 Tom Tromey.  Touched all ".am" files.
 Rewrote automake.in
+
+Alexandre Oliva.  Some of the user-side dependency tracking system.
+Some more random hacking.
index b042309..4aa31e7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,208 @@
+1999-11-21  Tom Tromey  <tromey@cygnus.com>
+
+       * automake.in (finish_languages): Only generate suffix rule when
+       not doing dependency tracking.
+
+       * m4/init.m4 (AM_INIT_AUTOMAKE): Use AM_MISSING_INSTALL_SH.
+       * m4/missing.m4 (AM_MISSING_INSTALL_SH): New macro.
+
+       * depend2.am: Use @SOURCE@, @OBJ@, @LTOBJ@, @OBJOBJ@, and @BASE@.
+       Always use `-o'.
+
+1999-11-19  Tom Tromey  <tromey@cygnus.com>
+
+       * dist.am: Set `CDPATH=:' to avoid problems.  Merged from
+       Alexandre's change on branch.
+
+1999-10-02  Alexandre Oliva  <oliva@lsd.ic.unicamp.br>
+
+       * Makefile.am (maintainer-check): Look for occurrences of ``cd'
+       without `CDPATH'.
+       * dejagnu.am: Set CDPATH before cd.
+       * Makefile.in: Rebuilt.
+
+       * automake.in (handle_single_transform_list): Change `\1' for `$1'
+       in `s///' replacement.
+
+       * automake.in (handle_dist): Set CDPATH before cd.
+       * dejagnu.am (check-DEJAGNU): Likewise.
+       * texinfos.am (install-info-am, dist-info): Likewise.
+       * m4/init.m4 (AM_INIT_AUTOMAKE): Likewise.
+       * m4/missing.m4 (AM_MISSING_HAS_RUN): Likewise.
+       * aclocal.m4, configure, Makefile.in: Rebuilt.
+       
+       * AUTHORS: Added myself.
+
+1999-09-14  Alexandre Oliva  <oliva@lsd.ic.unicamp.br>
+
+       * m4/missing.m4: Support relative srcdir and ac_aux_dir.
+       Reported by Tim Wilkinson <tim@transvirtual.com>
+       * aclocal.m4, configure: Rebuilt.
+
+1999-08-17  Alexandre Oliva  <oliva@dcc.unicamp.br>
+
+       * m4/lex.m4 (AM_PROG_LEX): Require AM_MISSING_HAS_RUN and, if no
+       LEX program is found, use `${am_missing_run}flex'.
+
+1999-08-16  Alexandre Oliva  <oliva@dcc.unicamp.br>
+       
+       * automake.in (handle_single_transform_list): Replace `$(OBJEXT)'
+       with `o' in depfile.
+
+       * automake.in (handle_lib_objects_cond): Remove second dot from
+       dependency file names.
+
+       * depend2.am (OBJEXT@EXT@.obj): Dependency file should be .Po,
+       regardless of OBJEXT.
+
+       * automake.in (handle_dependencies): Add blank line after depend2.
+       (handle_dependencies): Start DEP_FILES with `@AMDEP@'.  Output
+       blank line before `include's, not after them.
+       (scan_one_configure_file): Do not special-case `DEP_' any more.
+
+       * m4/depout.m4 (AM_OUTPUT_DEPENDENCY_COMMANDS): Run for loop only
+       if AMDEP is empty.
+       * aclocal.m4, configure: Rebuilt.
+
+       * m4/depend.m4 (AMDEPBACKSLASH): Define.
+       * depend2.am (@EXT@.o, @EXT@.lo, @EXT@.obj): Use AMDEPBACKSLASH.
+
+       * automake.in (handle_dependencies): Generate `include's for
+       dependency files after `@AMDEP@'.
+
+       * m4/missing.m4: Use eval, instead of a sub-shell, to test for
+       --run support in the missing script, since SHELL is not exported.
+       Reported by job bogan <job@piquin.uchicago.edu>
+       * aclocal.m4, configure: Rebuilt.
+
+1999-08-15  Alexandre Oliva  <oliva@dcc.unicamp.br>
+
+       * aclocal.m4, configure: Rebuilt with itself.
+       * Makefile.in, m4/Makefile.in, tests/Makefile.in: Likewise.
+
+       * m4/missing.m4 (AM_MISSING_PROG): Remove DIRECTORY argument.
+       Require AM_MISSING_HAS_RUN.  Use am_missing_run, defined by...
+       (AM_MISSING_HAS_RUN): New macro.
+       * m4/init.m4: Remove missing_dir from calls to AM_MISSING_PROG.
+       * automake.texi (Requirements): Likewise.
+       * version.texi, stamp-vti: Rebuilt.
+
+1999-07-28  Tom Tromey  <tromey@cygnus.com>
+
+       * depcomp: Handle the `hp' mode.
+
+1999-07-06  Tom Tromey  <tromey@cygnus.com>
+
+       * depcomp: Work around HP-UX 10.20 sed bug.
+
+1999-07-05  Tom Tromey  <tromey@cygnus.com>
+
+       * automake.in (handle_dependencies): Generate a separate include
+       for each dep file.  Report from Alexandre Oliva.
+       * depend.am: Don't include DEP_FILES.
+
+1999-06-01  Alexandre Oliva  <oliva@dcc.unicamp.br>
+
+       * depend.am: Add @AMDEP@ before `include', so that dependency
+       tracking can be disabled.
+       * depend2.am: Ditto, before all lines related with dependency
+       tracking.
+       * m4/depend.m4 (AM_DEP_TRACK): New macro, that documents
+       --enable/disable-dependency-tracking and sets AMDEP accordingly.
+       It is implicitly disabled if depcomp is missing.
+       (AM_DEPENDENCIES): Disable dependency tracking unless it can be
+       generated by side-effect.
+       * m4/init.m4 (AM_INIT_AUTOMAKE): Require AM_DEP_TRACK.
+       * automake.in (handle_dependencies): Add @AMDEP@ before the value
+       of DEP_FILES.
+       * m4/depout.m4 (AM_OUTPUT_DEPENDENCY_COMMANDS): Handle DEP_FILES
+       starting with `#'.
+
+       * depcomp: Support -xM for dependency generation, for Sun CC.
+       Reported by Alex Hornby <alex@anvil.co.uk>
+       * m4/depend.m4: Extract the list of supported dependency-tracking
+       mechanisms from the depcomp script and use it to test each one.
+       * THANKS: Added Alex Hornby.
+
+       * depend2.am: Move $(depcomp) to the line of $(...DEPMODE), so as
+       to leave $(...COMPILE) in a line by itself.
+
+       * THANKS: Added Miles Bader.
+
+1999-06-01  Miles Bader  <miles@ccs.mt.nec.co.jp>
+
+       * m4/depend.m4 (AM_DEPENDENCIES): Add check for `makedepend'.
+       Fix `dashmstdout' to ignore non-dependency-generating uses of the
+       -M flag.
+       * depcomp (makedepend): New dependency-generating method.
+
+1999-06-01  Alexandre Oliva  <oliva@dcc.unicamp.br>
+
+       * missing: If given `--run' as first argument, try to run the
+       given program before falling back to the ``emulated'' behavior.
+       Add support for `tar'.
+       * automake.in: Use new `tar' support for `dist'.
+       * m4/missing.m4 (AM_MISSING_PROG): Instead of checking for the
+       program, prepend `missing --run' to the given program name.
+       * m4/init.m4: Remove AMTAR-related stuff.
+       * NEWS: Updated.
+
+       * m4/depout.m4: Instead of `find'ing Makefiles, just iterate on
+       CONFIG_FILES.  Do not use temporary variable for list of
+       dependency files, it breaks Cygwin.
+
+1999-04-27  Alexandre Oliva  <oliva@dcc.unicamp.br>
+
+       * depcomp (gcc): Imported comments removed from depend2.am, so
+       that we don't lose them.
+
+       * m4/depout.m4 (AM_OUTPUT_DEPENDENCY_COMMANDS): Avoid sed s/$U//
+       when not using ansi2knr.
+
+1999-04-26  Alexandre Oliva  <oliva@dcc.unicamp.br>
+
+       * m4/depend.m4 (AM_DEPENDENCIES): Test for depcc -E support.
+       * depcomp (cpp): Extract dependencies from `# nnn "..."' lines.
+
+1999-04-25  Alexandre Oliva  <oliva@dcc.unicamp.br>
+
+       * m4/depend.m4 (AM_DEPENDENCIES): Add a definition to conftest.h,
+       so as not to compile an empty source; some compilers fail on this.
+       Redirect stderr of depcc to /dev/null.  Test for -M with -o,
+       because some compilers will output the rules to the output file.
+       * depcomp (dashmstdout): Add --silent before --mode=compile, so
+       that we don't get libtool output mixed up with make rules.
+
+       * m4/init.m4 (AM_INIT_AUTOMAKE): Require AM_SET_DEPDIR.
+       * depend2.am: Set tmpdepfile too, to speed up depcomp.  Always use 
+       -o for libtool, otherwise it may try to deduce the object name
+       from the dependency-generation flag.
+       * depcomp: Assume depdir exists.  Preserve depfile on unsuccessful 
+       compilations.
+
+       * libtool.am: Do not emit .c.lo here...
+       * depend2.am: ... emit .*.lo here, only when using libtool.
+       * automake.in (get_object_extension): No more @MINUSO@ here.
+       (handle_single_transform_list): Set $depfile from $object.
+       (handle_dependencies): Emit depend2.am for all used languages,
+       regardless of $use_dependencies; the setting of depcomp makes the
+       difference.
+       (lang_cxx_finish): Do not emit compilation rules.
+       (lang_objc_finish): Likewise.
+       (lang_java_finish): Likewise.
+
+1999-04-21  Tom Tromey  <tromey@cygnus.com>
+
+       * m4/depout.m4 (AM_OUTPUT_DEPENDENCY_COMMANDS): Correctly
+       interpolate DEPDIR in DEP_FILES expansion.
+
+1999-04-20  Lee Iverson  <leei@Canada.AI.SRI.COM>
+
+       * m4/depend.m4 (AM_DEPENDENCIES): Fix up test for SGI-style
+       dependency updating.
+       * m4/depout.m4 (AM_OUTPUT_DEPENDENCY_COMMANDS): Fix sed script to
+       handle multi-line dependency lists.
+
 1999-11-12  Tom Tromey  <tromey@cygnus.com>
 
        Fix for PR automake/14:
        * automake.in (handle_tests): support XFAIL_TEST
        * automake.texi: document it
 
+1999-04-12  Alexandre Oliva  <oliva@dcc.unicamp.br>
+
+       * End of merge from trunk.
+
+1999-04-12  Alexandre Oliva  <oliva@dcc.unicamp.br>
+
+       * automake.in (cmdline_use_dependencies): Reintroduce it.
+       (--ignore-deps): Set cmdline_use_dependencies again.
+       (handle_dependencies): If use_dependencies is not set, define
+       depcomp as empty.
+       (handle_configure): Pass --ignore-deps to generated Makefile.ins.
+       (scan_configure): Do not require depcomp when ignoring
+       dependencies.
+       (initialize_global_constants): Reintroduce --ignore-deps.
+
+1999-04-10  Alexandre Oliva  <oliva@dcc.unicamp.br>
+
+       * depcomp: New file.
+       * Makefile.am (dist_script_DATA): Added depcomp.
+       * automake.in (cmdline_use_dependencies, omit_dependencies,
+       dependency_macros): Removed.
+       (--ignore-deps): Just ignore.
+       (handle_single_transform_list, dep_files): Named dependency files
+       as \$(DEPDIR)/$base.P$obj
+       (handle_lib_objects_cond): Likewise.
+       (generate_dependency_code): Do not check for AM_*_DEPENDENCIES.
+       (scan_one_configure_file): Likewise.
+       (handle_dependencies): Always enable auto-dep.  Define `depcomp'.
+       Ignore OMIT_DEPENDENCIES.
+       (handle_configure): Do not pass --ignore-deps.
+       (scan_configure): Require `depcomp'.
+       (initialize_global_constants): Make `depcomp' common.  Remove
+       `--ignore-deps' from usage.
+       (get_object_extension): No more NOTDEPEND in compile nor libtool.
+       * compile.am: Remove rules for .c.o and .c.obj
+       * depend.am (distclean-depend): Wipe out $(DEPDIR)
+       * depend2.am (@FPFX@DEPMODE): Define from config.status.
+       Use it and depcomp in suffix rules.
+       * libtool.m4: Likewise.
+       * m4/ccdepend.m4, m4/cxxdepend.m4: Removed.
+       * m4/depvars.m4, m4/objcdepend.m4: Likewise.
+       * m4/Makefile.am (dist_m4data_DATA): Likewise.
+       * m4/depout.m4 (AM_OUTPUT_DEPENDENCY_COMMANDS): Extract DEPDIR
+       from the Makefile and subst it in deps.  Report creation of deps
+       files (for now).  Replace $U with `_' and the empty string.  Write 
+       a comment to each created file. 
+       * m4/depend.m4 (AM_SET_DEPDIR): Select a valid deps dir name.
+       (AM_DEPENDENCIES): Accept CC, CXX and OBJC.  Just determine the
+       dependency mode and AC_SUBST [$1]DEPMODE.
+       * m4/init.m4 (AM_INIT_AUTOMAKE): Automatically call
+       AM_DEPENDENCIES for CC and CXX, if the corresponding AC_PROG
+       appears in configure.in, before or after AM_INIT_AUTOMAKE.
+
+1999-04-02  Raja R Harinath  <harinath@cs.umn.edu>
+
+       * depout.m4: Fix sed expression for extracting `dirpart'.
+
+1999-03-29  Tom Tromey  <tromey@cygnus.com>
+
+       * depend2.am (DEP_@FPFX@COMPILE): Use `!=' and not `-ne'.
+
+       * compile.am (.c.obj): Also disabled when dependency tracking
+       enabled.
+       * depend2.am (@EXT@.obj): New target.
+       * automake.in (get_object_extension): Added explanatory comment.
+       (generate_dependency_code): Handle $seen_objext.
+
+       * depend.am: Removed obsolete comment.
+       * depend2.am: Minor formatting fix.
+
+1999-03-28  Tom Tromey  <tromey@cygnus.com>
+
+       * m4/Makefile.am (dist_m4data_DATA): Renamed, and added new
+       files.
+       (EXTRA_DIST): Removed.
+       * automake.in (dependency_macros): New global.
+       (scan_one_configure_file): Recognize new dependency tracking
+       macros, and define new resulting configure variables.
+       (generate_dependency_code): New sub.
+       (handle_dependencies): Use it.
+       * depend2.am (DEP_@FPFX@COMPILE): New macro.
+       (@EXT@.o): Use it.
+       (@EXT@.lo): Likewise.
+       * m4/depvars.m4: New file.
+       * m4/objcdepend.m4: New file.
+       * m4/cxxdepend.m4: New file.
+       * m4/init.m4: Moved dependency handling code into depout.m4.
+       * m4/depout.m4: New file.
+       * m4/ccdepend.m4: New file.
+       * m4/depend.m4: New file.
+
+       * depend2.am (@EXT@.o): Renamed to be old-style suffix pattern.
+       (@EXT@.lo): Likewise.
+       * m4/init.m4 (AM_INIT_AUTOMAKE): Don't create `.deps/.P'; it is no
+       longer needed.
+
+       * m4/init.m4 (AM_INIT_AUTOMAKE): Add code to config.status which
+       will create the required .P files for dependency tracking.
+       * automake.in (scan_dependency_file): Removed.
+       (handle_dependencies): Never call scan_dependency_file.
+       (generate_deps): Removed.
+       (parse_arguments): Don't recognize --generate-deps, --build-dir,
+       --srcdir-name, or --include-deps.  Do recognize --ignore-deps.
+       (srcdir_name): Removed.
+       (build_directory): Removed.
+       (initialize_global_constants): Changed $USAGE to reflect argument
+       parsing changes.
+       (handle_dist_worker): Never run automake in `dist' rule.
+       (handle_configure): Use --ignore-deps, not --include-deps.
+       * depend.am (DEPS_MAGIC): Removed.
+       (DEP_FILES): Unconditionally include.
+
 1999-03-27  Tom Tromey  <tromey@cygnus.com>
 
        * automake.in (saw_sources_p): Correctly count header extensions
diff --git a/HACKING b/HACKING
index 0ac188d..2bd825a 100644 (file)
--- a/HACKING
+++ b/HACKING
@@ -45,6 +45,9 @@
 
 * Never use basename or dirname.  Instead use sed
 
+* If you run `cd' within back-quotes, make sure you set `CDPATH=:',
+  otherwise the directory name may be printed, depending on CDPATH.
+
 * For install and uninstall rules, if a loop is required, it should be
   silent.  Then the body of the loop itself should print each
   "important" comman it runs.  The printed commands should be preceded
index 4c2dac4..6d192d5 100644 (file)
@@ -26,7 +26,7 @@ $(amfiles)
 ## what we want.  So we make them executable by hand.
 scriptdir = $(pkgdatadir)
 dist_script_DATA = config.guess config.sub install-sh mdate-sh missing \
-mkinstalldirs elisp-comp ylwrap acinstall compile
+mkinstalldirs elisp-comp ylwrap acinstall depcomp compile
 
 install-data-hook:
        @$(POST_INSTALL)
@@ -104,6 +104,12 @@ maintainer-check: automake aclocal
          echo "Found bad split in automake.in" 1>&2; \
          exit 1; \
        fi
+## Look for cd within backquotes without CDPATH=:
+       @if grep '` *cd ' $(srcdir)/automake.in $(srcdir)/*.am \
+             $(srcdir)/m4/*.m4; then \
+         echo "Consider setting CDPATH in the lines above" 1>&2; \
+         exit 1; \
+       fi
 
 # Tag before making distribution.  Also, don't make a distribution if
 # checks fail.  Also, make sure the NEWS file is up-to-date.
index 1a515a5..ebd01fb 100644 (file)
@@ -90,7 +90,7 @@ $(amfiles)
 
 scriptdir = $(pkgdatadir)
 dist_script_DATA = config.guess config.sub install-sh mdate-sh missing \
-mkinstalldirs elisp-comp ylwrap acinstall compile
+mkinstalldirs elisp-comp ylwrap acinstall depcomp compile
 
 
 TAGS_FILES = automake.in aclocal.in $(amfiles)
@@ -249,7 +249,7 @@ install-info-am: $(INFO_DEPS)
        @list='$(INFO_DEPS)'; \
        for file in $$list; do \
          d=$(srcdir); \
-         for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
+         for ifile in `CDPATH=: && cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
            if test -f $$d/$$ifile; then \
              echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \
              $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \
@@ -287,7 +287,7 @@ dist-info: $(INFO_DEPS)
        list='$(INFO_DEPS)'; \
        for base in $$list; do \
          d=$(srcdir); \
-         for file in `cd $$d && eval echo $$base*`; do \
+         for file in `CDPATH=: && cd $$d && eval echo $$base*`; do \
            test -f $(distdir)/$$file \
            || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
            || cp -p $$d/$$file $(distdir)/$$file; \
@@ -456,7 +456,7 @@ distcheck: dist
        mkdir $(distdir)/=build
        mkdir $(distdir)/=inst
        chmod a-w $(distdir)
-       dc_install_base=`cd $(distdir)/=inst && pwd` \
+       dc_install_base=`CDPATH=: && cd $(distdir)/=inst && pwd` \
          && cd $(distdir)/=build \
          && ../configure --srcdir=.. --prefix=$$dc_install_base \
          && $(MAKE) $(AM_MAKEFLAGS) \
@@ -661,6 +661,11 @@ maintainer-check: automake aclocal
          echo "Found bad split in automake.in" 1>&2; \
          exit 1; \
        fi
+       @if grep '` *cd ' $(srcdir)/automake.in $(srcdir)/*.am \
+             $(srcdir)/m4/*.m4; then \
+         echo "Consider setting CDPATH in the lines above" 1>&2; \
+         exit 1; \
+       fi
 
 # Tag before making distribution.  Also, don't make a distribution if
 # checks fail.  Also, make sure the NEWS file is up-to-date.
diff --git a/NEWS b/NEWS
index ef17825..2bb626c 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,6 @@
+New in 1.4a-dep:
+* Faster AM_INIT_AUTOMAKE (requires update of `missing' script)
+* User-side dependency tracking.  Developers no longer need GNU make
 New in 1.4a:
 * Many files (but not all) are correctly handled if they appear in subdirs
   For instance, a _DATA file can appear in a subdir
diff --git a/THANKS b/THANKS
index cd58546..695cbb1 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -3,8 +3,8 @@ It would not be what it is today without the invaluable help of these
 people:
 
 Akim Demaille          demaille@inf.enst.fr
+Alex Hornby            alex@anvil.co.uk
 Alexander V. Lukyanov  lav@yars.free.net
-Alexandre Oliva                oliva@dcc.unicamp.br
 Andreas Schwab         schwab@lamothe.informatik.uni-dortmund.de
 Andrew Cagney          cagney@tpgi.com.au
 Andris Pavenis         pavenis@lanet.lv
@@ -76,6 +76,7 @@ Matthias Clasen               clasen@mathematik.uni-freiburg.de
 Matthew D. Langston    langston@SLAC.Stanford.EDU
 Michael Brantley       Michael-Brantley@deshaw.com
 Michel de Ruiter       mdruiter@cs.vu.nl
+Miles Bader            miles@ccs.mt.nec.co.jp
 Miodrag Vallat         miodrag@ifrance.com
 Motoyuki Kasahara      m-kasahr@sra.co.jp
 NISHIDA Keisuke                knishida@nn.iij4u.or.jp
diff --git a/TODO b/TODO
index 135ede9..250bc67 100644 (file)
--- a/TODO
+++ b/TODO
@@ -5,6 +5,12 @@
 * if automake -a, and dangling links exist, automake should
   remove and reinstall
 
+* add a way to require C++ support even when no apparent C++ code
+  exists.  Likewise for other langs.
+
+* in depend2.am, in specialization case, what if @SOURCE@ is found
+  in srcdir?  We can't depend on $<!  We must search explicitly.
+
 * Add a way to say that foo/bar.h should be installed as
   $(includedir)/foo/bar.h without introducing a new dir var
 
index 8e099a6..e3b5a2a 100755 (executable)
@@ -89,14 +89,10 @@ $default_strictness = $GNU;
 # Name of strictness level, as set on command line.
 $default_strictness_name = 'gnu';
 
-# This is TRUE if GNU make specific automatic dependency generation
-# code should be included in generated Makefile.in.
+# This is TRUE if automatic dependency generation code should be
+# included in generated Makefile.in.
 $cmdline_use_dependencies = 1;
 
-# This is the name of a dependency makefile bit (usually for inclusion in a
-# SMakefile or similar); empty if not set.
-$generate_deps = '';
-
 # TRUE if in verbose mode.
 $verbose = 0;
 
@@ -137,13 +133,6 @@ $output_directory = '.';
 # Relative location of top build directory.
 $top_builddir = '';
 
-# Absolute location of top build directory.
-$build_directory = '';
-
-# Name of srcdir as given in build directory's Makefile.  For
-# dependencies only.
-$srcdir_name = '';
-
 # List of Makefile.am's to process, and their corresponding outputs.
 @input_files = ();
 %output_files = ();
@@ -257,9 +246,6 @@ $in_file_name = '';
 # TRUE if --cygnus seen.
 $cygnus_mode = 0;
 
-# Keys of this hash are names of dependency files to ignore.
-%omit_dependencies = ();
-
 # Hash table of AM_CONDITIONAL variables seen in configure.
 %configure_cond = ();
 
@@ -388,27 +374,6 @@ $obsolete_rx = '(' . join ('|', keys %obsolete_macros) . ')';
 die "automake: no \`Makefile.am' found or specified\n"
     if ! @input_files;
 
-# If --generate-deps was given, we don't do anything else
-#
-if ($generate_deps)
-{
-    die "automake: Must specify --include-deps (or -i) when generating\n"
-       if $use_dependencies;
-    die "automake: Must provide --build-dir when generating\n"
-       if ! $build_directory;
-    die "automake: Must provide --srcdir-name when generating\n"
-       if ! $srcdir_name;
-
-    open (GDEP, ">$output_directory/.dep_segment")
-       || die "automake: Could not open `$output_directory/.dep_segment': $!\n";
-
-    &handle_dependencies;
-    print GDEP $output_rules;
-
-    close(GDEP);
-    exit $exit_status;
-}
-
 # Now do all the work on each file.
 foreach $am_file (@input_files)
 {
@@ -464,28 +429,6 @@ sub parse_arguments
            shift (@arglist);
            $am_dir = $arglist[0];
        }
-       elsif ($arglist[0] =~ /^--build-dir=(.+)$/)
-       {
-           # Must end in /.
-           $build_directory = $1 . '/';
-       }
-       elsif ($arglist[0] eq '--build-dir')
-       {
-           &require_argument (@arglist);
-           shift (@arglist);
-           # Must end in /.
-           $build_directory = $arglist[0] . '/';
-       }
-       elsif ($arglist[0] =~ /^--srcdir-name=(.+)$/)
-       {
-           $srcdir_name = $1;
-       }
-       elsif ($arglist[0] eq '--srcdir-name')
-       {
-           &require_argument (@arglist);
-           shift (@arglist);
-           $srcdir_name = $arglist[0];
-       }
        elsif ($arglist[0] eq '--gnu')
        {
            &set_strictness ('gnu');
@@ -502,13 +445,13 @@ sub parse_arguments
        {
            &set_strictness ('foreign');
        }
-       elsif ($arglist[0] eq '--include-deps' || $arglist[0] eq '-i')
+       elsif ($arglist[0] eq '--include-deps')
        {
-           $cmdline_use_dependencies = 0;
+           $cmdline_use_dependencies = 1;
        }
-       elsif ($arglist[0] eq '--generate-deps')
+       elsif ($arglist[0] eq '--ignore-deps' || $arglist[0] eq '-i')
        {
-           $generate_deps = 1;
+           $cmdline_use_dependencies = 0;
        }
        elsif ($arglist[0] eq '--no-force')
        {
@@ -878,10 +821,7 @@ sub get_object_extension
     if ($seen_libtool && ! $included_libtool_compile)
     {
        # Output the libtool compilation rules.
-       $output_rules .=
-           &file_contents_with_transform
-               ($use_dependencies ? 's/^NOTDEPEND.*$//;' : 's/^NOTDEPEND//;',
-                'libtool');
+       $output_rules .= &file_contents ('libtool');
 
        &push_phony_cleaners ('libtool');
 
@@ -981,9 +921,20 @@ sub finish_languages
     {
        $lang = $extension_map{$ext};
 
-       # Generate the appropriate rules for this extension.
+       # Generate the appropriate rules for this extension.  If
+       # dependency tracking was requested, and this extension
+       # supports it, then we don't generate the rule here.
        local ($comp) = '';
-       if (defined $language_map{$lang . '-compile'})
+       
+       if ($use_dependencies && $language_map{$lang . '-autodep'} ne 'no')
+       {
+           # Don't generate the rule, but still generate the variables.
+           if (defined $language_map{$lang . '-compile'})
+           {
+               $comp = $language_map{$lang . '-compile'};
+           }
+       }
+       elsif (defined $language_map{$lang . '-compile'})
        {
            $comp = $language_map{$lang . '-compile'};
 
@@ -1399,7 +1350,10 @@ sub handle_single_transform_list
 
            # Transform .o or $o file into .P file (for automatic
            # dependency code).
-           $dep_files{'.deps/' . $xbase . '.P'} = 1;
+           local ($depfile) = $object;
+           $depfile =~ s/\.([^.]*)$/.P$1/;
+           $depfile =~ s/\$\(OBJEXT\)$/o/ if $seen_objext;
+           $dep_files{'$(DEPDIR)/' . $depfile} = 1;
        }
     }
 
@@ -1616,6 +1570,8 @@ sub handle_lib_objects_cond
        # means adding entries to dep_files.
        if ($lsearch =~ /^\@(LT)?LIBOBJS\@$/)
        {
+           local ($myobjext) = ($1 ? 'l' : '') . 'o';
+
            push (@dep_list, $lsearch);
            $seen_libobjs = 1;
            if (! keys %libsources)
@@ -1638,8 +1594,8 @@ sub handle_lib_objects_cond
                }
                elsif ($iter ne 'alloca.c')
                {
-                   ($rewrite = $iter) =~ s/\.c$/.P/;
-                   $dep_files{'.deps/' . $rewrite} = 1;
+                   ($rewrite = $iter) =~ s/\.c$/.P$myobjext/;
+                   $dep_files{'$(DEPDIR)/' . $rewrite} = 1;
                    ($rewrite = $iter) =~ s/(\W)/\\$1/g;
                    $rewrite = "^" . $rewrite . "\$";
                    # Only require the file if it is not a built source.
@@ -1655,11 +1611,13 @@ sub handle_lib_objects_cond
        }
        elsif ($lsearch =~ /^\@(LT)?ALLOCA\@$/)
        {
+           local ($myobjext) = ($1 ? 'l' : '') . 'o';
+
            push (@dep_list, $lsearch);
            &am_line_error ($var,
                            "\@$1" . "ALLOCA\@ seen but \`AC_FUNC_ALLOCA' not in \`configure.in'")
                if ! defined $libsources{'alloca.c'};
-           $dep_files{'.deps/alloca.P'} = 1;
+           $dep_files{'$(DEPDIR)/alloca.P' . $myobjext} = 1;
            &require_file_with_line ($var, $FOREIGN, 'alloca.c');
            &saw_extension ('c');
        }
@@ -2613,42 +2571,6 @@ sub handle_dist_worker
                          . "\tmkdir \$(distdir)\n");
     }
 
-    # Only run automake in `dist' target if --include-deps and
-    # `no-dependencies' not specified.  That way the recipient of a
-    # distribution can run "make dist" and not need Automake.  You
-    # might be wondering why we run automake once for each directory
-    # we distribute, instead of running it once at the top level.  The
-    # answer is that we want to run automake after the dependencies
-    # have been generated.  This occurs when "make" is run in the
-    # subdir.  So automake must be run after make has updated the
-    # Makefile, which means that it must run once per directory.
-    if ($use_dependencies)
-    {
-       $output_rules .=
-           (
-            # There are several directories we need to know about
-            # when rebuilding the Makefile.ins.  They are:
-            #   here - The absolute path to our topmost build directory.
-            #   top_distdir - The absolute path to the top of our dist
-            #                 hierarchy.
-            #   distdir - The path to our sub-part of the dist hierarchy.
-            # If this directory is the topmost directory, we set
-            # top_distdir from distdir; that lets us pass in distdir
-            # from an enclosing package.
-            "\t" . 'here=`cd $(top_builddir) && pwd`; ' . "\\\n"
-            . "\t" . 'top_distdir=`cd $('
-            . (($relative_dir eq '.') ? 'distdir' : 'top_distdir')
-            . ') && pwd`; ' . "\\\n"
-            . "\t" . 'distdir=`cd $(distdir) && pwd`; ' . "\\\n"
-            . "\tcd \$(top_srcdir) \\\n"
-            . "\t  && \$(AUTOMAKE) --include-deps --build-dir=\$\$here --srcdir-name=\$(top_srcdir) --output-dir=\$\$top_distdir "
-            # Set strictness of output.
-            . ($cygnus_mode ? '--cygnus' : ('--' . $strictness_name))
-            . ($cmdline_use_dependencies ? '' : ' --include-deps')
-            . " " . $makefile . "\n"
-            );
-    }
-
     # Scan EXTRA_DIST to see if we need to distribute anything from a
     # subdir.  If so, add it to the list.  I didn't want to do this
     # originally, but there were so many requests that I finally
@@ -2913,112 +2835,6 @@ sub handle_dist
     &handle_dist_worker ($makefile);
 }
 
-# Scan a single dependency file and rewrite the dependencies as
-# appropriate.  Essentially this means:
-# * Clean out absolute dependencies which are not desirable.
-# * Rewrite other dependencies to be relative to $(top_srcdir).
-sub scan_dependency_file
-{
-    local ($depfile) = @_;
-
-    if (! open (DEP_FILE, $depfile))
-    {
-       &am_error ("couldn't open \`$depfile': $!");
-       return;
-    }
-    print "automake: reading $depfile\n" if $verbose;
-
-    # Sometimes it is necessary to omit some dependencies.
-    local (%omit) = %omit_dependencies;
-    if (&variable_defined ('OMIT_DEPENDENCIES'))
-    {
-       # FIXME: Doesn't work with conditionals.  I'm not sure if this
-       # matters.
-       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);
-    ($fixup_rx = $srcdir_name . '/' . $relative_dir . '/')
-       =~ s/(\W)/\\$1/g;
-    ($srcdir_rx = $srcdir_name . '/') =~ s/(\W)/\\$1/g;
-
-    local ($rewrite_builddir) = (($top_builddir eq '.')
-                                ? ''
-                                : $top_builddir . '/');
-
-    while (<DEP_FILE>)
-    {
-       last if $last_line;
-       next if (/$WHITE_PATTERN/o);
-       chop;
-       if (! s/\\$//)
-       {
-           # No trailing "\" means this should be the last line of
-           # the first target.  We can have multiple targets due to
-           # the "deleted header file" fix.  For the generated
-           # Makefile we simply skip these fake targets.
-           $last_line = 1;
-       }
-
-       if ($first_line)
-       {
-           if (! /^([^:]+:)(.+)$/)
-           {
-             bad_format:
-               &am_error ("\`$depfile' has incorrect format");
-               close (DEP_FILE);
-               return;
-           }
-
-           $_ = $2;
-           # Make sure to strip the .P file from the target.
-           ($target = $1) =~ s, *\.deps/[^.]+\.P,,;
-
-           $first_line = 0;
-       }
-
-       foreach $one_dep (split (' ', $_))
-       {
-           ($just_file = $one_dep) =~ s,^.*/,,;
-           next if defined $omit{$just_file};
-
-           if ($one_dep =~ /^$fixup_rx/)
-           {
-               # The dependency points to the current directory in
-               # some way.
-               ($xform = $one_dep) =~ s/^$fixup_rx//;
-               push (@dependencies, $xform);
-           }
-           elsif ($one_dep =~ /^$srcdir_rx/)
-           {
-               # The dependency is in some other directory in the package.
-               ($xform = $one_dep) =~ s/^$srcdir_rx/$rewrite_builddir/;
-               push (@dependencies, $xform);
-           }
-           elsif ($one_dep =~ /^\// || $one_dep =~ /^[A-Za-z]:\\/)
-           {
-               # Absolute path; ignore.
-           }
-           else
-           {
-               # Anything else is assumed to be correct.
-               push (@dependencies, $one_dep);
-           }
-       }
-    }
-
-    &pretty_print_rule ($target, "\t", @dependencies);
-
-    close (DEP_FILE);
-}
-
 # A subroutine of handle_dependencies.  This function includes
 # `depend2' with appropriate transformations.
 sub add_depend2
@@ -3028,16 +2844,26 @@ sub add_depend2
     # First include code for ordinary objects.
     local ($key) = $lang . '-autodep';
     local ($xform, $ext);
-    $xform = ('s/\@COMPILE\@/\$(' . $language_map{$key} . 'COMPILE)/g;'
-             . 's/\@LTCOMPILE\@/\$(LT' . $language_map{$key} . 'COMPILE)/g;'
-             . 's/\@OBJ\@/%.o/g;'
-             . 's/\@LTOBJ\@/%.lo/g;');
+
+    local ($pfx) = $language_map{$key};
+    local ($fpfx) = ($pfx eq '') ? 'CC' : $pfx;
+    $xform = ('s/\@PFX\@/' . $pfx . '/g;'
+             . 's/\@FPFX\@/' . $fpfx . '/g;'
+             . ($seen_objext ? 's/^OBJEXT//;' : 's/^OBJEXT.*$//;')
+             . ($seen_libtool ? 's/^LIBTOOL//;' : 's/^LIBTOOL.*$//;'));
+
+    local ($xform1) = ($xform
+                      . 's/\@BASE\@/\$\*/g;'
+                      . 's/\@SOURCE\@/\$\</g;'
+                      . 's/\@(LT|OBJ)?OBJ\@/\$\@/g;');
+
     foreach $ext (&lang_extensions ($lang))
     {
-       $output_rules .= &file_contents_with_transform ('s/\@SOURCE\@/%'
-                                                       . $ext . '/g;'
-                                                       . $xform,
-                                                       'depend2');
+       $output_rules .= (&file_contents_with_transform ('s/\@EXT\@/'
+                                                        . $ext . '/g;'
+                                                        . $xform1,
+                                                        'depend2')
+                         . "\n");
     }
 
     # Now include code for each specially handled object with this
@@ -3060,61 +2886,91 @@ sub add_depend2
 
        $rule =~ s,([/\$]),\\$1,g;
 
-       $xform = ('s/\@COMPILE\@/' . $rule . '/g;'
-                 . 's/\@LTCOMPILE\@/\$(LIBTOOL) --mode=compile ' . $rule
-                 . '/g;'
-                 . 's/\@OBJ\@/' . $obj . '.o/g;'
-                 . 's/\@LTOBJ\@/' . $obj . '.lo/g;'
-                 . 's/\@SOURCE\@/' . $source . '/g;');
-       $output_rules .= &file_contents_with_transform ($xform, 'depend2');
+       # Generate a transform which will turn suffix targets in
+       # depend2.am into real targets for the particular objects we
+       # are building.
+       $output_rules .=
+           &file_contents_with_transform ($xform
+                                          # Generate rule for `.o'.
+                                          . 's/^\@EXT\@\.o:/'
+                                          . $obj . '.o: ' . $source
+                                          . '/g;'
+                                          # Maybe generate rule for `.lo'.
+                                          # Might be eliminated by
+                                          # $XFORM.
+                                          . 's/^\@EXT\@\.lo:/'
+                                          . $obj . '.lo: ' . $source
+                                          . '/g;'
+                                          # Maybe generate rule for `.obj'.
+                                          # Might be eliminated by
+                                          # $XFORM.
+                                          . 's/^\@EXT\@\.obj:/'
+                                          . $obj . '.obj: ' . $source
+                                          . '/g;'
+                                          # Handle source and obj
+                                          # transforms.
+                                          . 's/\@OBJ\@/' . $obj . '.o/g;'
+                                          . 's/\@OBJOBJ\@/' . $obj . '.obj/g;'
+                                          . 's/\@LTOBJ\@/' . $obj . '.lo/g;'
+                                          . 's/\@BASE\@/' . $obj . '/g;'
+                                          . 's/\@SOURCE\@/' . $source . '/g;',
+                                          'depend2');
     }
 }
 
 # Handle auto-dependency code.
 sub handle_dependencies
 {
-    # Make sure this variable is always marked as used.
-    &examine_variable ('OMIT_DEPENDENCIES');
-
     if ($use_dependencies)
     {
-       # Include GNU-make-specific auto-dep code.  Don't include it
-       # if DEP_FILES would be empty.
+       # Include auto-dep code.  Don't include it if DEP_FILES would
+       # be empty.
        if (&saw_sources_p (0) && keys %dep_files)
        {
-           &define_pretty_variable ('DEP_FILES', '', sort keys %dep_files);
-           $output_rules .= &file_contents ('depend');
-           push (@clean, 'depend');
-           &push_phony_cleaners ('depend');
-
-           local ($key, $lang, $ext, $xform);
-           foreach $key (sort keys %language_map)
+           # Set location of depcomp.
+           if ($config_aux_dir ne '.' && $config_aux_dir ne '')
            {
-               if ($key =~ /^(.*)-autodep$/
-                   && $language_map{$key} ne 'no')
-               {
-                   &add_depend2 ($1);
-               }
+               &define_variable ('depcomp', ('$(SHELL) ' . $config_aux_dir
+                                             . '/depcomp'));
            }
-       }
-    }
-    elsif ($build_directory ne '')
-    {
-       # Include any auto-generated deps that are present.  Note that
-       # $build_directory ends in a "/".
-       if (-d ($build_directory . $relative_dir . "/.deps"))
-       {
-           local ($depfile);
-
-           foreach $depfile (&my_glob ($build_directory
-                                       . $relative_dir . "/.deps/*.P"))
+           else
            {
-               &scan_dependency_file ($depfile);
+               &define_variable ('depcomp',
+                                 '$(SHELL) $(top_srcdir)/depcomp');
            }
 
+           local ($iter);
+           local (@deplist) = sort keys %dep_files;
+
+           &define_pretty_variable ('DEP_FILES', '', ("\@AMDEP\@", @deplist));
+
+           # Generate each `include' individually.  Irix 6 make will
+           # not properly include several files resulting from a
+           # variable expansion; generating many separate includes
+           # seems safest.
            $output_rules .= "\n";
+           foreach $iter (@deplist)
+           {
+               $output_rules .= "\@AMDEP\@" . 'include ' . $iter . "\n";
+           }
+
+           $output_rules .= &file_contents ('depend');
+           push (@clean, 'depend');
+           &push_phony_cleaners ('depend');
        }
     }
+    else
+    {
+       &define_variable ('depcomp', '');
+    }
+
+    local ($key, $lang, $ext, $xform);
+    foreach $key (sort keys %language_map)
+    {
+       next unless $key =~ /^(.*)-autodep$/;
+       next if $language_map{$key} eq 'no';
+       &add_depend2 ($1);
+    }
 }
 
 # Handle subdirectories.
@@ -3313,7 +3169,7 @@ sub handle_configure
                       . "\n"
                      . "\tcd \$(top_srcdir) && \$(AUTOMAKE) "
                      . ($cygnus_mode ? '--cygnus' : ('--' . $strictness_name))
-                     . ($cmdline_use_dependencies ? '' : ' --include-deps')
+                     . ($cmdline_use_dependencies ? '' : ' --ignore-deps')
                      . ' ' . $input . $colon_infile . "\n\n");
 
     # This rule remakes the Makefile.
@@ -4752,6 +4608,10 @@ sub scan_configure
     # the file-finding machinery works.
     local ($relative_dir) = '.';
     &require_config_file ($FOREIGN, 'install-sh', 'mkinstalldirs', 'missing');
+    if ($cmdline_use_dependencies)
+    {
+       &require_config_file ($FOREIGN, 'depcomp');
+    }
     &am_error ("\`install.sh' is an anachronism; use \`install-sh' instead")
         if -f $config_aux_path[0] . '/install.sh';
 }
@@ -6655,7 +6515,7 @@ sub initialize_global_constants
         "libversion.in", "mdate-sh", "mkinstalldirs", "install-sh",
         'texinfo.tex', "ansi2knr.c", "ansi2knr.1", 'elisp-comp',
         'ylwrap', 'acinclude.m4', @libtoolize_files,
-        'missing', 'compile'
+        'missing', 'depcomp', 'compile'
         );
 
     # Commonly used files we auto-include, but only sometimes.
@@ -6668,18 +6528,17 @@ sub initialize_global_constants
     $USAGE = "\
   -a, --add-missing     add missing standard files to package
   --amdir=DIR           directory storing config files
-  --build-dir=DIR       directory where build being done (for dependencies)
   -c, --copy            with -a, copy missing files (default is symlink)
   --cygnus              assume program is part of Cygnus-style tree
   --foreign             set strictness to foreign
   --gnits               set strictness to gnits
   --gnu                 set strictness to gnu
   --help                print this help, then exit
-  -i, --include-deps    include generated dependencies in Makefile.in
+  -i, --ignore-deps     disable dependency tracking code
+  --include-deps        enable dependency tracking code
   --no-force            only update Makefile.in's that are out of date
   -o DIR, --output-dir=DIR
                         put generated Makefile.in's into DIR
-  --srcdir-name=DIR     name used for srcdir (for dependencies)
   -v, --verbose         verbosely list files processed
   --version             print version number, then exit\n";
 
@@ -6710,10 +6569,10 @@ sub initialize_global_constants
        || chmod -R a+r $(distdir)
 ';
     $dist{'dist-bzip2'} = ("\t"
-                          . '$(AMTAR) ch$(AMTARFLAGS)f - $(distdir) | bzip --best -c > $(distdir).bz2'
+                          . '$(AMTAR) chof - $(distdir) | bzip --best -c > $(distdir).bz2'
                           . "\n");
     $dist{'dist-tarZ'} = ("\t"
-                    . '$(AMTAR) ch$(AMTARFLAGS)f - $(distdir) | compress -c > $(distdir).tar.Z'
+                    . '$(AMTAR) chof - $(distdir) | compress -c > $(distdir).tar.Z'
                     . "\n");
     $dist{'dist-shar'} = ("\t"
                     . 'shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c > $(distdir).shar.gz'
@@ -6721,7 +6580,7 @@ sub initialize_global_constants
     $dist{'dist-zip'} = ("\t" . '-rm -f $(distdir).zip' . "\n" .
                         "\t" . 'zip -rq $(distdir).zip $(distdir)' . "\n");
     $dist{'dist'} = ("\t"
-                    .  '$(AMTAR) ch$(AMTARFLAGS)f - $(distdir) | GZIP=$(GZIP_ENV) gzip -c > $(distdir).tar.gz'
+                    .  '$(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c > $(distdir).tar.gz'
                     . "\n");
     $dist_trailer = "\t" . '-chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir)' . "\n";
 }
index 0af48b2..399ec9f 100644 (file)
@@ -966,12 +966,11 @@ Use @code{AM_MISSING_PROG} to see whether the programs @code{aclocal},
 @code{autoconf}, @code{automake}, @code{autoheader}, and @code{makeinfo}
 are in the build environment.  Here is how this is done:
 @example
-missing_dir=`cd $ac_aux_dir && pwd`
-AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
-AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
-AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
-AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
-AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
+AM_MISSING_PROG(ACLOCAL, aclocal)
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake)
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
 @end example
 @end itemize
 
index fbe0943..f199ebe 100644 (file)
@@ -27,12 +27,12 @@ RUNTESTDEFAULTFLAGS = --tool $(DEJATOOL) --srcdir $$srcdir
 
 check-DEJAGNU: site.exp
 ## Life is easiest with an absolute srcdir, so do that.
-       srcdir=`cd $(srcdir) && pwd`; export srcdir; \
+       srcdir=`CDPATH=: && cd $(srcdir) && pwd`; export srcdir; \
        EXPECT=$(EXPECT); export EXPECT; \
 ## Allow this to work when expect and DejaGNU are in tree.
 ## Only required when --cygnus in force.
 CYGNUS if [ -f $(top_builddir)/../expect/expect ]; then \
-CYGNUS   TCL_LIBRARY=`cd $(top_srcdir)/../tcl/library && pwd`; \
+CYGNUS   TCL_LIBRARY=`CDPATH=: && cd $(top_srcdir)/../tcl/library && pwd`; \
 CYGNUS   export TCL_LIBRARY; \
 CYGNUS fi; \
        runtest=$(RUNTEST); \
diff --git a/depcomp b/depcomp
new file mode 100755 (executable)
index 0000000..eb42e39
--- /dev/null
+++ b/depcomp
@@ -0,0 +1,284 @@
+#! /bin/sh
+
+# depcomp - compile a program generating dependencies as side-effects
+# Copyright (C) 1999 Free Software Foundation, Inc.
+
+# This program 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.
+
+# This program 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 this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+  echo "depcomp: Variables source, object and depmode must be set" 1>&2
+  exit 1
+fi
+
+depfile=${depfile-`echo "$object" | sed 's,\([^/]*\)$,.deps/\1,;s/\.\([^.]*\)$/.P\1/'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+if test "$depmode" = hp; then
+  # HP compiler uses -M and no extra arg.
+  gccflag=-M
+  depmode=gcc
+fi
+
+case "$depmode" in
+hp)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
+
+gcc)
+## There are various ways to get dependency output from gcc.  Here's
+## why we pick this rather obscure method:
+## - Don't want to use -MD because we'd like the dependencies to end
+##   up in a subdir.  Having to rename by hand is ugly.
+##   (We might end up doing this anyway to support other compilers.)
+## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
+##   -MM, not -M (despite what the docs say).
+## - Using -M directly means running the compiler twice (even worse
+##   than renaming).
+  if test -z "$gccflag"; then
+    gccflag=-MD,
+  fi
+  if "$@" -Wp,"$gccflag$tmpdepfile"; then :
+  else
+    stat=$?
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile" 
+  echo "$object : \\" > "$depfile"
+  sed 's/^[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+## This next piece of magic avoids the `deleted header file' problem.
+## The problem is that when a header file which appears in a .P file
+## is deleted, the dependency causes make to die (because there is
+## typically no way to rebuild the header).  We avoid this by adding
+## dummy dependencies for each header file.  Too bad gcc doesn't do
+## this for us directly.
+  tr ' ' '
+' < "$tmpdepfile" |
+## Some versions of gcc put a space before the `:'.  On the theory
+## that the space means something, we add a space to the output as
+## well.
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+dashmd)
+  # The Java front end to gcc doesn't run cpp, so we can't use the -Wp
+  # trick.  Instead we must use -M and then rename the resulting .d
+  # file.  This is also the case for older versions of gcc, which
+  # don't implement -Wp.
+  if "$@" -MD; then :
+  else
+    stat=$?
+    rm -f FIXME
+    exit $stat
+  fi
+  FIXME: rewrite the file
+  ;;
+
+sgi)
+  if "$@" -MDupdate "$tmpdepfile"; then :
+  else
+    stat=$?
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile" 
+  echo "$object : \\" > "$depfile"
+  sed 's/^[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+  tr ' ' '
+' < "$tmpdepfile" | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+#nosideeffect)
+  # This comment above is used by automake to tell side-effect
+  # dependency tracking mechanisms from slower ones.
+
+dashmstdout)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the proprocessed file to stdout, regardless of -o,
+  # because we must use -o when running libtool.
+  ( IFS=" "
+    case " $* " in
+    *" --mode=compile "*) # this is libtool, let us make it quiet
+      for arg
+      do # cycle over the arguments
+        case "$arg" in
+       "--mode=compile")
+         # insert --quiet before "--mode=compile"
+         set fnord "$@" --quiet
+         shift # fnord
+         ;;
+       esac
+       set fnord "$@" "$arg"
+       shift # fnord
+       shift # "$arg"
+      done
+      ;;
+    esac
+    "$@" -M | sed 's:^[^:]*\:[         ]*:'"$object"'\: :' > "$tmpdepfile"
+  ) &
+  proc=$!
+  "$@"
+  stat=$?
+  wait "$proc"
+  if test "$stat" != 0; then exit $stat; fi
+  rm -f "$depfile" 
+  cat < "$tmpdepfile" > "$depfile"
+  tr ' ' '
+' < "$tmpdepfile" | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+dashXmstdout)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the proprocessed file to stdout, regardless of -o,
+  # because we must use -o when running libtool.
+  ( IFS=" "
+    case " $* " in
+    *" --mode=compile "*) # this is libtool, let us make it quiet
+      for arg
+      do # cycle over the arguments
+        case "$arg" in
+       "--mode=compile")
+         # insert --quiet before "--mode=compile"
+         set fnord "$@" --quiet
+         shift # fnord
+         ;;
+       esac
+       set fnord "$@" "$arg"
+       shift # fnord
+       shift # "$arg"
+      done
+      ;;
+    esac
+    "$@" -xM | sed 's:^[^:]*\:[        ]*:'"$object"'\: :' > "$tmpdepfile"
+  ) &
+  proc=$!
+  "$@"
+  stat=$?
+  wait "$proc"
+  if test "$stat" != 0; then exit $stat; fi
+  rm -f "$depfile" 
+  cat < "$tmpdepfile" > "$depfile"
+  tr ' ' '
+' < "$tmpdepfile" | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+makedepend)
+  # X makedepend
+  (
+    shift
+    cleared=no
+    for arg in "$@"; do
+      case $cleared in no)
+        set ""; shift
+       cleared=yes
+      esac
+      case "$arg" in
+        -D*|-I*)
+         set fnord "$@" "$arg"; shift;;
+       -*)
+         ;;
+       *)
+         set fnord "$@" "$arg"; shift;;
+      esac
+    done
+    obj_suffix="`echo $object | sed 's/^.*\././'`"
+    touch "$tmpdepfile"
+    ${MAKEDEPEND-makedepend} 2>/dev/null -o"$obj_suffix" -f"$tmpdepfile" "$@"
+  ) &
+  proc=$!
+  "$@"
+  stat=$?
+  wait "$proc"
+  if test "$stat" != 0; then exit $stat; fi
+  rm -f "$depfile" 
+  cat < "$tmpdepfile" > "$depfile"
+  tail +3 "$tmpdepfile" | tr ' ' '
+' | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile" "$tmpdepfile".bak
+  ;;
+
+cpp)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the proprocessed file to stdout, regardless of -o,
+  # because we must use -o when running libtool.
+  ( IFS=" "
+    case " $* " in
+    *" --mode=compile "*)
+      for arg
+      do # cycle over the arguments
+        case "$arg" in
+       "--mode=compile")
+         # insert --quiet before "--mode=compile"
+         set fnord "$@" --quiet
+         shift # fnord
+         ;;
+       esac
+       set fnord "$@" "$arg"
+       shift # fnord
+       shift # "$arg"
+      done
+      ;;
+    esac
+    "$@" -E |
+    sed -n '/^# [0-9][0-9]* "\([^"]*\)"/ s::'"$object"'\: \1:p' > "$tmpdepfile"
+  ) &
+  proc=$!
+  "$@"
+  stat=$?
+  wait "$proc"
+  if test "$stat" != 0; then exit $stat; fi
+  rm -f "$depfile"
+  cat < "$tmpdepfile" > "$depfile"
+  sed < "$tmpdepfile" -e 's/^[^:]*: //' -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+none)
+  exec "$@"
+  ;;
+
+*)
+  echo "Unknown depmode $depmode" 1>&2
+  exit 1
+  ;;
+esac
+
+exit 0
index 9717458..881326b 100644 (file)
--- a/depend.am
+++ b/depend.am
@@ -1,5 +1,5 @@
 ## automake - create Makefile.in from Makefile.am
-## Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+## Copyright (C) 1994, 1995-98, 1999 Free Software Foundation, Inc.
 
 ## This program is free software; you can redistribute it and/or modify
 ## it under the terms of the GNU General Public License as published by
 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 ## 02111-1307, USA.
 
-## This fragment is probably only useful for maintainers.  It relies
-## on GNU make and gcc.  It is only included in the generated
-## Makefile.in if `automake' is not passed the `--include-deps' flag.
-
-## We must create the .deps directory if it doesn't exist.  We do it
-## in this strange way to make sure the .deps directory exists,
-## without trying to run mkdir for each compilation.
-DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
-
--include $(DEP_FILES)
-
 mostlyclean-depend:
 
 clean-depend:
 
 distclean-depend:
-       -rm -rf .deps
+       -rm -rf $(DEPDIR)
 
 maintainer-clean-depend:
index 7d68dbf..1c3a5d7 100644 (file)
 ## along with this program; if not, write to the Free Software
 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 ## 02111-1307, USA.
-@OBJ@: @SOURCE@
-       @echo '@COMPILE@ -c -o $@ $<'; \
-## There are various ways to get dependency output from gcc.  Here's
-## why we pick this rather obscure method:
-## - Don't want to use -MD because we'd like the dependencies to end
-##   up in a subdir.  Having to rename by hand is ugly.
-##   (We might end up doing this anyway to support other compilers.)
-## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
-##   -MM, not -M (despite what the docs say).
-## - Using -M directly means running the compiler twice (even worse
-##   than renaming).
-       @COMPILE@ -Wp,-MD,.deps/$(*D)/$(*F).pp -c -o $@ $<
-## This next piece of magic avoids the `deleted header file' problem.
-## The problem is that when a header file which appears in a .P file
-## is deleted, the dependency causes make to die (because there is
-## typically no way to rebuild the header).  We avoid this by adding
-## dummy dependencies for each header file.  Too bad gcc doesn't do
-## this for us directly.
-       @-cp .deps/$(*D)/$(*F).pp .deps/$(*D)/$(*F).P; \
-       tr ' ' '\012' < .deps/$(*D)/$(*F).pp \
-## Some versions of gcc put a space before the `:'.  On the theory
-## that the space means something, we add a space to the output as
-## well.
-         | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
-           >> .deps/$(*D)/$(*F).P; \
-       rm .deps/$(*D)/$(*F).pp
+## Note that this must all be on one line to avoid a problem with
+## automake's `.am' file reader.  This is a convenience macro a user
+## can use to run a compilation.  You should set the shell variables
+## `file' and `compile' first.
+@AMDEP@@FPFX@DEPMODE = @@FPFX@DEPMODE@
 
-@LTOBJ@: @SOURCE@
-       @echo '@LTCOMPILE@ -c -o $@ $<'; \
-## See above to understand implementation weirdness.
-       @LTCOMPILE@ -Wp,-MD,.deps/$(*D)/$(*F).pp -c -o $@ $<
-## Account for versions of gcc that put a space before the `:'.
-       @-sed -e 's/^\([^:]*\)\.o[      ]*:/\1.lo \1.o :/' \
-         < .deps/$(*D)/$(*F).pp > .deps/$(*D)/$(*F).P; \
-## See above to understand deleted header file trick.
-       tr ' ' '\012' < .deps/$(*D)/$(*F).pp \
-## Some versions of gcc put a space before the `:'.  On the theory
-## that the space means something, we add a space to the output as
-## well.
-         | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
-           >> .deps/$(*D)/$(*F).P; \
-       rm -f .deps/$(*D)/$(*F).pp
+@EXT@.o:
+@AMDEP@        source='@SOURCE@' object='@OBJ@' @AMDEPBACKSLASH@
+@AMDEP@        depfile='$(DEPDIR)/@BASE@.Po' tmpdepfile='$(DEPDIR)/@BASE@.TPo' @AMDEPBACKSLASH@
+@AMDEP@        $(@FPFX@DEPMODE) $(depcomp) @AMDEPBACKSLASH@
+       $(@PFX@COMPILE) -c -o @OBJ@ @SOURCE@
+
+LIBTOOL@EXT@.lo:
+LIBTOOL@AMDEP@ source='@SOURCE@' object='@LTOBJ@' @AMDEPBACKSLASH@
+LIBTOOL@AMDEP@ depfile='$(DEPDIR)/@BASE@.Plo' tmpdepfile='$(DEPDIR)/@BASE@.TPlo' @AMDEPBACKSLASH@
+LIBTOOL@AMDEP@ $(@FPFX@DEPMODE) $(depcomp) @AMDEPBACKSLASH@
+LIBTOOL        $(LT@PFX@COMPILE) -c -o @LTOBJ@ @SOURCE@
+
+OBJEXT@EXT@.obj:
+OBJEXT@AMDEP@  source='@SOURCE@' object='@OBJOBJ@' @AMDEPBACKSLASH@
+OBJEXT@AMDEP@  depfile='$(DEPDIR)/@BASE@.Po' tmpdepfile='$(DEPDIR)/@BASE@.TPo' @AMDEPBACKSLASH@
+OBJEXT@AMDEP@  $(@FPFX@DEPMODE) $(depcomp) @AMDEPBACKSLASH@
+OBJEXT $(@PFX@COMPILE) -c -o @OBJOBJ@ `cygpath -w @SOURCE@`
diff --git a/dist.am b/dist.am
index 347ac16..5c3f561 100644 (file)
--- a/dist.am
+++ b/dist.am
@@ -30,7 +30,7 @@ distcheck: dist
        mkdir $(distdir)/=inst
 ## Undo the write access.
        chmod a-w $(distdir)
-       dc_install_base=`cd $(distdir)/=inst && pwd` \
+       dc_install_base=`CDPATH=: && cd $(distdir)/=inst && pwd` \
 DISTHOOK         && $(MAKE) $(AM_MAKEFLAGS) distcheck-hook \
          && cd $(distdir)/=build \
          && ../configure --srcdir=.. --prefix=$$dc_install_base \
index 4c2dac4..6d192d5 100644 (file)
@@ -26,7 +26,7 @@ $(amfiles)
 ## what we want.  So we make them executable by hand.
 scriptdir = $(pkgdatadir)
 dist_script_DATA = config.guess config.sub install-sh mdate-sh missing \
-mkinstalldirs elisp-comp ylwrap acinstall compile
+mkinstalldirs elisp-comp ylwrap acinstall depcomp compile
 
 install-data-hook:
        @$(POST_INSTALL)
@@ -104,6 +104,12 @@ maintainer-check: automake aclocal
          echo "Found bad split in automake.in" 1>&2; \
          exit 1; \
        fi
+## Look for cd within backquotes without CDPATH=:
+       @if grep '` *cd ' $(srcdir)/automake.in $(srcdir)/*.am \
+             $(srcdir)/m4/*.m4; then \
+         echo "Consider setting CDPATH in the lines above" 1>&2; \
+         exit 1; \
+       fi
 
 # Tag before making distribution.  Also, don't make a distribution if
 # checks fail.  Also, make sure the NEWS file is up-to-date.
index fbe0943..f199ebe 100644 (file)
@@ -27,12 +27,12 @@ RUNTESTDEFAULTFLAGS = --tool $(DEJATOOL) --srcdir $$srcdir
 
 check-DEJAGNU: site.exp
 ## Life is easiest with an absolute srcdir, so do that.
-       srcdir=`cd $(srcdir) && pwd`; export srcdir; \
+       srcdir=`CDPATH=: && cd $(srcdir) && pwd`; export srcdir; \
        EXPECT=$(EXPECT); export EXPECT; \
 ## Allow this to work when expect and DejaGNU are in tree.
 ## Only required when --cygnus in force.
 CYGNUS if [ -f $(top_builddir)/../expect/expect ]; then \
-CYGNUS   TCL_LIBRARY=`cd $(top_srcdir)/../tcl/library && pwd`; \
+CYGNUS   TCL_LIBRARY=`CDPATH=: && cd $(top_srcdir)/../tcl/library && pwd`; \
 CYGNUS   export TCL_LIBRARY; \
 CYGNUS fi; \
        runtest=$(RUNTEST); \
index 9717458..881326b 100644 (file)
@@ -1,5 +1,5 @@
 ## automake - create Makefile.in from Makefile.am
-## Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+## Copyright (C) 1994, 1995-98, 1999 Free Software Foundation, Inc.
 
 ## This program is free software; you can redistribute it and/or modify
 ## it under the terms of the GNU General Public License as published by
 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 ## 02111-1307, USA.
 
-## This fragment is probably only useful for maintainers.  It relies
-## on GNU make and gcc.  It is only included in the generated
-## Makefile.in if `automake' is not passed the `--include-deps' flag.
-
-## We must create the .deps directory if it doesn't exist.  We do it
-## in this strange way to make sure the .deps directory exists,
-## without trying to run mkdir for each compilation.
-DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
-
--include $(DEP_FILES)
-
 mostlyclean-depend:
 
 clean-depend:
 
 distclean-depend:
-       -rm -rf .deps
+       -rm -rf $(DEPDIR)
 
 maintainer-clean-depend:
index 7d68dbf..1c3a5d7 100644 (file)
 ## along with this program; if not, write to the Free Software
 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 ## 02111-1307, USA.
-@OBJ@: @SOURCE@
-       @echo '@COMPILE@ -c -o $@ $<'; \
-## There are various ways to get dependency output from gcc.  Here's
-## why we pick this rather obscure method:
-## - Don't want to use -MD because we'd like the dependencies to end
-##   up in a subdir.  Having to rename by hand is ugly.
-##   (We might end up doing this anyway to support other compilers.)
-## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
-##   -MM, not -M (despite what the docs say).
-## - Using -M directly means running the compiler twice (even worse
-##   than renaming).
-       @COMPILE@ -Wp,-MD,.deps/$(*D)/$(*F).pp -c -o $@ $<
-## This next piece of magic avoids the `deleted header file' problem.
-## The problem is that when a header file which appears in a .P file
-## is deleted, the dependency causes make to die (because there is
-## typically no way to rebuild the header).  We avoid this by adding
-## dummy dependencies for each header file.  Too bad gcc doesn't do
-## this for us directly.
-       @-cp .deps/$(*D)/$(*F).pp .deps/$(*D)/$(*F).P; \
-       tr ' ' '\012' < .deps/$(*D)/$(*F).pp \
-## Some versions of gcc put a space before the `:'.  On the theory
-## that the space means something, we add a space to the output as
-## well.
-         | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
-           >> .deps/$(*D)/$(*F).P; \
-       rm .deps/$(*D)/$(*F).pp
+## Note that this must all be on one line to avoid a problem with
+## automake's `.am' file reader.  This is a convenience macro a user
+## can use to run a compilation.  You should set the shell variables
+## `file' and `compile' first.
+@AMDEP@@FPFX@DEPMODE = @@FPFX@DEPMODE@
 
-@LTOBJ@: @SOURCE@
-       @echo '@LTCOMPILE@ -c -o $@ $<'; \
-## See above to understand implementation weirdness.
-       @LTCOMPILE@ -Wp,-MD,.deps/$(*D)/$(*F).pp -c -o $@ $<
-## Account for versions of gcc that put a space before the `:'.
-       @-sed -e 's/^\([^:]*\)\.o[      ]*:/\1.lo \1.o :/' \
-         < .deps/$(*D)/$(*F).pp > .deps/$(*D)/$(*F).P; \
-## See above to understand deleted header file trick.
-       tr ' ' '\012' < .deps/$(*D)/$(*F).pp \
-## Some versions of gcc put a space before the `:'.  On the theory
-## that the space means something, we add a space to the output as
-## well.
-         | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
-           >> .deps/$(*D)/$(*F).P; \
-       rm -f .deps/$(*D)/$(*F).pp
+@EXT@.o:
+@AMDEP@        source='@SOURCE@' object='@OBJ@' @AMDEPBACKSLASH@
+@AMDEP@        depfile='$(DEPDIR)/@BASE@.Po' tmpdepfile='$(DEPDIR)/@BASE@.TPo' @AMDEPBACKSLASH@
+@AMDEP@        $(@FPFX@DEPMODE) $(depcomp) @AMDEPBACKSLASH@
+       $(@PFX@COMPILE) -c -o @OBJ@ @SOURCE@
+
+LIBTOOL@EXT@.lo:
+LIBTOOL@AMDEP@ source='@SOURCE@' object='@LTOBJ@' @AMDEPBACKSLASH@
+LIBTOOL@AMDEP@ depfile='$(DEPDIR)/@BASE@.Plo' tmpdepfile='$(DEPDIR)/@BASE@.TPlo' @AMDEPBACKSLASH@
+LIBTOOL@AMDEP@ $(@FPFX@DEPMODE) $(depcomp) @AMDEPBACKSLASH@
+LIBTOOL        $(LT@PFX@COMPILE) -c -o @LTOBJ@ @SOURCE@
+
+OBJEXT@EXT@.obj:
+OBJEXT@AMDEP@  source='@SOURCE@' object='@OBJOBJ@' @AMDEPBACKSLASH@
+OBJEXT@AMDEP@  depfile='$(DEPDIR)/@BASE@.Po' tmpdepfile='$(DEPDIR)/@BASE@.TPo' @AMDEPBACKSLASH@
+OBJEXT@AMDEP@  $(@FPFX@DEPMODE) $(depcomp) @AMDEPBACKSLASH@
+OBJEXT $(@PFX@COMPILE) -c -o @OBJOBJ@ `cygpath -w @SOURCE@`
index db4c79a..da022d8 100644 (file)
@@ -146,7 +146,7 @@ CYGNUS        if test -f $$file; then d=.; else d=$(srcdir); fi; \
 NOTCYGNUS        d=$(srcdir); \
 ## We use these strange circumlocutions because we want the "ifile" to
 ## be relative, for the install.
-         for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
+         for ifile in `CDPATH=: && cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
            if test -f $$d/$$ifile; then \
              echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \
              $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \
@@ -201,7 +201,7 @@ dist-info: $(INFO_DEPS)
 ## 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 \
+         for file in `CDPATH=: && cd $$d && eval echo $$base*`; do \
            test -f $(distdir)/$$file \
            || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
            || cp -p $$d/$$file $(distdir)/$$file; \
diff --git a/lib/depcomp b/lib/depcomp
new file mode 100755 (executable)
index 0000000..eb42e39
--- /dev/null
@@ -0,0 +1,284 @@
+#! /bin/sh
+
+# depcomp - compile a program generating dependencies as side-effects
+# Copyright (C) 1999 Free Software Foundation, Inc.
+
+# This program 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.
+
+# This program 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 this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+  echo "depcomp: Variables source, object and depmode must be set" 1>&2
+  exit 1
+fi
+
+depfile=${depfile-`echo "$object" | sed 's,\([^/]*\)$,.deps/\1,;s/\.\([^.]*\)$/.P\1/'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+if test "$depmode" = hp; then
+  # HP compiler uses -M and no extra arg.
+  gccflag=-M
+  depmode=gcc
+fi
+
+case "$depmode" in
+hp)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
+
+gcc)
+## There are various ways to get dependency output from gcc.  Here's
+## why we pick this rather obscure method:
+## - Don't want to use -MD because we'd like the dependencies to end
+##   up in a subdir.  Having to rename by hand is ugly.
+##   (We might end up doing this anyway to support other compilers.)
+## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
+##   -MM, not -M (despite what the docs say).
+## - Using -M directly means running the compiler twice (even worse
+##   than renaming).
+  if test -z "$gccflag"; then
+    gccflag=-MD,
+  fi
+  if "$@" -Wp,"$gccflag$tmpdepfile"; then :
+  else
+    stat=$?
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile" 
+  echo "$object : \\" > "$depfile"
+  sed 's/^[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+## This next piece of magic avoids the `deleted header file' problem.
+## The problem is that when a header file which appears in a .P file
+## is deleted, the dependency causes make to die (because there is
+## typically no way to rebuild the header).  We avoid this by adding
+## dummy dependencies for each header file.  Too bad gcc doesn't do
+## this for us directly.
+  tr ' ' '
+' < "$tmpdepfile" |
+## Some versions of gcc put a space before the `:'.  On the theory
+## that the space means something, we add a space to the output as
+## well.
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+dashmd)
+  # The Java front end to gcc doesn't run cpp, so we can't use the -Wp
+  # trick.  Instead we must use -M and then rename the resulting .d
+  # file.  This is also the case for older versions of gcc, which
+  # don't implement -Wp.
+  if "$@" -MD; then :
+  else
+    stat=$?
+    rm -f FIXME
+    exit $stat
+  fi
+  FIXME: rewrite the file
+  ;;
+
+sgi)
+  if "$@" -MDupdate "$tmpdepfile"; then :
+  else
+    stat=$?
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile" 
+  echo "$object : \\" > "$depfile"
+  sed 's/^[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+  tr ' ' '
+' < "$tmpdepfile" | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+#nosideeffect)
+  # This comment above is used by automake to tell side-effect
+  # dependency tracking mechanisms from slower ones.
+
+dashmstdout)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the proprocessed file to stdout, regardless of -o,
+  # because we must use -o when running libtool.
+  ( IFS=" "
+    case " $* " in
+    *" --mode=compile "*) # this is libtool, let us make it quiet
+      for arg
+      do # cycle over the arguments
+        case "$arg" in
+       "--mode=compile")
+         # insert --quiet before "--mode=compile"
+         set fnord "$@" --quiet
+         shift # fnord
+         ;;
+       esac
+       set fnord "$@" "$arg"
+       shift # fnord
+       shift # "$arg"
+      done
+      ;;
+    esac
+    "$@" -M | sed 's:^[^:]*\:[         ]*:'"$object"'\: :' > "$tmpdepfile"
+  ) &
+  proc=$!
+  "$@"
+  stat=$?
+  wait "$proc"
+  if test "$stat" != 0; then exit $stat; fi
+  rm -f "$depfile" 
+  cat < "$tmpdepfile" > "$depfile"
+  tr ' ' '
+' < "$tmpdepfile" | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+dashXmstdout)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the proprocessed file to stdout, regardless of -o,
+  # because we must use -o when running libtool.
+  ( IFS=" "
+    case " $* " in
+    *" --mode=compile "*) # this is libtool, let us make it quiet
+      for arg
+      do # cycle over the arguments
+        case "$arg" in
+       "--mode=compile")
+         # insert --quiet before "--mode=compile"
+         set fnord "$@" --quiet
+         shift # fnord
+         ;;
+       esac
+       set fnord "$@" "$arg"
+       shift # fnord
+       shift # "$arg"
+      done
+      ;;
+    esac
+    "$@" -xM | sed 's:^[^:]*\:[        ]*:'"$object"'\: :' > "$tmpdepfile"
+  ) &
+  proc=$!
+  "$@"
+  stat=$?
+  wait "$proc"
+  if test "$stat" != 0; then exit $stat; fi
+  rm -f "$depfile" 
+  cat < "$tmpdepfile" > "$depfile"
+  tr ' ' '
+' < "$tmpdepfile" | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+makedepend)
+  # X makedepend
+  (
+    shift
+    cleared=no
+    for arg in "$@"; do
+      case $cleared in no)
+        set ""; shift
+       cleared=yes
+      esac
+      case "$arg" in
+        -D*|-I*)
+         set fnord "$@" "$arg"; shift;;
+       -*)
+         ;;
+       *)
+         set fnord "$@" "$arg"; shift;;
+      esac
+    done
+    obj_suffix="`echo $object | sed 's/^.*\././'`"
+    touch "$tmpdepfile"
+    ${MAKEDEPEND-makedepend} 2>/dev/null -o"$obj_suffix" -f"$tmpdepfile" "$@"
+  ) &
+  proc=$!
+  "$@"
+  stat=$?
+  wait "$proc"
+  if test "$stat" != 0; then exit $stat; fi
+  rm -f "$depfile" 
+  cat < "$tmpdepfile" > "$depfile"
+  tail +3 "$tmpdepfile" | tr ' ' '
+' | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile" "$tmpdepfile".bak
+  ;;
+
+cpp)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the proprocessed file to stdout, regardless of -o,
+  # because we must use -o when running libtool.
+  ( IFS=" "
+    case " $* " in
+    *" --mode=compile "*)
+      for arg
+      do # cycle over the arguments
+        case "$arg" in
+       "--mode=compile")
+         # insert --quiet before "--mode=compile"
+         set fnord "$@" --quiet
+         shift # fnord
+         ;;
+       esac
+       set fnord "$@" "$arg"
+       shift # fnord
+       shift # "$arg"
+      done
+      ;;
+    esac
+    "$@" -E |
+    sed -n '/^# [0-9][0-9]* "\([^"]*\)"/ s::'"$object"'\: \1:p' > "$tmpdepfile"
+  ) &
+  proc=$!
+  "$@"
+  stat=$?
+  wait "$proc"
+  if test "$stat" != 0; then exit $stat; fi
+  rm -f "$depfile"
+  cat < "$tmpdepfile" > "$depfile"
+  sed < "$tmpdepfile" -e 's/^[^:]*: //' -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+none)
+  exec "$@"
+  ;;
+
+*)
+  echo "Unknown depmode $depmode" 1>&2
+  exit 1
+  ;;
+esac
+
+exit 0
index 7789652..b965c14 100755 (executable)
@@ -1,7 +1,7 @@
 #! /bin/sh
 # Common stub for a few missing GNU programs while installing.
-# Copyright (C) 1996, 1997 Free Software Foundation, Inc.
-# Franc,ois Pinard <pinard@iro.umontreal.ca>, 1996.
+# Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -23,6 +23,19 @@ if test $# -eq 0; then
   exit 1
 fi
 
+run=:
+
+case "$1" in
+--run)
+  # Try to run requested program, and just exit if it succeeds.
+  run=
+  shift
+  "$@" && exit 0
+  ;;
+esac
+
+# If it does not exist, or fails to run (possibly an outdated version),
+# try to emulate it.
 case "$1" in
 
   -h|--h|--he|--hel|--help)
@@ -35,6 +48,7 @@ error status if there is no known handling for PROGRAM.
 Options:
   -h, --help      display this help and exit
   -v, --version   output version information and exit
+  --run           try to run the given command, and emulate it if it fails
 
 Supported PROGRAM values:
   aclocal      touch file \`aclocal.m4'
@@ -45,11 +59,12 @@ Supported PROGRAM values:
   flex         create \`lex.yy.c', if possible, from existing .c
   lex          create \`lex.yy.c', if possible, from existing .c
   makeinfo     touch the output file
+  tar          try tar, gnutar, gtar, then tar without non-portable flags
   yacc         create \`y.tab.[ch]', if possible, from existing .[ch]"
     ;;
 
   -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
-    echo "missing - GNU libit 0.0"
+    echo "missing 0.2 - GNU automake"
     ;;
 
   -*)
@@ -175,6 +190,39 @@ WARNING: \`$1' is missing on your system.  You should only need it if
     touch $file
     ;;
 
+  tar)
+    shift
+    if test -n "$run"; then
+      echo 1>&2 "ERROR: \`tar' requires --run"
+      exit 1
+    fi
+
+    # we have already tried tar in the generic part
+    gnutar ${1+"$@"} && exit 0
+    gtar ${1+"$@"} && exit 0
+    firstarg="$1"
+    if shift; then
+       case "$firstarg" in
+       *o*)
+           firstarg=`echo "$firstarg" | sed s/o//`
+           tar "$firstarg" ${1+"$@"} && exit 0
+           ;;
+       esac
+       case "$firstarg" in
+       *h*)
+           firstarg=`echo "$firstarg" | sed s/h//`
+           tar "$firstarg" ${1+"$@"} && exit 0
+           ;;
+       esac
+    fi
+
+    echo 1>&2 "\
+WARNING: I can't seem to be able to run \`tar' with the given arguments.
+         You may want to install GNU tar or Free paxutils, or check the
+         command line arguments."
+    exit 1
+    ;;
+
   *)
     echo 1>&2 "\
 WARNING: \`$1' is needed, and you do not seem to have it handy on your
index ecdcabe..3f7b750 100644 (file)
@@ -4,9 +4,9 @@ AUTOMAKE_OPTIONS = gnits
 MAINT_CHARSET = latin1
 
 m4datadir = $(datadir)/aclocal
-m4data_DATA = ccstdc.m4 cond.m4 dmalloc.m4 error.m4 gcj.m4 header.m4 \
-init.m4 lex.m4 lispdir.m4 maintainer.m4 minuso.m4 missing.m4 multi.m4 \
-obstack.m4 protos.m4 ptrdiff.m4 regex.m4 sanity.m4 strtod.m4 \
-termios.m4 winsz.m4
+m4data_DATA = ccstdc.m4 cond.m4 depend.m4 depout.m4 dmalloc.m4 \
+error.m4 gcj.m4 header.m4 init.m4 lex.m4 lispdir.m4 maintainer.m4 \
+minuso.m4 missing.m4 multi.m4 obstack.m4 protos.m4 ptrdiff.m4 regex.m4 \
+sanity.m4 strtod.m4 termios.m4 winsz.m4
 
 EXTRA_DIST = $(m4data_DATA)
index 41f7a36..4ccd58c 100644 (file)
@@ -71,10 +71,10 @@ AUTOMAKE_OPTIONS = gnits
 MAINT_CHARSET = latin1
 
 m4datadir = $(datadir)/aclocal
-m4data_DATA = ccstdc.m4 cond.m4 dmalloc.m4 error.m4 gcj.m4 header.m4 \
-init.m4 lex.m4 lispdir.m4 maintainer.m4 minuso.m4 missing.m4 multi.m4 \
-obstack.m4 protos.m4 ptrdiff.m4 regex.m4 sanity.m4 strtod.m4 \
-termios.m4 winsz.m4
+m4data_DATA = ccstdc.m4 cond.m4 depend.m4 depout.m4 dmalloc.m4 \
+error.m4 gcj.m4 header.m4 init.m4 lex.m4 lispdir.m4 maintainer.m4 \
+minuso.m4 missing.m4 multi.m4 obstack.m4 protos.m4 ptrdiff.m4 regex.m4 \
+sanity.m4 strtod.m4 termios.m4 winsz.m4
 
 
 EXTRA_DIST = $(m4data_DATA)
@@ -124,11 +124,6 @@ TAGS:
 distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
 
 distdir: $(DISTFILES)
-       here=`cd $(top_builddir) && pwd`; \
-       top_distdir=`cd $(top_distdir) && pwd`; \
-       distdir=`cd $(distdir) && pwd`; \
-       cd $(top_srcdir) \
-         && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnits m4/Makefile
        @for file in $(DISTFILES); do \
          d=$(srcdir); \
          if test -d $$d/$$file; then \
diff --git a/m4/depend.m4 b/m4/depend.m4
new file mode 100644 (file)
index 0000000..c768e68
--- /dev/null
@@ -0,0 +1,99 @@
+dnl See how the compiler implements dependency checking.
+dnl Usage:
+dnl AM_DEPENDENCIES(NAME)
+dnl NAME is "CC", "CXX" or "OBJC".
+
+dnl We try a few techniques and use that to set a single cache variable.
+
+AC_DEFUN(AM_DEPENDENCIES,[
+AC_REQUIRE([AM_SET_DEPDIR])
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])
+ifelse([$1],CC,[
+AC_REQUIRE([AC_PROG_CC])
+AC_REQUIRE([AC_PROG_CPP])
+depcc="$CC"
+depcpp="$CPP"],[$1],CXX,[
+AC_REQUIRE([AC_PROG_CXX])
+AC_REQUIRE([AC_PROG_CXXCPP])
+depcc="$CXX"
+depcpp="$CXXCPP"],[$1],OBJC,[
+am_cv_OBJC_dependencies_compiler_type=gcc],[
+AC_REQUIRE([AC_PROG_][$1])
+depcc="$[$1]"
+depcpp=""])
+AC_MSG_CHECKING([dependency style of $depcc])
+AC_CACHE_VAL(am_cv_[$1]_dependencies_compiler_type,[
+if test -z "$AMDEP"; then
+  echo '#include "conftest.h"' > conftest.c
+  echo 'int i;' > conftest.h
+
+  am_cv_[$1]_dependencies_compiler_type=none
+  for depmode in `sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < "$am_depcomp"`; do
+    case "$depmode" in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+       continue
+      else
+       break
+      fi
+      ;;
+    none) break ;;
+    esac
+    if depmode="$depmode" \
+       source=conftest.c object=conftest.o \
+       depfile=conftest.Po tmpdepfile=conftest.TPo \
+       $SHELL $am_depcomp $depcc -c conftest.c 2>/dev/null &&
+       grep conftest.h conftest.Po > /dev/null 2>&1; then
+      am_cv_[$1]_dependencies_compiler_type="$depmode"
+      break
+    fi
+  done
+
+  rm -f conftest.*
+else
+  am_cv_[$1]_dependencies_compiler_type=none
+fi
+])
+AC_MSG_RESULT($am_cv_[$1]_dependencies_compiler_type)
+[$1]DEPMODE="depmode=$am_cv_[$1]_dependencies_compiler_type"
+AC_SUBST([$1]DEPMODE)
+])
+
+dnl Choose a directory name for dependency files.
+dnl This macro is AC_REQUIREd in AM_DEPENDENCIES
+
+AC_DEFUN(AM_SET_DEPDIR,[
+if test -d .deps || mkdir .deps 2> /dev/null || test -d .deps; then
+  DEPDIR=.deps
+else
+  DEPDIR=_deps
+fi
+AC_SUBST(DEPDIR)
+])
+
+AC_DEFUN(AM_DEP_TRACK,[
+AC_ARG_ENABLE(dependency-tracking,
+[  --disable-dependency-tracking Speeds up one-time builds
+  --enable-dependency-tracking  Do not reject slow dependency extractors])
+if test "x$enable_dependency_tracking" = xno; then
+  AMDEP="#"
+else
+  am_depcomp="$ac_aux_dir/depcomp"
+  if test ! -f "$am_depcomp"; then
+    AMDEP="#"
+  else
+    AMDEP=
+  fi
+fi
+AC_SUBST(AMDEP)
+if test -z "$AMDEP"; then
+  AMDEPBACKSLASH='\'
+else
+  AMDEPBACKSLASH=
+fi
+pushdef([subst], defn([AC_SUBST]))
+subst(AMDEPBACKSLASH)
+popdef([subst])
+])
diff --git a/m4/depout.m4 b/m4/depout.m4
new file mode 100644 (file)
index 0000000..aae9d44
--- /dev/null
@@ -0,0 +1,46 @@
+dnl Generate code to set up dependency tracking.
+dnl This macro should only be invoked once -- use via AC_REQUIRE.
+dnl Usage:
+dnl AM_OUTPUT_DEPENDENCY_COMMANDS
+
+dnl
+dnl This code is only required when automatic dependency tracking
+dnl is enabled.  FIXME.  This creates each `.P' file that we will
+dnl need in order to bootstrap the dependency handling code.
+AC_DEFUN(AM_OUTPUT_DEPENDENCY_COMMANDS,[
+AC_OUTPUT_COMMANDS([
+test x"$AMDEP" != x"" ||
+for mf in $CONFIG_FILES; do
+  case "$mf" in
+  Makefile) dirpart=.;;
+  */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;;
+  *) continue;;
+  esac
+  grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue
+  # Extract the definition of DEP_FILES from the Makefile without
+  # running `make'.
+  DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
+  test -z "$DEPDIR" && continue
+  # When using ansi2knr, U may be empty or an underscore; expand it
+  U=`sed -n -e '/^U = / s///p' < "$mf"`
+  test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
+  # We invoke sed twice because it is the simplest approach to
+  # changing $(DEPDIR) to its actual value in the expansion.
+  for file in `sed -n -e '
+    /^DEP_FILES = .*\\\\$/ {
+      s/^DEP_FILES = //
+      :loop
+       s/\\\\$//
+       p
+       n
+       /\\\\$/ b loop
+      p
+    }
+    /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
+       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+    test -f "$dirpart/$file" && continue
+    echo "creating $dirpart/$file"
+    echo '# dummy' > "$dirpart/$file"
+  done
+done
+], [AMDEP="$AMDEP"])])
index 6ce9d65..d8ddaa5 100644 (file)
@@ -16,7 +16,8 @@ AC_SUBST(PACKAGE)
 VERSION=[$2]
 AC_SUBST(VERSION)
 dnl test to see if srcdir already configured
-if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
+if test "`CDPATH=: && cd $srcdir && pwd`" != "`pwd`" &&
+   test -f $srcdir/config.status; then
   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
 fi
 ifelse([$3],,
@@ -24,31 +25,21 @@ AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
 AC_REQUIRE([AM_SANITY_CHECK])
 AC_REQUIRE([AC_ARG_PROGRAM])
-dnl FIXME This is truly gross.
-missing_dir=`cd $ac_aux_dir && pwd`
-AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
-AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
-AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
-AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
-AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
-dnl Set install_sh for make dist
-install_sh="$missing_dir/install-sh"
-test -f "$install_sh" || install_sh="$missing_dir/install.sh"
-AC_SUBST(install_sh)
-dnl We check for tar when the user configures the end package.
-dnl This is sad, since we only need this for "dist".  However,
-dnl there's no other good way to do it.  We prefer GNU tar if
-dnl we can find it.  If we can't find a tar, it doesn't really matter.
-AC_CHECK_PROGS(AMTAR, gnutar gtar tar)
+AM_MISSING_PROG(ACLOCAL, aclocal)
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake)
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AM_MISSING_PROG(AMTAR, tar)
+AM_MISSING_INSTALL_SH(install_sh)
 dnl We need awk for the "check" target.  The system "awk" is bad on
 dnl some platforms.
 AC_REQUIRE([AC_PROG_AWK])
-AMTARFLAGS=
-if test -n "$AMTAR"; then
-  if $SHELL -c "$AMTAR --version" > /dev/null 2>&1; then
-    dnl We have GNU tar.
-    AMTARFLAGS=o
-  fi
-fi
-AC_SUBST(AMTARFLAGS)
-AC_REQUIRE([AC_PROG_MAKE_SET])])
+AC_REQUIRE([AC_PROG_MAKE_SET])
+AC_REQUIRE([AM_DEP_TRACK])
+AC_REQUIRE([AM_SET_DEPDIR])
+ifdef([AC_PROVIDE_AC_PROG_CC], [AM_DEPENDENCIES(CC)], [
+   define([AC_PROG_CC], defn([AC_PROG_CC])[AM_DEPENDENCIES(CC)])])
+ifdef([AC_PROVIDE_AC_PROG_CXX], [AM_DEPENDENCIES(CXX)], [
+   define([AC_PROG_CXX], defn([AC_PROG_CXX])[AM_DEPENDENCIES(CXX)])])
+])
index bb49045..f3c20e5 100644 (file)
--- a/m4/lex.m4
+++ b/m4/lex.m4
@@ -4,7 +4,7 @@
 dnl AM_PROG_LEX
 dnl Look for flex, lex or missing, then run AC_PROG_LEX and AC_DECL_YYTEXT
 AC_DEFUN(AM_PROG_LEX,
-[missing_dir=ifelse([$1],,`cd $ac_aux_dir && pwd`,$1)
-AC_CHECK_PROGS(LEX, flex lex, "$missing_dir/missing flex")
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+AC_CHECK_PROGS(LEX, flex lex, [${am_missing_run}flex])
 AC_PROG_LEX
 AC_DECL_YYTEXT])
index 39178df..6dcfcaf 100644 (file)
@@ -1,18 +1,33 @@
 ## --------------------------------------------------------- ##
 ## Fake the existence of programs that GNU maintainers use.  ##
 ## --------------------------------------------------------- ##
-dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
-dnl The program must properly implement --version.
-AC_DEFUN(AM_MISSING_PROG,
-[AC_MSG_CHECKING(for working $2)
-# Run test in a subshell; some versions of sh will print an error if
-# an executable is not found, even if stderr is redirected.
-# Redirect stdin to placate older versions of autoconf.  Sigh.
-if ($2 --version) < /dev/null > /dev/null 2>&1; then
-   $1=$2
-   AC_MSG_RESULT(found)
-else
-   $1="$3/missing $2"
-   AC_MSG_RESULT(missing)
+dnl AM_MISSING_PROG(NAME, PROGRAM)
+AC_DEFUN(AM_MISSING_PROG, [
+AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+dnl Like AM_MISSING_PROG, but only looks for install-sh.
+dnl AM_MISSING_INSTALL_SH(NAME)
+AC_DEFUN(AM_MISSING_INSTALL_SH, [
+AC_REQUIRE([AM_MISSING_HAS_RUN])
+if test -z "$1"; then
+   $1="${am_missing_run}install-sh"
+   test -f "$1" || $1="${am_missing_run}install.sh"
 fi
 AC_SUBST($1)])
+
+dnl AM_MISSING_HAS_RUN.
+dnl Define MISSING if not defined so far and test if it supports --run.
+dnl If it does, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN], [
+test x"${MISSING+set}" = xset || \
+  MISSING="\${SHELL} `CDPATH=: && cd $ac_aux_dir && pwd`/missing"
+dnl Use eval to expand $SHELL
+if eval "$MISSING --run :"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  AC_MSG_WARN([\`missing' script is too old or missing])
+fi
+])
diff --git a/missing b/missing
index 7789652..b965c14 100755 (executable)
--- a/missing
+++ b/missing
@@ -1,7 +1,7 @@
 #! /bin/sh
 # Common stub for a few missing GNU programs while installing.
-# Copyright (C) 1996, 1997 Free Software Foundation, Inc.
-# Franc,ois Pinard <pinard@iro.umontreal.ca>, 1996.
+# Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -23,6 +23,19 @@ if test $# -eq 0; then
   exit 1
 fi
 
+run=:
+
+case "$1" in
+--run)
+  # Try to run requested program, and just exit if it succeeds.
+  run=
+  shift
+  "$@" && exit 0
+  ;;
+esac
+
+# If it does not exist, or fails to run (possibly an outdated version),
+# try to emulate it.
 case "$1" in
 
   -h|--h|--he|--hel|--help)
@@ -35,6 +48,7 @@ error status if there is no known handling for PROGRAM.
 Options:
   -h, --help      display this help and exit
   -v, --version   output version information and exit
+  --run           try to run the given command, and emulate it if it fails
 
 Supported PROGRAM values:
   aclocal      touch file \`aclocal.m4'
@@ -45,11 +59,12 @@ Supported PROGRAM values:
   flex         create \`lex.yy.c', if possible, from existing .c
   lex          create \`lex.yy.c', if possible, from existing .c
   makeinfo     touch the output file
+  tar          try tar, gnutar, gtar, then tar without non-portable flags
   yacc         create \`y.tab.[ch]', if possible, from existing .[ch]"
     ;;
 
   -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
-    echo "missing - GNU libit 0.0"
+    echo "missing 0.2 - GNU automake"
     ;;
 
   -*)
@@ -175,6 +190,39 @@ WARNING: \`$1' is missing on your system.  You should only need it if
     touch $file
     ;;
 
+  tar)
+    shift
+    if test -n "$run"; then
+      echo 1>&2 "ERROR: \`tar' requires --run"
+      exit 1
+    fi
+
+    # we have already tried tar in the generic part
+    gnutar ${1+"$@"} && exit 0
+    gtar ${1+"$@"} && exit 0
+    firstarg="$1"
+    if shift; then
+       case "$firstarg" in
+       *o*)
+           firstarg=`echo "$firstarg" | sed s/o//`
+           tar "$firstarg" ${1+"$@"} && exit 0
+           ;;
+       esac
+       case "$firstarg" in
+       *h*)
+           firstarg=`echo "$firstarg" | sed s/h//`
+           tar "$firstarg" ${1+"$@"} && exit 0
+           ;;
+       esac
+    fi
+
+    echo 1>&2 "\
+WARNING: I can't seem to be able to run \`tar' with the given arguments.
+         You may want to install GNU tar or Free paxutils, or check the
+         command line arguments."
+    exit 1
+    ;;
+
   *)
     echo 1>&2 "\
 WARNING: \`$1' is needed, and you do not seem to have it handy on your
index 20c10b2..d8c30bd 100644 (file)
--- a/stamp-vti
+++ b/stamp-vti
@@ -1,3 +1,3 @@
-@set UPDATED 12 November 1999
+@set UPDATED 19 November 1999
 @set EDITION 1.4a
 @set VERSION 1.4a
index e0dec02..2b3677d 100644 (file)
@@ -1,3 +1,37 @@
+1999-11-21  Tom Tromey  <tromey@cygnus.com>
+
+       * specflags3.test: Updated test for new dependency
+       implementation.
+
+1999-10-02  Alexandre Oliva  <oliva@lsd.ic.unicamp.br>
+
+       * defs: Set CDPATH to avoid verbose cd.
+
+1999-09-14  Alexandre Oliva  <oliva@lsd.ic.unicamp.br>
+
+       * defs: Avoid printing the full pathname of testSubDir.
+
+       * exsource.test: Update.
+
+1999-06-01  Alexandre Oliva  <oliva@dcc.unicamp.br>
+
+       * exsource.test: sed @AMDEP@ away from `include' line.
+
+       * compile_f_c_cxx.test: depcomp is no longer in the same line.
+
+1999-04-25  Alexandre Oliva  <oliva@dcc.unicamp.br>
+
+       * compile_f_c_cxx.test: Look for $(depcomp) for C and C++.
+       * suffix.test: We no longer emit % rules.
+
+1999-04-10  Alexandre Oliva  <oliva@dcc.unicamp.br>
+
+       * defs: Create link or copy of depcomp.
+       * depend2.test: Removed, no more disted dependencies.
+       * Makefile.am (TESTS): Likewise.
+       * exsource.test: Adjust dependency filenames.
+       * mdate3.test: Adjust for depcomp.
+
 1999-11-07  Tom Tromey  <tromey@cygnus.com>
 
        * dash.test: New file.
index 4324404..eb32a41 100644 (file)
@@ -80,7 +80,6 @@ dejagnu.test \
 depacl.test \
 depacl2.test \
 depend.test \
-depend2.test \
 depend3.test \
 discover.test \
 distdir.test \
index b435a17..fed66d6 100644 (file)
@@ -147,7 +147,6 @@ dejagnu.test \
 depacl.test \
 depacl2.test \
 depend.test \
-depend2.test \
 depend3.test \
 discover.test \
 distdir.test \
@@ -333,11 +332,6 @@ TAGS:
 distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
 
 distdir: $(DISTFILES)
-       here=`cd $(top_builddir) && pwd`; \
-       top_distdir=`cd $(top_distdir) && pwd`; \
-       distdir=`cd $(distdir) && pwd`; \
-       cd $(top_srcdir) \
-         && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnits tests/Makefile
        @for file in $(DISTFILES); do \
          d=$(srcdir); \
          if test -d $$d/$$file; then \
index e66f96b..ea8c639 100644 (file)
@@ -15,13 +15,13 @@ case "$srcdir" in
     ;;
 
  *)
-    srcdir="`cd $srcdir && pwd`"
+    srcdir=`CDPATH=: && cd "$srcdir" && pwd`
     ;;
 esac
 
 rm -rf testSubDir > /dev/null 2>&1
 mkdir testSubDir
-cd testSubDir
+cd ./testSubDir
 
 # Build appropriate environment in test directory.  Eg create
 # configure.in, touch all necessary files, etc.
@@ -36,6 +36,9 @@ END
 : > install-sh
 : > mkinstalldirs
 : > missing
+ln $srcdir/../depcomp depcomp 2> /dev/null ||
+ln -s $srcdir/../depcomp depcomp 2> /dev/null ||
+cp $srcdir/../depcomp depcomp || exit 1
 
 # See how redirections should work.  User can set VERBOSE to see all
 # output.
diff --git a/tests/depend2.test b/tests/depend2.test
deleted file mode 100755 (executable)
index 8978165..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-#! /bin/sh
-
-# Test that automatically generated dependencies are correctly
-# rewritten into distribution Makefiles.  This test is set up to look
-# like a C program was built in a subdir of the distribution.
-
-. $srcdir/defs || exit 1
-
-cat > configure.in << 'END'
-PACKAGE=nonesuch
-VERSION=nonesuch
-AC_ARG_PROGRAM
-AC_PROG_MAKE_SET
-AC_PROG_INSTALL
-AC_PROG_CC
-AC_OUTPUT(Makefile src/Makefile)
-END
-
-cat > Makefile.am << 'END'
-SUBDIRS = src
-END
-
-mkdir src
-cat > src/Makefile.am << 'END'
-bin_PROGRAMS = copyin
-END
-
-: > src/copyin.c
-
-mkdir build
-mkdir build/src
-mkdir build/src/.deps
-
-: > build/src/.deps/.P
-
-cat > build/src/.deps/copyin.P << 'END'
-copyin.o: ../../src/copyin.c ../config.h /usr/include/stdio.h \
- /usr/include/features.h /usr/include/sys/cdefs.h /usr/include/libio.h \
- /usr/local/lib/gcc-lib/i586-unknown-linuxaout/cygnus-2.7.1-951112/../../../../i586-unknown-linuxaout/include/_G_config.h \
- /usr/include/sys/types.h /usr/include/linux/types.h \
- /usr/include/asm/types.h /usr/include/sys/stat.h \
- /usr/include/linux/stat.h ../../lib/filetypes.h ../../src/system.h \
- /usr/include/string.h \
- /usr/local/lib/gcc-lib/i586-unknown-linuxaout/cygnus-2.7.1-951112/include/stddef.h \
- /usr/include/time.h /usr/include/stdlib.h /usr/include/errno.h \
- /usr/include/linux/errno.h \
- /usr/local/lib/gcc-lib/i586-unknown-linuxaout/cygnus-2.7.1-951112/include/float.h \
- /usr/include/alloca.h /usr/include/unistd.h /usr/include/posix_opt.h \
- /usr/include/gnu/types.h /usr/include/confname.h \
- /usr/include/sys/sysmacros.h /usr/include/fcntl.h \
- /usr/include/linux/fcntl.h /usr/include/utime.h \
- /usr/include/linux/utime.h /usr/include/dirent.h \
- /usr/include/linux/limits.h /usr/include/linux/dirent.h \
- /usr/include/posix1_lim.h ../../src/cpiohdr.h ../../src/cpio.h \
- ../../src/extern.h \
- /usr/local/lib/gcc-lib/i586-unknown-linuxaout/cygnus-2.7.1-951112/../../../../include/libintl.h \
- /usr/include/locale.h ../../lib/ansidecl.h ../../lib/dstring.h \
- ../../lib/error.h ../../src/defer.h ../../src/rmt.h \
- ../../lib/fnmatch.h
-END
-
-mkdir outdir
-
-$AUTOMAKE --include-deps --build-dir=`pwd`/build --srcdir-name=../.. \
-   --output-dir=`pwd`/outdir src/Makefile || exit 1
-
-# The buggy output contains this string.
-fgrep '../../lib/filetypes.h' outdir/src/Makefile.in && exit 1
-
-# Also make sure that filetypes.h is mentioned at all.
-fgrep filetypes.h outdir/src/Makefile.in
index 1ebfaef..4a1578f 100755 (executable)
@@ -28,10 +28,4 @@ END
 
 $AUTOMAKE || exit 1
 
-# Make sure the Makefile.in can find the .-files it needs.
-mkdir .deps
-echo > .deps/.P
-echo > .deps/xtra.P
-echo > .deps/www.P
-
-$MAKE -s -f Makefile.in SHELL=/bin/sh srcdir=`pwd` magic | grep xtra
+grep 'include .*/xtra\.P' Makefile.in
index 26618cb..8440c5a 100755 (executable)
@@ -25,6 +25,7 @@ mkdir foo
 mv install-sh foo
 mv missing foo
 mv mkinstalldirs foo
+mv depcomp foo
 
 $AUTOMAKE || exit 1
 
index 460c3ac..c99aa40 100755 (executable)
@@ -18,4 +18,4 @@ END
 
 $AUTOMAKE || exit 1
 
-grep 'CC.*-Wp' Makefile.in
+grep -e '-o foo-foo' Makefile.in
index 3556a39..ee42679 100755 (executable)
@@ -17,4 +17,4 @@ $AUTOMAKE -i || exit 1
 grep '^\.c\.o' Makefile.in > /dev/null || exit 1
 
 $AUTOMAKE || exit 1
-grep '%\.o: %\.c' Makefile.in > /dev/null || exit 1
+grep '^\.c\.o' Makefile.in > /dev/null || exit 1
index db4c79a..da022d8 100644 (file)
@@ -146,7 +146,7 @@ CYGNUS        if test -f $$file; then d=.; else d=$(srcdir); fi; \
 NOTCYGNUS        d=$(srcdir); \
 ## We use these strange circumlocutions because we want the "ifile" to
 ## be relative, for the install.
-         for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
+         for ifile in `CDPATH=: && cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
            if test -f $$d/$$ifile; then \
              echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \
              $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \
@@ -201,7 +201,7 @@ dist-info: $(INFO_DEPS)
 ## 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 \
+         for file in `CDPATH=: && cd $$d && eval echo $$base*`; do \
            test -f $(distdir)/$$file \
            || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
            || cp -p $$d/$$file $(distdir)/$$file; \
index 20c10b2..d8c30bd 100644 (file)
@@ -1,3 +1,3 @@
-@set UPDATED 12 November 1999
+@set UPDATED 19 November 1999
 @set EDITION 1.4a
 @set VERSION 1.4a