]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
* missing: If given `--run' as first argument, try to run the
authorAlexandre Oliva <oliva@dcc.unicamp.br>
Mon, 31 May 1999 23:32:44 +0000 (23:32 +0000)
committerAlexandre Oliva <oliva@dcc.unicamp.br>
Mon, 31 May 1999 23:32:44 +0000 (23:32 +0000)
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.

ChangeLog
Makefile.in
NEWS
aclocal.m4
automake.in
configure
m4/Makefile.in
m4/init.m4
m4/missing.m4
missing
tests/Makefile.in

index 8cf77633e0217deed62e528b04251c2f535e7659..b851dace64ecf52c819742a88477372e008bfd88 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 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.
index 967a45a79db81ea24eac05860d87028b12e69fee..e686a05e8709bfcbc691fe2bb019044443e4b72a 100644 (file)
@@ -57,11 +57,15 @@ POST_INSTALL = :
 NORMAL_UNINSTALL = :
 PRE_UNINSTALL = :
 POST_UNINSTALL = :
-AMTARFLAGS = @AMTARFLAGS@
+AMTAR = @AMTAR@
+CC = @CC@
+CPP = @CPP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+DEPDIR = @DEPDIR@
 MAKEINFO = @MAKEINFO@
 PACKAGE = @PACKAGE@
 PERL = @PERL@
-TAR = @TAR@
 VERSION = @VERSION@
 
 
@@ -110,9 +114,9 @@ DATA =  $(dist_pkgdata_DATA) $(dist_script_DATA)
 DIST_COMMON =  README $(dist_pkgdata_DATA) $(dist_script_DATA) AUTHORS \
 COPYING ChangeLog INSTALL Makefile.am Makefile.in NEWS README-alpha \
 THANKS TODO aclocal.in aclocal.m4 ansi2knr.1 ansi2knr.c automake.in \
-config.guess config.sub configure configure.in elisp-comp install-sh \
-mdate-sh missing mkinstalldirs stamp-vti texinfo.tex version.texi \
-ylwrap
+compile config.guess config.sub configure configure.in depcomp \
+elisp-comp install-sh mdate-sh missing mkinstalldirs stamp-vti \
+texinfo.tex version.texi ylwrap
 
 
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -437,7 +441,7 @@ top_distdir = $(distdir)
 # tarfile.
 distcheck: dist
        -rm -rf $(distdir)
-       GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | tar xf -
+       GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf -
        mkdir $(distdir)/=build
        mkdir $(distdir)/=inst
        dc_install_base=`cd $(distdir)/=inst && pwd`; \
@@ -457,11 +461,11 @@ distcheck: dist
        echo "$$dashes"
 dist: distdir
        -chmod -R a+r $(distdir)
-       tar ch$(AMTARFLAGS)f - $(distdir) | GZIP=$(GZIP_ENV) gzip -c > $(distdir).tar.gz
+       $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c > $(distdir).tar.gz
        -rm -rf $(distdir)
 dist-all: distdir
        -chmod -R a+r $(distdir)
-       tar ch$(AMTARFLAGS)f - $(distdir) | GZIP=$(GZIP_ENV) gzip -c > $(distdir).tar.gz
+       $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c > $(distdir).tar.gz
        -rm -rf $(distdir)
 distdir: $(DISTFILES)
        @if sed 15q $(srcdir)/NEWS | fgrep -e "$(VERSION)" > /dev/null; then :; else \
@@ -471,11 +475,6 @@ distdir: $(DISTFILES)
        -rm -rf $(distdir)
        mkdir $(distdir)
        -chmod 777 $(distdir)
-       here=`cd $(top_builddir) && pwd`; \
-       top_distdir=`cd $(distdir) && pwd`; \
-       distdir=`cd $(distdir) && pwd`; \
-       cd $(top_srcdir) \
-         && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnits Makefile
        @for file in $(DISTFILES); do \
          d=$(srcdir); \
          if test -d $$d/$$file; then \
diff --git a/NEWS b/NEWS
index 2d3b5407d843d6b3af1f919dcb55de28fd375a27..e979103245144748d14a9ae758ef5c6e54792cdc 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
index 1b97697212f097fb01dc4245ac93e744c1ef4bb8..ebbe3198c5489cb5d83d0c358f0f5ab8ae92de60 100644 (file)
@@ -43,20 +43,14 @@ 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 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(TAR, gnutar gtar tar)
-AMTARFLAGS=
-if test -n "$TAR"; then
-  if $SHELL -c "$TAR --version" > /dev/null 2>&1; then
-    dnl We have GNU tar.
-    AMTARFLAGS=o
-  fi
-fi
-AC_SUBST(AMTARFLAGS)
-AC_REQUIRE([AC_PROG_MAKE_SET])])
+AM_MISSING_PROG(AMTAR, tar, $missing_dir)
+AC_REQUIRE([AC_PROG_MAKE_SET])
+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)])])
+])
 
 #
 # Check to make sure that the build environment is sane.
@@ -102,18 +96,137 @@ rm -f conftest*
 AC_MSG_RESULT(yes)])
 
 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)
+AC_DEFUN(AM_MISSING_PROG, [$1=${$1-"$3/missing --run $2"}
+AC_SUBST($1)])
+
+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"
+depgcc="$GCC"],[$1],CXX,[
+AC_REQUIRE([AC_PROG_CXX])
+AC_REQUIRE([AC_PROG_CXXCPP])
+depcc="$CXX"
+depcpp="$CXXCPP"
+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
+if test "$depgcc" = yes; then
+   am_cv_[$1]_dependencies_compiler_type=gcc
+else
+   echo '#include "conftest.h"' > conftest.c
+   echo 'int i;' > conftest.h
+
+   dnl SGI compiler has its own method for side-effect dependency
+   dnl tracking.
+   if test "$am_cv_[$1]_dependencies_compiler_type" = none; then
+      rm -f conftest.P
+      if $depcc -c -MDupdate conftest.P conftest.c 2>/dev/null &&
+        test -f conftest.P; then
+        am_cv_[$1]_dependencies_compiler_type=sgi
+      fi
+   fi
+
+   if test "$am_cv_[$1]_dependencies_compiler_type" = none; then
+      # -o /dev/null avoids selecting -M for a compiler that would
+      # output dependencies to the object file
+      if test -n "`$depcc -M conftest.c -o /dev/null 2>/dev/null`"; then
+        am_cv_[$1]_dependencies_compiler_type=dashmstdout
+      fi
+   fi
+
+   if test "$am_cv_[$1]_dependencies_compiler_type" = none; then
+      # -o /dev/null avoids selecting -E for a compiler that would
+      # output dependencies to the object file
+      if test -n "`$depcc -E conftest.c -o /dev/null 2>/dev/null`"; then
+        am_cv_[$1]_dependencies_compiler_type=cpp
+      fi
+   fi
+
+   dnl As a last resort, see if we can run CPP and extract line
+   dnl information from the output.
+   dnl FIXME
+
+   rm -f conftest.*
+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
-   $1="$3/missing $2"
-   AC_MSG_RESULT(missing)
+  DEPDIR=_deps
 fi
-AC_SUBST($1)])
+AC_SUBST(DEPDIR)
+])
+
+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([
+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
+])])
 
index 8745b4952716452028ba91fb5e9b91c69d8c07a5..e90edfc02b002488ffcf026dfe812920ef708504 100755 (executable)
@@ -411,6 +411,10 @@ sub parse_arguments
        {
            &set_strictness ('foreign');
        }
+       elsif ($arglist[0] eq '--include-deps')
+       {
+           $cmdline_use_dependencies = 1;
+       }
        elsif ($arglist[0] eq '--ignore-deps' || $arglist[0] eq '-i')
        {
            $cmdline_use_dependencies = 0;
@@ -6367,6 +6371,7 @@ sub initialize_global_constants
   --gnu                 set strictness to gnu
   --help                print this help, then exit
   -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
@@ -6390,17 +6395,17 @@ sub initialize_global_constants
     # if we chmod a symlink.
     $dist_header = "\t" . '-chmod -R a+r $(distdir)' . "\n";
     $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 > $(distdir).shar.gz'
                     . "\n");
     $dist{'dist-zip'} = "\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" . '-rm -rf $(distdir)' . "\n";
 }
index 05ca17b6d129d2d783fe901f389e5455a557a531..d712d9d6ac862bf50777a73fa6a504dc1d48a162 100755 (executable)
--- a/configure
+++ b/configure
@@ -690,6 +690,14 @@ else
 fi
 
 
+if test -d .deps || mkdir .deps 2> /dev/null || test -d .deps; then
+  DEPDIR=.deps
+else
+  DEPDIR=_deps
+fi
+
+
+
 
 PACKAGE=automake
 
@@ -709,118 +717,30 @@ EOF
 
 
 missing_dir=`cd $ac_aux_dir && pwd`
-echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:714: checking for working aclocal" >&5
-# 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 (aclocal --version) < /dev/null > /dev/null 2>&1; then
-   ACLOCAL=aclocal
-   echo "$ac_t""found" 1>&6
-else
-   ACLOCAL="$missing_dir/missing aclocal"
-   echo "$ac_t""missing" 1>&6
-fi
+ACLOCAL=${ACLOCAL-"$missing_dir/missing --run aclocal"}
 
-echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:727: checking for working autoconf" >&5
-# 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 (autoconf --version) < /dev/null > /dev/null 2>&1; then
-   AUTOCONF=autoconf
-   echo "$ac_t""found" 1>&6
-else
-   AUTOCONF="$missing_dir/missing autoconf"
-   echo "$ac_t""missing" 1>&6
-fi
+AUTOCONF=${AUTOCONF-"$missing_dir/missing --run autoconf"}
 
-echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:740: checking for working automake" >&5
-# 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 (automake --version) < /dev/null > /dev/null 2>&1; then
-   AUTOMAKE=automake
-   echo "$ac_t""found" 1>&6
-else
-   AUTOMAKE="$missing_dir/missing automake"
-   echo "$ac_t""missing" 1>&6
-fi
+AUTOMAKE=${AUTOMAKE-"$missing_dir/missing --run automake"}
 
-echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:753: checking for working autoheader" >&5
-# 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 (autoheader --version) < /dev/null > /dev/null 2>&1; then
-   AUTOHEADER=autoheader
-   echo "$ac_t""found" 1>&6
-else
-   AUTOHEADER="$missing_dir/missing autoheader"
-   echo "$ac_t""missing" 1>&6
-fi
+AUTOHEADER=${AUTOHEADER-"$missing_dir/missing --run autoheader"}
 
-echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:766: checking for working makeinfo" >&5
-# 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 (makeinfo --version) < /dev/null > /dev/null 2>&1; then
-   MAKEINFO=makeinfo
-   echo "$ac_t""found" 1>&6
-else
-   MAKEINFO="$missing_dir/missing makeinfo"
-   echo "$ac_t""missing" 1>&6
-fi
+MAKEINFO=${MAKEINFO-"$missing_dir/missing --run makeinfo"}
 
-for ac_prog in gnutar gtar tar
-do
-# Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:783: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_TAR'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  if test -n "$TAR"; then
-  ac_cv_prog_TAR="$TAR" # Let the user override the test.
-else
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_prog_TAR="$ac_prog"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
-fi
-fi
-TAR="$ac_cv_prog_TAR"
-if test -n "$TAR"; then
-  echo "$ac_t""$TAR" 1>&6
-else
-  echo "$ac_t""no" 1>&6
-fi
+AMTAR=${AMTAR-"$missing_dir/missing --run tar"}
 
-test -n "$TAR" && break
-done
 
-AMTARFLAGS=
-if test -n "$TAR"; then
-  if $SHELL -c "$TAR --version" > /dev/null 2>&1; then
-        AMTARFLAGS=o
-  fi
-fi
 
 
+   
+
+   
+
 
 # Extract the first word of "perl", so it can be a program name with args.
 set dummy perl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:824: checking for $ac_word" >&5
+echo "configure:744: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1014,9 +934,9 @@ s%@AUTOCONF@%$AUTOCONF%g
 s%@AUTOMAKE@%$AUTOMAKE%g
 s%@AUTOHEADER@%$AUTOHEADER%g
 s%@MAKEINFO@%$MAKEINFO%g
-s%@TAR@%$TAR%g
-s%@AMTARFLAGS@%$AMTARFLAGS%g
+s%@AMTAR@%$AMTAR%g
 s%@SET_MAKE@%$SET_MAKE%g
+s%@DEPDIR@%$DEPDIR%g
 s%@PERL@%$PERL%g
 
 CEOF
index 8519b1de602680239544d4b7697bd0b515e55c33..687ee31ede87f758efeda6f391d196428b3b03b5 100644 (file)
@@ -57,11 +57,15 @@ POST_INSTALL = :
 NORMAL_UNINSTALL = :
 PRE_UNINSTALL = :
 POST_UNINSTALL = :
-AMTARFLAGS = @AMTARFLAGS@
+AMTAR = @AMTAR@
+CC = @CC@
+CPP = @CPP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+DEPDIR = @DEPDIR@
 MAKEINFO = @MAKEINFO@
 PACKAGE = @PACKAGE@
 PERL = @PERL@
-TAR = @TAR@
 VERSION = @VERSION@
 
 
@@ -121,11 +125,6 @@ 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 \
index 802739f011ff651d579daaa704585777f375c5ef..7943c1e36fabe1fe1423cee5c51cd19ac5190247 100644 (file)
@@ -31,19 +31,7 @@ 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 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)
-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)
+AM_MISSING_PROG(AMTAR, tar, $missing_dir)
 AC_REQUIRE([AC_PROG_MAKE_SET])
 AC_REQUIRE([AM_SET_DEPDIR])
 ifdef([AC_PROVIDE_AC_PROG_CC], [AM_DEPENDENCIES(CC)], [
index 39178df201c7846b220231fb7b3c771924a96eee..e362692137a37e4818ccca209f5f4972c6cbbfc0 100644 (file)
@@ -2,17 +2,5 @@
 ## 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)
-fi
+AC_DEFUN(AM_MISSING_PROG, [$1=${$1-"$3/missing --run $2"}
 AC_SUBST($1)])
diff --git a/missing b/missing
index 7789652e877fbc83c770377691249820eebea1f2..b965c144466c0e97abf7c37b60e37c4928c55667 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 9bd419c58baa733d66ad84f9e26857e2dab2f65d..1cff1c56bc6c4b9ddc03b124370753e041a4ea65 100644 (file)
@@ -57,11 +57,15 @@ POST_INSTALL = :
 NORMAL_UNINSTALL = :
 PRE_UNINSTALL = :
 POST_UNINSTALL = :
-AMTARFLAGS = @AMTARFLAGS@
+AMTAR = @AMTAR@
+CC = @CC@
+CPP = @CPP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+DEPDIR = @DEPDIR@
 MAKEINFO = @MAKEINFO@
 PACKAGE = @PACKAGE@
 PERL = @PERL@
-TAR = @TAR@
 VERSION = @VERSION@
 
 
@@ -140,11 +144,6 @@ distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
 subdir = tests
 
 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 \