]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
* depcomp: New file.
authorAlexandre Oliva <oliva@dcc.unicamp.br>
Sat, 10 Apr 1999 11:49:52 +0000 (11:49 +0000)
committerAlexandre Oliva <oliva@dcc.unicamp.br>
Sat, 10 Apr 1999 11:49:52 +0000 (11:49 +0000)
* 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.

20 files changed:
ChangeLog
Makefile.am
Makefile.in
aclocal.m4
automake.in
compile.am
configure
depcomp [new file with mode: 0755]
depend.am
depend2.am
libtool.am
m4/Makefile.am
m4/Makefile.in
m4/ccdepend.m4 [deleted file]
m4/cxxdepend.m4 [deleted file]
m4/depend.m4
m4/depout.m4
m4/depvars.m4 [deleted file]
m4/init.m4
m4/objcdepend.m4 [deleted file]

index 93f7906a8819a891e89a77eb531c5b8542679c34..5759c33424d0a04d37483e0137b7606409a0120a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,41 @@
+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'.
index beed270c2275808113a2c391b14bcfa7a7057d75..02478efbd9c53f3956deda49e75aad72920f7ddc 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
+mkinstalldirs elisp-comp ylwrap acinstall depcomp
 
 install-data-hook:
        @$(POST_INSTALL)
index 9e79f1a62c942f0c23bfc941936ad53be4fa2c15..7825cd11e73d36e3aec78fe2ac35ecc8a28350c1 100644 (file)
@@ -73,14 +73,22 @@ SUBDIRS = . m4 tests
 bin_SCRIPTS = automake aclocal
 info_TEXINFOS = automake.texi
 
-amfiles = clean-hdr.am clean-kr.am clean.am comp-vars.am compile.am data-clean.am data.am dejagnu.am depend.am depend2.am dist-vars.am footer.am header-vars.am header.am java-clean.am java.am kr-extra.am library.am libs-clean.am libs.am libtool.am lisp-clean.am lisp.am ltlib-clean.am ltlib.am ltlibrary.am mans-vars.am mans.am multilib.am program.am progs-clean.am progs.am remake-hdr.am remake.am scripts.am subdirs.am tags-clean.am tags.am texi-vers.am texinfos.am
+amfiles = clean-hdr.am clean-kr.am clean.am comp-vars.am compile.am \
+data-clean.am data.am dejagnu.am depend.am depend2.am dist-vars.am \
+footer.am header-vars.am header.am java-clean.am java.am kr-extra.am \
+library.am libs-clean.am libs.am libtool.am lisp-clean.am lisp.am \
+ltlib-clean.am ltlib.am ltlibrary.am mans-vars.am mans.am multilib.am \
+program.am progs-clean.am progs.am remake-hdr.am remake.am scripts.am \
+subdirs.am tags-clean.am tags.am texi-vers.am texinfos.am
 
 
-dist_pkgdata_DATA = COPYING INSTALL texinfo.tex ansi2knr.c ansi2knr.1 $(amfiles)
+dist_pkgdata_DATA = COPYING INSTALL texinfo.tex ansi2knr.c ansi2knr.1 \
+$(amfiles)
 
 
 scriptdir = $(pkgdatadir)
-dist_script_DATA = config.guess config.sub install-sh mdate-sh missing mkinstalldirs elisp-comp ylwrap acinstall
+dist_script_DATA = config.guess config.sub install-sh mdate-sh missing \
+mkinstalldirs elisp-comp ylwrap acinstall depcomp
 
 
 ETAGS_ARGS = $(amfiles)
@@ -90,6 +98,7 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_CLEAN_FILES =  automake aclocal
 SCRIPTS =  $(bin_SCRIPTS)
 
+DIST_SOURCES = 
 TEXI2DVI = texi2dvi
 INFO_DEPS = automake.info
 DVIS = automake.dvi
@@ -104,7 +113,7 @@ mdate-sh missing mkinstalldirs stamp-vti texinfo.tex version.texi \
 ylwrap
 
 
-DISTFILES = $(DIST_COMMON) $(SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 
 GZIP_ENV = --best
 all: all-redirect
@@ -185,7 +194,7 @@ DVIPS = dvips
          && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
 
 .texi.dvi:
-       TEXINPUTS=.:$$TEXINPUTS \
+       TEXINPUTS=$(srcdir):$$TEXINPUTS \
          MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
 
 .texi:
@@ -204,7 +213,7 @@ DVIPS = dvips
          && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
 
 .texinfo.dvi:
-       TEXINPUTS=.:$$TEXINPUTS \
+       TEXINPUTS=$(srcdir):$$TEXINPUTS \
          MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
 
 .txi.info:
@@ -213,7 +222,7 @@ DVIPS = dvips
          && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
 
 .txi.dvi:
-       TEXINPUTS=.:$$TEXINPUTS \
+       TEXINPUTS=$(srcdir):$$TEXINPUTS \
          MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
 
 .txi:
index 7e3f44b77d7874f0d13a799148ac518a1249e9d0..1b97697212f097fb01dc4245ac93e744c1ef4bb8 100644 (file)
@@ -50,7 +50,7 @@ dnl we can find it.  If we can't find a tar, it doesn't really matter.
 AC_CHECK_PROGS(TAR, gnutar gtar tar)
 AMTARFLAGS=
 if test -n "$TAR"; then
-  if $(SHELL) -c "$TAR --version" > /dev/null 2>&1; then
+  if $SHELL -c "$TAR --version" > /dev/null 2>&1; then
     dnl We have GNU tar.
     AMTARFLAGS=o
   fi
index 825e68ad7ac47ceebd96f41970d02c5ccfedc5ee..d43fd6f686d9968d71b591b46fe9bcca5aff0e06 100755 (executable)
@@ -81,10 +81,6 @@ $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.
-$cmdline_use_dependencies = 1;
-
 # TRUE if in verbose mode.
 $verbose = 0;
 
@@ -232,9 +228,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 = ();
 
@@ -286,10 +279,6 @@ $obsolete_rx = '(' . join ('|', keys %obsolete_macros) . ')';
 # This maps languages names onto properties.
 %language_map = ();
 
-# This hash keeps track of whether various configure macros for
-# dependency tracking have been seen.
-%dependency_macros = ();
-
 \f
 
 # Initialize global constants and our list of languages that are
@@ -404,7 +393,7 @@ sub parse_arguments
        }
        elsif ($arglist[0] eq '--ignore-deps' || $arglist[0] eq '-i')
        {
-           $cmdline_use_dependencies = 0;
+           # Just ignore.
        }
        elsif ($arglist[0] eq '--no-force')
        {
@@ -742,10 +731,7 @@ sub get_object_extension
 
        # Note that order of transforms is important here.  We collude
        # with compile.am to get the right result.
-       $xform = (($use_dependencies
-                  ? 's/^NOTDEPEND.*$//;'
-                  : 's/^NOTDEPEND//;')
-                 . ($seen_objext ? 's/^OBJEXT//;' : 's/^OBJEXT.*$//;'));
+       $xform = ($seen_objext ? 's/^OBJEXT//;' : 's/^OBJEXT.*$//;');
        $output_rules .= &file_contents_with_transform ($xform, 'compile');
 
        &push_phony_cleaners ('compile');
@@ -772,10 +758,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');
 
@@ -1081,7 +1064,9 @@ sub handle_single_transform_list
 
            # Transform .o or $o file into .P file (for automatic
            # dependency code).
-           $dep_files{'.deps/' . $base . '.P'} = 1;
+           local ($depfile) = $object;
+           $depfile =~ s/\.([^.]*)$/.P\1/;
+           $dep_files{'$(DEPDIR)/' . $depfile} = 1;
        }
     }
 
@@ -1272,6 +1257,9 @@ sub handle_lib_objects_cond
        # means adding entries to dep_files.
        if ($lsearch =~ /^\@(LT)?LIBOBJS\@$/)
        {
+           local ($myobjext) = $objext;
+           $objext = '.lo' if $1;
+
            push (@dep_list, $lsearch);
            $seen_libobjs = 1;
            if (! keys %libsources)
@@ -1294,19 +1282,22 @@ 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$obj/;
+                   $dep_files{'$(DEPDIR)/' . $rewrite} = 1;
                    &require_file_with_line ($var, $FOREIGN, $iter);
                }
            }
        }
        elsif ($lsearch =~ /^\@(LT)?ALLOCA\@$/)
        {
+           local ($myobjext) = $objext;
+           $objext = '.lo' if $1;
+
            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');
        }
@@ -2521,12 +2512,6 @@ sub generate_dependency_code
     local ($ext);
     foreach $ext (&lang_extensions ($lang))
     {
-       if (! defined $dependency_macros{$fullname} && ! $error)
-       {
-           &am_error ("dependency tracking enabled but \`AM_${fullname}_DEPENDENCIES' not seen in configure.in");
-           $error = 1;
-       }
-
        $output_rules .=
            &file_contents_with_transform ('s/\@EXT\@/' . $ext . '/g;'
                                           . 's/\@FPFX\@/' . $fullname . '/g;'
@@ -2539,15 +2524,21 @@ sub generate_dependency_code
 # 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)
        {
+           # Set location of depcomp.
+           if ($config_aux_dir ne '.' && $config_aux_dir ne '')
+           {
+               &define_variable ('depcomp', ('$(SHELL) ' . $config_aux_dir
+                                           . '/depcomp'));
+           }
+           else
+           {
+               &define_variable ('depcomp',
+                         '$(SHELL) $(top_srcdir)/depcomp');
+           }
+                             
            &define_pretty_variable ('DEP_FILES', '', sort keys %dep_files);
            $output_rules .= &file_contents ('depend');
            push (@clean, 'depend');
@@ -2560,7 +2551,6 @@ sub handle_dependencies
            &generate_dependency_code ('objc', 'OBJC', 'OBJC');
            &generate_dependency_code ('cxx', 'CXX', 'CXX');
        }
-    }
 }
 
 # Handle subdirectories.
@@ -2759,7 +2749,6 @@ sub handle_configure
                       . "\n"
                      . "\tcd \$(top_srcdir) && \$(AUTOMAKE) "
                      . ($cygnus_mode ? '--cygnus' : ('--' . $strictness_name))
-                     . ($cmdline_use_dependencies ? '' : ' --ignore-deps')
                      . ' ' . $input . $colon_infile . "\n\n");
 
     # This rule remakes the Makefile.
@@ -4115,15 +4104,6 @@ sub scan_one_configure_file
        {
            $configure_vars{'FLIBS'} = $filename . ':' . $.;
        }
-
-       # Look for dependency-tracking macros.
-       if (/AM_(CC|CXX|OBJC)_DEPENDENCIES/)
-       {
-           $dependency_macros{$1} = 1;
-           $configure_vars{'DEP_' . $1 . 'PRECOMP'} = $filename . ':' . $.;
-           $configure_vars{'DEP_' . $1 . 'POSTCOMP'} = $filename . ':' . $.;
-           $configure_vars{'DEP_' . $1 . 'FLAG'} = $filename . ':' . $.;
-       }
     }
 
     close (CONFIGURE);
@@ -4163,7 +4143,7 @@ sub scan_configure
     # looking at a subdir Makefile.  We must set relative_dir so that
     # the file-finding machinery works.
     local ($relative_dir) = '.';
-    &require_config_file ($FOREIGN, 'install-sh', 'mkinstalldirs', 'missing');
+    &require_config_file ($FOREIGN, 'install-sh', 'mkinstalldirs', 'missing', 'depcomp');
     &am_error ("\`install.sh' is an anachronism; use \`install-sh' instead")
         if -f $config_aux_path[0] . '/install.sh';
 }
@@ -6084,7 +6064,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'
+        'missing', 'depcomp'
         );
 
     # Commonly used files we auto-include, but only sometimes.
@@ -6103,7 +6083,6 @@ sub initialize_global_constants
   --gnits               set strictness to gnits
   --gnu                 set strictness to gnu
   --help                print this help, then exit
-  -i, --ignore-deps     disable 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
index b15d24e6d135ece7d781b5e6951b01c228bc75a5..439e47ebb894ff05ea9dc28a5f260c98b6391c3c 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.
-NOTDEPEND.c.o:
-NOTDEPEND      $(COMPILE) -c $<
-
-## Note that NOTDEPEND must appear before OBJEXT here.
-NOTDEPENDOBJEXT# FIXME: We should only use cygpath when building on Windows,
-NOTDEPENDOBJEXT# and only if it is available.
-NOTDEPENDOBJEXT.c.obj:
-NOTDEPENDOBJEXT        $(COMPILE) -c `cygpath -w $<`
 
 .s.o:
        $(COMPILE) -c $<
index 31ba22e339c43cf1781b4d2a7ea11a190b37612d..05ca17b6d129d2d783fe901f389e5455a557a531 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 # Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.14.1 
+# Generated automatically using autoconf version 2.13 
 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
 #
 # This configure script is free software; the Free Software Foundation
@@ -333,7 +333,7 @@ EOF
     verbose=yes ;;
 
   -version | --version | --versio | --versi | --vers)
-    echo "configure generated by autoconf version 2.14.1"
+    echo "configure generated by autoconf version 2.13"
     exit 0 ;;
 
   -with-* | --with-*)
@@ -810,7 +810,7 @@ done
 
 AMTARFLAGS=
 if test -n "$TAR"; then
-  if $(SHELL) -c "$TAR --version" > /dev/null 2>&1; then
+  if $SHELL -c "$TAR --version" > /dev/null 2>&1; then
         AMTARFLAGS=o
   fi
 fi
@@ -961,7 +961,7 @@ do
     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
-    echo "$CONFIG_STATUS generated by autoconf version 2.14.1"
+    echo "$CONFIG_STATUS generated by autoconf version 2.13"
     exit 0 ;;
   -help | --help | --hel | --he | --h)
     echo "\$ac_cs_usage"; exit 0 ;;
diff --git a/depcomp b/depcomp
new file mode 100755 (executable)
index 0000000..7e36bd2
--- /dev/null
+++ b/depcomp
@@ -0,0 +1,101 @@
+#! /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
+
+if test -z "$depfile"; then
+  depfile=`echo "$object" | sed 's,\([^/]*\)$,.deps/\1,;s/\.\([^.]*\)$/.P\1/'`
+  depdir=`echo "$depfile" | sed 's,/*[^/]*$,,'`
+  test -d "$depdir" || { echo "mkdir \"$depdir\"" && mkdir "$depdir"; } ||
+  test -d "$depdir" || exit 1
+fi
+
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$depfile" "$tmpdepfile"
+
+case "$depmode" in
+gcc)
+  if "$@" -Wp,-MD,"$tmpdepfile"; then :
+  else
+    stat=$?
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  echo "$object : \\" > "$depfile"
+  sed 's/^[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+  tr ' ' '
+' < "$tmpdepfile" | \
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+sgi)
+  if "$@" -MDupdate "$tmpdepfile"; then :
+  else
+    stat=$?
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  echo "$object : \\" > "$depfile"
+  sed 's/^[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+  tr ' ' '
+' < "$tmpdepfile" | \
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+dashmstdout)
+  "$@" -M > "$tmpdepfile" &
+  proc=$!
+  "$@"
+  echo "$object : \\" > "$depfile"
+  wait "$proc"
+  sed 's/^[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+  tr ' ' '
+' < "$tmpdepfile" | \
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+cpp)
+  # We want a pre compilation step which runs CPP (but with all
+  # the right options!  This is hard).  Then we want to run sed
+  # on the output, extract `#line' or `# NNN' lines, and turn
+  # that into correct dependencies.  We might as well do this
+  # all in one step, so we have no post-compilation step here.
+  ;;
+
+none)
+  exec "$@"
+  ;;
+
+*)
+  echo "Unknown depmode $depmode" 1>&2
+  exit 1
+  ;;
+esac
+
+exit 0
index ac5f76b7168940f0ee140727c5b3ced828c5515a..b94f1d63f1e3e2a1f510fc02d064f9a3873bcc62 100644 (file)
--- a/depend.am
+++ b/depend.am
@@ -23,6 +23,6 @@ mostlyclean-depend:
 clean-depend:
 
 distclean-depend:
-       -rm -rf .deps
+       -rm -rf $(DEPDIR)
 
 maintainer-clean-depend:
index 9cbb97b1e6038561dd78b2bdfea08127a087a414..7906608312b7b6f1ac9b075ce43460039543053e 100644 (file)
 ## 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.
-DEP_@FPFX@COMPILE = $(DEP_@FPFX@PRECOMP); echo " $$compile -c $$file"; $$compile $(DEP_@FPFX@FLAG) -c $$file; status=$$?; if test "$$status" != 0; then exit $$status; else $(DEP_@FPFX@POSTCOMP); fi
+
+@FPFX@DEPMODE = @@FPFX@DEPMODE@
 
 @EXT@.o:
-       @file='$<'; compile='$(@PFX@COMPILE)'; \
-       $(DEP_@FPFX@COMPILE)
+       source='$<' object='$@' depfile='$(DEPDIR)/$*.Po' $(@FPFX@DEPMODE) \
+       $(depcomp) $(@PFX@COMPILE) -c $<
 
 @EXT@.lo:
-       @file='$<'; compile='$(LT@PFX@COMPILE)'; suffix='\1.o \1.lo'; \
-       $(DEP_@FPFX@COMPILE)
+       source='$<' object='$@' depfile='$(DEPDIR)/$*.Plo' $(@FPFX@DEPMODE) \
+       $(depcomp) $(LT@PFX@COMPILE) -c $<
 
 OBJEXT@EXT@.obj:
-OBJEXT @file=`cygpath -w $<`; compile='$(@PFX@COMPILE)'; \
-OBJEXT $(DEP_@FPFX@COMPILE)
+OBJEXT source='$<' object='$@' depfile='$(DEPDIR)/$*.Pobj' $(@FPFX@DEPMODE) \
+OBJEXT $(depcomp) $(@PFX@COMPILE) -c `cygpath -w $<`
index e748cc733becb508b5e4f41cf4ceff416a8adc80..0bb56a98435d67dcee991c9fc217d82d48b33b0b 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.
-NOTDEPEND.c.lo:
+.c.lo:
 ## Note that we explicitly set the libtool mode.  This avoids any lossage
 ## if the program doesn't have a name that libtool expects.
-NOTDEPEND      $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+       source=$< object=$@ depfile=$(DEPDIR)/$*.Plo $(CCDEPMODE) \
+       $(depcomp) $(LIBTOOL) --mode=compile $(COMPILE) -c $<
 
 ## These are just copies of the above rule.
 .s.lo:
index 6986b47a1ee5d28cda39b6e2c1ee36d8648a83a2..09d01dd7476414e0849c6c5b5ef4377cc14c9027 100644 (file)
@@ -4,8 +4,7 @@ AUTOMAKE_OPTIONS = gnits
 MAINT_CHARSET = latin1
 
 m4datadir = $(datadir)/aclocal
-dist_m4data_DATA = ccdepend.m4 ccstdc.m4 cond.m4 cxxdepend.m4 \
-depend.m4 depout.m4 depvars.m4 dmalloc.m4 error.m4 header.m4 init.m4 \
-lex.m4 lispdir.m4 maintainer.m4 missing.m4 mktime.m4 multi.m4 \
-objcdepend.m4 obstack.m4 protos.m4 ptrdiff.m4 regex.m4 sanity.m4 \
-strtod.m4 termios.m4 winsz.m4
+dist_m4data_DATA = ccstdc.m4 cond.m4 depend.m4 depout.m4 dmalloc.m4 \
+error.m4 header.m4 init.m4 lex.m4 lispdir.m4 maintainer.m4 \
+missing.m4 mktime.m4 multi.m4 obstack.m4 protos.m4 ptrdiff.m4 \
+regex.m4 sanity.m4 strtod.m4 termios.m4 winsz.m4
index fe6cf906178ce6887da4d7ff44cdb2b8a1bae59d..2c1b0654fd045f2341f4352791c2280360f7cc30 100644 (file)
@@ -69,16 +69,20 @@ AUTOMAKE_OPTIONS = gnits
 MAINT_CHARSET = latin1
 
 m4datadir = $(datadir)/aclocal
-dist_m4data_DATA = ccdepend.m4 ccstdc.m4 cond.m4 cxxdepend.m4 depend.m4 depout.m4 depvars.m4 dmalloc.m4 error.m4 header.m4 init.m4 lex.m4 lispdir.m4 maintainer.m4 missing.m4 mktime.m4 multi.m4 objcdepend.m4 obstack.m4 protos.m4 ptrdiff.m4 regex.m4 sanity.m4 strtod.m4 termios.m4 winsz.m4
+dist_m4data_DATA = ccstdc.m4 cond.m4 depend.m4 depout.m4 dmalloc.m4 \
+error.m4 header.m4 init.m4 lex.m4 lispdir.m4 maintainer.m4 \
+missing.m4 mktime.m4 multi.m4 obstack.m4 protos.m4 ptrdiff.m4 \
+regex.m4 sanity.m4 strtod.m4 termios.m4 winsz.m4
 
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_CLEAN_FILES = 
+DIST_SOURCES = 
 DATA =  $(dist_m4data_DATA)
 
 DIST_COMMON =  $(dist_m4data_DATA) Makefile.am Makefile.in
 
 
-DISTFILES = $(DIST_COMMON) $(SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 
 GZIP_ENV = --best
 all: all-redirect
@@ -117,6 +121,11 @@ distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
 subdir = m4
 
 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/ccdepend.m4 b/m4/ccdepend.m4
deleted file mode 100644 (file)
index 9f65a0f..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-dnl Dependency tracking checks for C.
-dnl AM_CC_DEPENDENCIES
-
-AC_DEFUN(AM_CC_DEPENDENCIES,[
-AC_REQUIRE([AC_PROG_CC])
-AC_REQUIRE([AC_PROG_CPP])
-AM_DEPENDENCIES([CC])])
diff --git a/m4/cxxdepend.m4 b/m4/cxxdepend.m4
deleted file mode 100644 (file)
index be87d01..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-dnl Dependency tracking checks for C++.
-dnl AM_CXX_DEPENDENCIES
-
-AC_DEFUN(AM_CXX_DEPENDENCIES,[
-AC_REQUIRE([AC_PROG_CXX])
-AC_REQUIRE([AC_PROG_CXXCPP])
-AM_DEPENDENCIES([CXX])])
index 789a2a85c0aa177aeff01a3a99c991125c7d1f04..108441478ddeca0fadbe3dbf7d1ccb562c725700 100644 (file)
@@ -1,31 +1,29 @@
 dnl See how the compiler implements dependency checking.
 dnl Usage:
-dnl AM_DEPENDENCIES(NAME, PFX)
-dnl NAME is either "CC" or "CXX".
+dnl AM_DEPENDENCIES(NAME)
+dnl NAME is "CC", "CXX" or "OBJC".
 
-dnl Conceptually dependency tracking has 3 parts:
-dnl (1) a pre-compilation step
-dnl (2) the compilation step (which we can affect only using a flag)
-dnl (3) a post-compilation step (which is almost always the same sed
-dnl     magic to work around the deleted header file problem)
 dnl We try a few techniques and use that to set a single cache variable.
-dnl Then we use the cache variable to set the actual variables we use.
-dnl A fair amount of ugliness is required to share this code betewen
-dnl C and C++.
-
 
 AC_DEFUN(AM_DEPENDENCIES,[
+AC_REQUIRE([AM_SET_DEPDIR])
 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])
-AC_REQUIRE([AM_DEP_SET_VARS])
 ifelse([$1],CC,[
+AC_REQUIRE([AC_PROG_CC])
+AC_REQUIRE([AC_PROG_CPP])
 depcc="$CC"
 depcpp="$CPP"
-depgcc="$GCC"
-depcompile=COMPILE],[
+depgcc="$GCC"],[$1],CXX,[
+AC_REQUIRE([AC_PROG_CXX])
+AC_REQUIRE([AC_PROG_CXXCPP])
 depcc="$CXX"
 depcpp="$CXXCPP"
-depgcc="$GXX"
-depcompile=CXXCOMPILE])
+depgcc="$GXX"],[$1],OBJC,[
+am_cv_OBJC_dependencies_compiler_type=gcc],[
+AC_REQUIRE([AC_PROG_][$1])
+depcc="$[$1]"
+depcpp=""
+depgcc="no"])
 AC_MSG_CHECKING([dependency style of $depcc])
 AC_CACHE_VAL(am_cv_[$1]_dependencies_compiler_type,[
 am_cv_[$1]_dependencies_compiler_type=none
@@ -58,73 +56,18 @@ else
 fi
 ])
 AC_MSG_RESULT($am_cv_[$1]_dependencies_compiler_type)
+[$1]DEPMODE="depmode=$am_cv_[$1]_dependencies_compiler_type"
+AC_SUBST([$1]DEPMODE)
+])
 
-DEP_[$1]FLAG=
-DEP_[$1]PRECOMP=:
-DEP_[$1]POSTCOMP=:
-
-case "$am_cv_[$1]_dependencies_compiler_type" in
- gcc)
-    depprecomp=none
-    DEP_[$1]FLAG="$depgccflag"
-    deppostcomp=sedmagic
-    ;;
-
- sgi)
-    depprecomp=none
-    DEP_[$1]FLAG='-MDupdate .deps/$$pp'
-    deppostcomp=sedmagic
-    ;;
-
- dashmstdout)
-    depprecomp=dashmstdout
-    deppostcomp=sedmagic
-    ;;
-
- cpp)
-    depprecomp=cpp
-    deppostcomp=none
-    ;;
-
- none)
-    depprecomp=none
-    deppostcomp=none
-    ;;
-esac
-
-case "$depprecomp" in
- none)
-    ;;
-
- dashmstdout)
-    DEP_[$1]PRECOMP="\$($depcompile) -M \$\$file > .deps/\$\$pp"
-    ;;
-
- cpp)
-    dnl We want a pre compilation step which runs CPP (but with all
-    dnl the right options!  This is hard).  Then we want to run sed
-    dnl on the output, extract `#line' or `# NNN' lines, and turn
-    dnl that into correct dependencies.  We might as well do this
-    dnl all in one step, so we have no post-compilation step here.
-    FIXME
-    ;;
-esac
-
-dnl We always prepend some boilerplate to the precompilation rule.
-dnl This makes it very easy for the user to use this code -- he must
-dnl only set the "file" variable.
-DEP_[$1]PRECOMP="$depstdprecomp [$]DEP_[$1]PRECOMP"
-
-case "$deppostcomp" in
- sedmagic)
-    DEP_[$1]POSTCOMP="$depsedmagic"
-    ;;
-
- none)
-    ;;
-esac
+dnl Choose a directory name for dependency files.
+dnl This macro is AC_REQUIREd in AM_DEPENDENCIES
 
-AC_SUBST(DEP_[$1]PRECOMP)
-AC_SUBST(DEP_[$1]POSTCOMP)
-AC_SUBST(DEP_[$1]FLAG)
+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)
 ])
index 4365259ac4fa7af68197176941bff064366c7a10..c95fe787e3651a5965d1919f3877359492dc26b1 100644 (file)
@@ -12,7 +12,8 @@ AC_OUTPUT_COMMANDS([
 find . -name Makefile -print | while read mf; do
   # Extract the definition of DEP_FILES from the Makefile without
   # running `make'.
-  deps="`sed -n -e '
+  DEPDIR=`sed -n -e '/^DEPDIR = / s///p' $mf`
+  deps="`sed -n -e 's/\$(DEPDIR)/'"$DEPDIR/g" -e '
     /^DEP_FILES = .*\\\\$/ {
       s/^DEP_FILES = //
       :loop
@@ -26,9 +27,13 @@ find . -name Makefile -print | while read mf; do
   # If we found a definition, proceed to create all the files.
   if test -n "$deps"; then
     dirpart="`echo $mf | sed -e 's|/[^/]*$||'`"
-    test -d "$dirpart/.deps" || mkdir "$dirpart/.deps"
-    for file in $deps; do
-      test -f "$dirpart/$file" || : > "$dirpart/$file"
+    test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
+    for file in `echo "$deps" | sed 's/\$U//g'` \
+               `echo "$deps" | sed 's/\$U/_/g'`; do
+      if test ! -f "$dirpart/$file"; then
+       echo "creating $dirpart/$file"
+       echo '# dummy' > "$dirpart/$file"
+      fi
     done
   fi
 done])])
diff --git a/m4/depvars.m4 b/m4/depvars.m4
deleted file mode 100644 (file)
index f2b864a..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-dnl Set some convenience variables used by dependency tracking.
-dnl These variables have the same (complicated) values for every
-dnl way gcc can be invoked.  So we just define them once, here.
-dnl You should only AC_REQUIRE this macro.
-
-dnl The variables defined at the end are:
-dnl  depsedmagic - sed magic to use as the post-compilation phase
-dnl                This one is not gcc-specific.
-dnl  depgccflag = flag to pass to gcc 
-dnl  depstdprecomp - standard precompilation magic
-
-AC_DEFUN(AM_DEP_SET_VARS,[
-dnl This next piece of magic avoids the `deleted header file' problem.
-dnl The problem is that when a header file which appears in a .P file
-dnl is deleted, the dependency causes make to die (because there is
-dnl typically no way to rebuild the header).  We avoid this by adding
-dnl dummy dependencies for each header file.  Too bad gcc doesn't do
-dnl this for us directly.
-dnl Some versions of gcc put a space before the `:'.  On the theory
-dnl that the space means something, we add a space to the output as
-dnl well.
-dnl We remove # comments because that lets this same piece of magic
-dnl work with SGI compilers.
-dnl This is extremely ugly.  We have to have it all on one line
-dnl because AC_SUBST can't handle multi-line substitutions.  We build
-dnl the value up in pieces to make it a bit clearer.
-
-dnl Change the target if required, and remove hash comments.
-changequote(<<,>>)
-val="sed -e \"s/^\\([^:]*\\)\\.o[      ]*:/\$\$suffix :/\" -e 's/\\#.*\$\$//' < .deps/\$\$pp > .deps/\$\$p;"
-changequote([,])
-
-dnl Remove newlines and trailing backslashes, and generate a new
-dnl dummy target for each header mentioned.
-val="$val tr ' ' '\\012' < .deps/\$\$pp | sed -e 's/^\\\\\$\$//' -e '/^\$\$/ d' -e '/:\$\$/ d' -e 's/\$\$/ :/' >> .deps/\$\$p;"
-
-dnl Remove the temp file and exit with a good status.
-depsedmagic="$val rm -f .deps/\$\$pp; :"
-
-dnl There are various ways to get dependency output from gcc.  Here's
-dnl why we pick this rather obscure method:
-dnl - Don't want to use -MD because we'd like the dependencies to end
-dnl   up in a subdir.  Having to rename by hand is ugly.
-dnl   (We might end up doing this anyway to support other compilers.)
-dnl - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
-dnl   -MM, not -M (despite what the docs say).
-dnl - Using -M directly means running the compiler twice (even worse
-dnl   than renaming).
-depgccflag='-Wp,-MD,.deps/$$pp'
-
-dnl We use this same precompilation boilerplate to make the user's job
-dnl easy -- he only has to set the `file' variable in the shell
-dnl before invoking the compilation rules.  Again, we build it up in
-dnl pieces for clarity.
-
-dnl Compute the default suffix.
-val="test -z \"\$\$suffix\" && suffix='\\1.o';"
-
-dnl First compute P as root part of file (no directory or extension).
-changequote(<<,>>)
-val="$val p=\"\`echo \$\$file | sed -e 's|^.*/||' -e 's|\\.[^.]*\$\$||'\`\";"
-changequote([,])
-
-dnl Now use P to compute PP (name of a temp file), and then finally the
-dnl real value of P (which is the resulting dependency file name).
-val="$val pp=\"\$\$p.pp\"; p=\"\$\$p.P\";"
-
-depstdprecomp="$val"
-])
index 45b621747f0e029816683e38462f15685b15bb8f..c5c564f8041b8abbc8cf8b367f4ee6187b71f5e4 100644 (file)
@@ -44,4 +44,9 @@ if test -n "$TAR"; then
   fi
 fi
 AC_SUBST(AMTARFLAGS)
-AC_REQUIRE([AC_PROG_MAKE_SET])])
+AC_REQUIRE([AC_PROG_MAKE_SET])
+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)])])
+])
diff --git a/m4/objcdepend.m4 b/m4/objcdepend.m4
deleted file mode 100644 (file)
index e03ed84..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-dnl Dependency tracking checks for Objective C.
-dnl AM_OJBC_DEPENDENCIES
-
-dnl Since only gcc can handle Objective C, we skip the checks.
-
-AC_DEFUN(AM_OBJC_DEPENDENCIES,[
-AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])
-AC_REQUIRE([AM_DEP_SET_VARS])
-DEP_OBJCFLAG="$depgccflag"
-DEP_OBJCPRECOMP="$depstdprecomp"
-DEP_OBJCPOSTCOMP="$depsedmagic"
-AC_SUBST(DEP_OBJCFLAG)
-AC_SUBST(DEP_OBJCPRECOMP)
-AC_SUBST(DEP_OBJCPOSTCOMP)])