-# check deeper
-ac_rc=`($ac_cv_shtool --version) </dev/null 2>/dev/null | grep 'GNU shtool'`
-if test ".$ac_rc" = .; then
- ac_cv_shtool="${CONFIG_SHELL-/bin/sh} $ac_cv_shtool"
- ac_rc=`($ac_cv_shtool --version) </dev/null 2>/dev/null | grep 'GNU shtool'`
- if test ".$ac_rc" = .; then
- AC_MSG_ERROR([$ac_cv_shtool seems not to be GNU shtool])
- fi
+ifelse([$3],,
+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)
+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