Better aclocal/AM_ support
authorTom Tromey <tromey@redhat.com>
Mon, 5 Aug 1996 22:45:55 +0000 (22:45 +0000)
committerTom Tromey <tromey@redhat.com>
Mon, 5 Aug 1996 22:45:55 +0000 (22:45 +0000)
25 files changed:
ChangeLog
Makefile.am
Makefile.in
NEWS
aclocal.in
aclocal.m4
automake.in
configure
configure.in
lib/am/Makefile.am
m4/AM_INIT_AUTOMAKE.m4 [new file with mode: 0644]
m4/Makefile.am
m4/Makefile.in
tests/ChangeLog
tests/Makefile.am
tests/Makefile.in
tests/ansi.test
tests/defs
tests/error.test
tests/fpinst2.test
tests/fpinstall.test
tests/obsolete.test [new file with mode: 0755]
tests/package.test
tests/proginst.test
tests/subdir.test

index 632c361..b994daa 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,39 @@
 Mon Aug  5 00:12:45 1996  Tom Tromey  <tromey@creche.cygnus.com>
 
+       * automake.in (parse_arguments): Use $PACKAGE.
+       ($PACKAGE): New global.
+       ($am_c_prototypes): Renamed.
+       (get_object_extension): Use am_c_prototypes.
+       (scan_configure): Ditto.
+       (scan_configure): Use AM_MAINTAINER_MODE.
+       (scan_configure): Warn about obsolete macros.
+
+       * aclocal.in (parse_arguments): Use $PACKAGE.
+       ($PACKAGE): New global.
+
+       * Makefile.am (CLEANFILES): Added aclocal.
+       (ETAGS_ARGS): Added aclocal.in.
+       (TAGS_DEPENDENCIES): Ditto.
+       (maintainer-check): Depend on aclocal.
+       (maintainer-check): Check aclocal.
+       (bin_SCRIPTS): Include aclocal.
+
+       * automake.in (scan_configure): Handle AM_INIT_AUTOMAKE.
+       (scan_configure): Use AM_PROG_INSTALL.
+
+       * configure.in: Use AM_INIT_AUTOMAKE.
+
+       * automake.in (keyed_aclocal_warning): Warning tells about
+       aclocal.
+       (handle_aclocal_m4): New sub.
+       (handle_configure): Use it.
+
+       * aclocal.in (output_file): New global.
+       (usage): Handle --output.
+       (parse_arguments): Handle --output.
+
+       * m4/AM_INIT_AUTOMAKE.m4: New file.
+
        * m4/AM_PROG_CC_STDC.m4: Require AC_PROG_CC.
        Don't touch CFLAGS.
 
index 23a695a..a0dde7f 100644 (file)
@@ -6,7 +6,7 @@ PERL = @PERL@
 
 SUBDIRS = tests m4
 
-bin_SCRIPTS = automake
+bin_SCRIPTS = automake aclocal
 info_TEXINFOS = automake.texi
 # SUBDIRS = intl po
 # CONFIG_HEADER = config.h
@@ -24,12 +24,12 @@ ansi2knr.1 aclocal.m4 lisp.am lisp-clean.am
 pkgdata_SCRIPTS = config.guess config.sub install-sh mdate-sh \
 mkinstalldirs elisp-comp
 
-CLEANFILES = automake
+CLEANFILES = automake aclocal
 
 # The following requires a fixed version of the Emacs 19.30 etags.
-ETAGS_ARGS = automake.in --lang=none \
+ETAGS_ARGS = automake.in aclocal.in --lang=none \
  --regex='/^@node[ \t]+\([^,]+\)/\1/' automake.texi
-TAGS_DEPENDENCIES = automake.in automake.texi
+TAGS_DEPENDENCIES = automake.in aclocal.in automake.texi
 
 ## `test -x' is not portable.  So we use Perl instead.  If Perl
 ## doesn't exist, then this test is meaningless anyway.
@@ -43,9 +43,10 @@ installcheck-local:
 
 # Some simple checks, and then ordinary check.  These are only really
 # guaranteed to work on my machine.
-maintainer-check: automake
+maintainer-check: automake aclocal
 ## Syntax check with default Perl (on my machine, Perl 5).
        $(PERL) -c -w automake
+       $(PERL) -c -w aclocal
 ## Ensure `true' is never used; I've accidentally used it before.
        @if grep '^[^#].*true' $(srcdir)/[a-z]*.am; then \
          echo "can't use 'true' in GNU Makefile" 1>&2; \
@@ -65,6 +66,7 @@ maintainer-check: automake
 ## Another syntax check, this time with Perl 4, if it exists.
        @if $(SHELL) -c 'perl4.036 -v' >/dev/null 2>&1; then \
          perl4.036 -c -w automake; \
+         perl4.036 -c -w aclocal; \
        else :; fi
        $(MAKE) check
 
index 96f2607..588b739 100644 (file)
@@ -44,7 +44,7 @@ PERL = @PERL@
 
 SUBDIRS = tests m4
 
-bin_SCRIPTS = automake
+bin_SCRIPTS = automake aclocal
 info_TEXINFOS = automake.texi
 # SUBDIRS = intl po
 # CONFIG_HEADER = config.h
@@ -61,12 +61,12 @@ ansi2knr.1 aclocal.m4 lisp.am lisp-clean.am
 pkgdata_SCRIPTS = config.guess config.sub install-sh mdate-sh \
 mkinstalldirs elisp-comp
 
-CLEANFILES = automake
+CLEANFILES = automake aclocal
 
 # The following requires a fixed version of the Emacs 19.30 etags.
-ETAGS_ARGS = automake.in --lang=none \
+ETAGS_ARGS = automake.in aclocal.in --lang=none \
  --regex='/^@node[ \t]+\([^,]+\)/\1/' automake.texi
-TAGS_DEPENDENCIES = automake.in automake.texi
+TAGS_DEPENDENCIES = automake.in aclocal.in automake.texi
 ACLOCAL = aclocal.m4
 mkinstalldirs = $(top_srcdir)/mkinstalldirs
 SCRIPTS = $(bin_SCRIPTS) $(pkgdata_SCRIPTS)
@@ -74,7 +74,7 @@ SCRIPTS = $(bin_SCRIPTS) $(pkgdata_SCRIPTS)
 
 MAKEINFO = makeinfo
 TEXI2DVI = texi2dvi
-INFOS = automake.info .info-[0-9] .info-[0-9][0-9]
+INFOS = automake.info automake.info-[0-9] automake.info-[0-9][0-9]
 INFO_DEPS = automake.info
 DVIS = automake.dvi
 TEXINFOS = automake.texi
@@ -99,6 +99,8 @@ DEP_DISTFILES = $(DIST_COMMON) $(SOURCES) $(BUILT_SOURCES) $(HEADERS) \
 TAR = tar
 default: all
 
+aclocal.m4: configure.in
+       cd $(srcdir) && aclocal
 
 $(srcdir)/Makefile.in: Makefile.am configure.in
        cd $(srcdir) && automake --strictness=gnits Makefile
@@ -319,7 +321,7 @@ distdir: $(DEP_DISTFILES)
          test -d $(distdir)/$$subdir           \
          || mkdir $(distdir)/$$subdir          \
          || exit 1;                            \
-         -chmod 755 $(distdir)/$$subdir;       \
+         chmod 755 $(distdir)/$$subdir;        \
          (cd $$subdir && $(MAKE) distdir=../$(distdir)/$$subdir distdir) \
            || exit 1; \
        done
@@ -420,8 +422,9 @@ installcheck-local:
 
 # Some simple checks, and then ordinary check.  These are only really
 # guaranteed to work on my machine.
-maintainer-check: automake
+maintainer-check: automake aclocal
        $(PERL) -c -w automake
+       $(PERL) -c -w aclocal
        @if grep '^[^#].*true' $(srcdir)/[a-z]*.am; then \
          echo "can't use 'true' in GNU Makefile" 1>&2; \
          exit 1;                               \
@@ -436,6 +439,7 @@ maintainer-check: automake
        else :; fi
        @if $(SHELL) -c 'perl4.036 -v' >/dev/null 2>&1; then \
          perl4.036 -c -w automake; \
+         perl4.036 -c -w aclocal; \
        else :; fi
        $(MAKE) check
 
diff --git a/NEWS b/NEWS
index 5906eba..d2f5b42 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,8 @@ New in 1.1b:
 * Added Emacs Lisp support
 * Added --no-force option
 * Included `aclocal' program
+* Automake will now generate rules to regenerate aclocal.m4, if appropriate
+* Now uses `AM_' macro names everywhere
 \f
 New in 1.0:
 * Bug fixes
index ff3dbc3..64dbc34 100644 (file)
@@ -9,6 +9,7 @@ eval 'exec @PERL@ -S $0 ${1+"$@"}'
 
 # Some constants.
 $VERSION = "@VERSION@";
+$PACKAGE = "@PACKAGE@";
 $prefix = "@prefix@";
 $acdir = "@datadir@/@PACKAGE@";
 
@@ -17,9 +18,12 @@ $acdir = "@datadir@/@PACKAGE@";
 # Exit status.
 $exit_status = 0;
 
-# Output.
+# Text to output.
 $output = '';
 
+# Output file name.
+$output_file = 'aclocal.m4';
+
 # Which files have been seen.
 %file_seen = ();
 
@@ -72,6 +76,7 @@ sub usage
     print "\
   --acdir=DIR           directory holding config files
   --help                print this help, then exit
+  --output=FILE         put output in FILE (default aclocal.m4)
   --verbose             don't be silent
   --version             print version number, then exit\n";
 
@@ -89,13 +94,17 @@ sub parse_arguments
        {
            $acdir = $1;
        }
+       elsif ($arglist[0] =~/^--output=(.+)$/)
+       {
+           $output_file = $1;
+       }
        elsif ($arglist[0] eq '--verbose')
        {
            ++$verbosity;
        }
        elsif ($arglist[0] eq '--version')
        {
-           print "aclocal - Autosystem $VERSION\n";
+           print "aclocal - $PACKAGE $VERSION\n";
            exit 0;
        }
        elsif ($arglist[0] eq '--help')
index cf180ad..8213147 100644 (file)
@@ -1,12 +1,29 @@
-dnl aclocal.m4 generated automatically by aclocal 0.1
+dnl aclocal.m4 generated automatically by aclocal 1.1b
+
+# Do all the work for Automake.  This macro actually does too much --
+# some checks are only needed if your package does certain things.
+# But this isn't really a big deal.
+
+dnl Usage:
+dnl AM_INIT_AUTOMAKE(package,version)
+
+AC_DEFUN(AM_INIT_AUTOMAKE,
+[AC_REQUIRE([AM_PROG_INSTALL])
+PACKAGE=[$1]
+AC_SUBST(PACKAGE)
+VERSION=[$2]
+AC_SUBST(VERSION)
+AC_ARG_PROGRAM
+AC_PROG_MAKE_SET])
 
 ## --------------------------------------------------------- ##
 ## Use AC_PROG_INSTALL, supplementing it with INSTALL_SCRIPT ##
 ## substitution.                                             ##
+## From Franc,ois Pinard                                     ##
 ## --------------------------------------------------------- ##
 
-AC_DEFUN(fp_PROG_INSTALL,
-[AC_PROG_INSTALL
+AC_DEFUN(AM_PROG_INSTALL,
+[AC_REQUIRE([AC_PROG_INSTALL])
 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL} -m 755'
 AC_SUBST(INSTALL_SCRIPT)dnl
 ])
index 3dfbb13..b11b565 100755 (executable)
@@ -30,6 +30,7 @@ eval 'exec @PERL@ -S $0 ${1+"$@"}'
 # Parameters set by configure.  Not to be changed.  NOTE: assign
 # VERSION as string so that eg version 0.30 will print correctly.
 $VERSION = "@VERSION@";
+$PACKAGE = "@PACKAGE@";
 $prefix = "@prefix@";
 $am_dir = "@datadir@/@PACKAGE@";
 
@@ -79,8 +80,8 @@ $add_missing = 0;
 # Files found by scanning configure.in for LIBOBJS.
 %libsources = ();
 
-# True if fp_C_PROTOTYPES appears in configure.in.
-$fp_c_prototypes = 0;
+# True if AM_C_PROTOTYPES appears in configure.in.
+$am_c_prototypes = 0;
 
 # Names used in AC_CONFIG_HEADER call.  $config_name is the actual
 # (first) argument.  $config_header is the '.in' file.  Ordinarily the
@@ -126,7 +127,7 @@ $all_linguas = '';
 # Line number at which it appears.
 $all_linguas_line = 0;
 
-# 1 if AC_PROG_INSTALL seen, 2 if fp_PROG_INSTALL seen.
+# 1 if AC_PROG_INSTALL seen, 2 if AM_PROG_INSTALL seen.
 $seen_prog_install = 0;
 
 # 1 if any scripts installed, 0 otherwise.
@@ -152,7 +153,7 @@ $seen_arg_prog = 0;
 $seen_libtool = 0;
 $libtool_line = 0;
 
-# TRUE if we've seen jm_MAINTAINER_MODE.
+# TRUE if we've seen AM_MAINTAINER_MODE.
 $seen_maint_mode = 0;
 
 # TRUE if we've seen PACKAGE and VERSION.
@@ -209,9 +210,9 @@ foreach $am_file (@input_files)
 
 if ($seen_prog_install <= $scripts_installed)
 {
-    &am_conf_error (($scripts_installed ? 'fp_PROG_INSTALL' : 'AC_PROG_INSTALL')
+    &am_conf_error (($scripts_installed ? 'AM_PROG_INSTALL' : 'AC_PROG_INSTALL')
                    . " must be used in configure.in");
-    &keyed_aclocal_warning ('fp_PROG_INSTALL')
+    &keyed_aclocal_warning ('AM_PROG_INSTALL')
        if $scripts_installed;
 }
 
@@ -232,7 +233,7 @@ sub parse_arguments
     {
        if ($arglist[0] eq "--version")
        {
-           print "Automake version $VERSION\n";
+           print "automake - $PACKAGE $VERSION\n";
            exit 0;
        }
        elsif ($arglist[0] eq "--help")
@@ -523,13 +524,13 @@ sub get_object_extension
 
        if (defined $options{'ansi2knr'})
        {
-           if (! $fp_c_prototypes)
+           if (! $am_c_prototypes)
            {
                &am_line_error ('AUTOMAKE_OPTIONS',
-                               "option \`ansi2knr' in use but \`fp_C_PROTOTYPES' not in configure.in");
-               &keyed_aclocal_warning ('fp_C_PROTOTYPES');
+                               "option \`ansi2knr' in use but \`AM_C_PROTOTYPES' not in configure.in");
+               &keyed_aclocal_warning ('AM_C_PROTOTYPES');
                # Only give this error once.
-               $fp_c_prototypes = 1;
+               $am_c_prototypes = 1;
            }
 
            $dir_holds_sources = '$o';
@@ -1472,6 +1473,50 @@ sub handle_subdirs
     $recursive_install = 1;
 }
 
+# Handle aclocal.m4.
+sub handle_aclocal_m4
+{
+    local ($regen_aclocal) = 0;
+    if (-f 'aclocal.m4')
+    {
+       $output_vars .= "ACLOCAL = aclocal.m4\n";
+       &push_dist_common ('aclocal.m4');
+
+       if (open (ACLOCAL, '< aclocal.m4'))
+       {
+           local ($line);
+           $line = <ACLOCAL>;
+           close (ACLOCAL);
+
+           if ($line =~ 'generated automatically by aclocal')
+           {
+               $regen_aclocal = 1;
+           }
+       }
+    }
+
+    local ($acinclude) = 0;
+    if (-f 'acinclude.m4')
+    {
+       $regen_aclocal = 1;
+       $acinclude = 1;
+    }
+    else
+    {
+       # FIXME how to tell if aclocal.m4 should be automatically
+       # regenerated?
+    }
+
+    if ($regen_aclocal)
+    {
+       $output_rules .= ("aclocal.m4: configure.in"
+                         . ($acinclude ? ' acinclude.m4' : '')
+                         . "\n\t"
+                         . 'cd $(srcdir) && aclocal'
+                         . "\n");
+    }
+}
+
 # Handle remaking and configure stuff.
 sub handle_configure
 {
@@ -1488,11 +1533,7 @@ sub handle_configure
     }
     else
     {
-       if (-f 'aclocal.m4')
-       {
-           $output_vars .= "ACLOCAL = aclocal.m4\n";
-           &push_dist_common ('aclocal.m4');
-       }
+       &handle_aclocal_m4;
        $output_rules .= &file_contents_with_transform ('s/\@STRICTNESS\@/'
                                                        . $strictness_name
                                                        . '/g',
@@ -2181,6 +2222,11 @@ sub scan_configure
            }
        }
 
+       if (/(fp_PROG_INSTALL|fp_C_PROTOTYPES|jm_MAINTAINER_MODE)/)
+       {
+           &am_conf_line_error ($., "\`$1' is obsolete; use corresponding \`AM_' macro");
+       }
+
        # Process the AC_OUTPUT macro.
        if (! $in_ac_output && s/AC_OUTPUT\s*\(\[?//)
        {
@@ -2212,7 +2258,7 @@ sub scan_configure
        }
 
        # Check for ansi2knr.
-       $fp_c_prototypes = 1 if /fp_C_PROTOTYPES/;
+       $am_c_prototypes = 1 if /AM_C_PROTOTYPES/;
 
        # Check for NLS support.
        if (/ud_GNU_GETTEXT/)
@@ -2260,19 +2306,28 @@ sub scan_configure
                                || /AC_SUBST\(YACC\)/
                                || /AC_(PATH|CHECK)_PROGS?\(YACC/);
 
+        # This macro handles several different things.
+        if (/AM_INIT_AUTOMAKE/)
+       {
+           $seen_make_set = 1;
+           $seen_package = 1;
+           $seen_version = 1;
+           $seen_arg_prog = 1;
+       }
+
        # Some things required by Automake.
        $seen_make_set = 1 if /AC_PROG_MAKE_SET/;
        $seen_arg_prog = 1 if /AC_ARG_PROGRAM/;
        $seen_ranlib = 1 if /AC_PROG_RANLIB/;
-        $seen_maint_mode = 1 if /jm_MAINTAINER_MODE/;
+        $seen_maint_mode = 1 if /AM_MAINTAINER_MODE/;
         $seen_package = 1 if /PACKAGE=/;
         $seen_version = 1 if /VERSION=/;
 
         # Weird conditionals here because it is always allowed to
-        # upgrade to fp_PROG_INSTALL but never to downgrade to
+        # upgrade to AM_PROG_INSTALL but never to downgrade to
         # AC_PROG_INSTALL.
        $seen_prog_install = 1 if ! $seen_prog_install && /AC_PROG_INSTALL/;
-       $seen_prog_install = 2 if /fp_PROG_INSTALL/;
+       $seen_prog_install = 2 if /AM_PROG_INSTALL/;
 
         $seen_lispdir = 1 if /ud_PATH_LISPDIR/;
 
@@ -3318,7 +3373,7 @@ sub am_conf_line_error
 sub keyed_aclocal_warning
 {
     local ($key) = @_;
-    warn "automake: macro \`$key' can be found in ${am_dir}/aclocal.m4\n";
+    warn "automake: macro \`$key' can be generated by \`aclocal'\n";
 }
 
 # Print usage information.
index caa685d..c5a5d74 100755 (executable)
--- a/configure
+++ b/configure
@@ -513,64 +513,6 @@ fi
 
 
 
-PACKAGE=automake
-
-cat >> confdefs.h <<EOF
-#define PACKAGE "$PACKAGE"
-EOF
-
-VERSION=1.1b
-
-cat >> confdefs.h <<EOF
-#define VERSION "$VERSION"
-EOF
-
-
-echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-set dummy ${MAKE-make}; ac_make=`echo "$2" | tr './\055' '___'`
-if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftestmake <<\EOF
-all:
-       @echo 'ac_maketemp="${MAKE}"'
-EOF
-# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
-if test -n "$ac_maketemp"; then
-  eval ac_cv_prog_make_${ac_make}_set=yes
-else
-  eval ac_cv_prog_make_${ac_make}_set=no
-fi
-rm -f conftestmake
-fi
-if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  SET_MAKE=
-else
-  echo "$ac_t""no" 1>&6
-  SET_MAKE="MAKE=${MAKE-make}"
-fi
-
-if test "$program_transform_name" = s,x,x,; then
-  program_transform_name=
-else
-  # Double any \ or $.  echo might interpret backslashes.
-  cat <<\EOF_SED > conftestsed
-s,\\,\\\\,g; s,\$,$$,g
-EOF_SED
-  program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
-  rm -f conftestsed
-fi
-test "$program_prefix" != NONE &&
-  program_transform_name="s,^,${program_prefix},; $program_transform_name"
-# Use a double $ so make ignores it.
-test "$program_suffix" != NONE &&
-  program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
-
-# sed with no file args requires a program.
-test "$program_transform_name" = "" && program_transform_name="s,x,x,"
-
 ac_aux_dir=
 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
   if test -f $ac_dir/install-sh; then
@@ -649,6 +591,106 @@ test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
 
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL} -m 755'
+
+
+PACKAGE=automake
+
+VERSION=1.1b
+
+if test "$program_transform_name" = s,x,x,; then
+  program_transform_name=
+else
+  # Double any \ or $.  echo might interpret backslashes.
+  cat <<\EOF_SED > conftestsed
+s,\\,\\\\,g; s,\$,$$,g
+EOF_SED
+  program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
+  rm -f conftestsed
+fi
+test "$program_prefix" != NONE &&
+  program_transform_name="s,^,${program_prefix},; $program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+  program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
+
+# sed with no file args requires a program.
+test "$program_transform_name" = "" && program_transform_name="s,x,x,"
+
+echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
+set dummy ${MAKE-make}; ac_make=`echo "$2" | tr './\055' '___'`
+if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftestmake <<\EOF
+all:
+       @echo 'ac_maketemp="${MAKE}"'
+EOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+  eval ac_cv_prog_make_${ac_make}_set=yes
+else
+  eval ac_cv_prog_make_${ac_make}_set=no
+fi
+rm -f conftestmake
+fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  SET_MAKE=
+else
+  echo "$ac_t""no" 1>&6
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+
+echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
+set dummy ${MAKE-make}; ac_make=`echo "$2" | tr './\055' '___'`
+if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftestmake <<\EOF
+all:
+       @echo 'ac_maketemp="${MAKE}"'
+EOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+  eval ac_cv_prog_make_${ac_make}_set=yes
+else
+  eval ac_cv_prog_make_${ac_make}_set=no
+fi
+rm -f conftestmake
+fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  SET_MAKE=
+else
+  echo "$ac_t""no" 1>&6
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+if test "$program_transform_name" = s,x,x,; then
+  program_transform_name=
+else
+  # Double any \ or $.  echo might interpret backslashes.
+  cat <<\EOF_SED > conftestsed
+s,\\,\\\\,g; s,\$,$$,g
+EOF_SED
+  program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
+  rm -f conftestsed
+fi
+test "$program_prefix" != NONE &&
+  program_transform_name="s,^,${program_prefix},; $program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+  program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
+
+# sed with no file args requires a program.
+test "$program_transform_name" = "" && program_transform_name="s,x,x,"
+
+
 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL} -m 755'
 
 
@@ -816,12 +858,12 @@ s%@includedir@%$includedir%g
 s%@oldincludedir@%$oldincludedir%g
 s%@infodir@%$infodir%g
 s%@mandir@%$mandir%g
-s%@PACKAGE@%$PACKAGE%g
-s%@VERSION@%$VERSION%g
-s%@SET_MAKE@%$SET_MAKE%g
 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
 s%@INSTALL_DATA@%$INSTALL_DATA%g
 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
+s%@PACKAGE@%$PACKAGE%g
+s%@VERSION@%$VERSION%g
+s%@SET_MAKE@%$SET_MAKE%g
 s%@PERL@%$PERL%g
 
 CEOF
index cafc91c..66b1cea 100644 (file)
@@ -1,16 +1,11 @@
 dnl Process this file with autoconf to produce a configure script.
 AC_INIT(automake.in)
 
-PACKAGE=automake
-AC_SUBST(PACKAGE)
-AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
-VERSION=1.1b
-AC_SUBST(VERSION)
-AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
+AM_INIT_AUTOMAKE(automake, 1.1b)
 
 AC_PROG_MAKE_SET
 AC_ARG_PROGRAM
-fp_PROG_INSTALL
+AM_PROG_INSTALL
 
 AC_PATH_PROG(PERL, perl)
 if test -z "$PERL"; then
index 23a695a..a0dde7f 100644 (file)
@@ -6,7 +6,7 @@ PERL = @PERL@
 
 SUBDIRS = tests m4
 
-bin_SCRIPTS = automake
+bin_SCRIPTS = automake aclocal
 info_TEXINFOS = automake.texi
 # SUBDIRS = intl po
 # CONFIG_HEADER = config.h
@@ -24,12 +24,12 @@ ansi2knr.1 aclocal.m4 lisp.am lisp-clean.am
 pkgdata_SCRIPTS = config.guess config.sub install-sh mdate-sh \
 mkinstalldirs elisp-comp
 
-CLEANFILES = automake
+CLEANFILES = automake aclocal
 
 # The following requires a fixed version of the Emacs 19.30 etags.
-ETAGS_ARGS = automake.in --lang=none \
+ETAGS_ARGS = automake.in aclocal.in --lang=none \
  --regex='/^@node[ \t]+\([^,]+\)/\1/' automake.texi
-TAGS_DEPENDENCIES = automake.in automake.texi
+TAGS_DEPENDENCIES = automake.in aclocal.in automake.texi
 
 ## `test -x' is not portable.  So we use Perl instead.  If Perl
 ## doesn't exist, then this test is meaningless anyway.
@@ -43,9 +43,10 @@ installcheck-local:
 
 # Some simple checks, and then ordinary check.  These are only really
 # guaranteed to work on my machine.
-maintainer-check: automake
+maintainer-check: automake aclocal
 ## Syntax check with default Perl (on my machine, Perl 5).
        $(PERL) -c -w automake
+       $(PERL) -c -w aclocal
 ## Ensure `true' is never used; I've accidentally used it before.
        @if grep '^[^#].*true' $(srcdir)/[a-z]*.am; then \
          echo "can't use 'true' in GNU Makefile" 1>&2; \
@@ -65,6 +66,7 @@ maintainer-check: automake
 ## Another syntax check, this time with Perl 4, if it exists.
        @if $(SHELL) -c 'perl4.036 -v' >/dev/null 2>&1; then \
          perl4.036 -c -w automake; \
+         perl4.036 -c -w aclocal; \
        else :; fi
        $(MAKE) check
 
diff --git a/m4/AM_INIT_AUTOMAKE.m4 b/m4/AM_INIT_AUTOMAKE.m4
new file mode 100644 (file)
index 0000000..340a57c
--- /dev/null
@@ -0,0 +1,15 @@
+# Do all the work for Automake.  This macro actually does too much --
+# some checks are only needed if your package does certain things.
+# But this isn't really a big deal.
+
+dnl Usage:
+dnl AM_INIT_AUTOMAKE(package,version)
+
+AC_DEFUN(AM_INIT_AUTOMAKE,
+[AC_REQUIRE([AM_PROG_INSTALL])
+PACKAGE=[$1]
+AC_SUBST(PACKAGE)
+VERSION=[$2]
+AC_SUBST(VERSION)
+AC_ARG_PROGRAM
+AC_PROG_MAKE_SET])
index 096ed05..9d70880 100644 (file)
@@ -8,4 +8,5 @@ AM_FEATURE_ERRNO.m4 AM_FEATURE_EXIT.m4 AM_FUNC_FNMATCH.m4 \
 AM_GNU_GETTEXT.m4 AM_LC_MESSAGES.m4 AM_MAINTAINER_MODE.m4 \
 AM_PATH_LISPDIR.m4 AM_PROG_CC_STDC.m4 AM_PROG_INSTALL.m4 \
 AM_PROG_LIBTOOL.m4 AM_SYSTEM_HEADER.m4 AM_TYPE_PTRDIFF_T.m4 \
-AM_WITH_DMALLOC.m4 AM_WITH_NLS.m4 AM_WITH_REGEX.m4 AM_FUNC_STRTOD.m4
+AM_WITH_DMALLOC.m4 AM_WITH_NLS.m4 AM_WITH_REGEX.m4 AM_FUNC_STRTOD.m4 \
+AM_INIT_AUTOMAKE.m4
index 913929c..4f233a5 100644 (file)
@@ -46,7 +46,8 @@ AM_FEATURE_ERRNO.m4 AM_FEATURE_EXIT.m4 AM_FUNC_FNMATCH.m4 \
 AM_GNU_GETTEXT.m4 AM_LC_MESSAGES.m4 AM_MAINTAINER_MODE.m4 \
 AM_PATH_LISPDIR.m4 AM_PROG_CC_STDC.m4 AM_PROG_INSTALL.m4 \
 AM_PROG_LIBTOOL.m4 AM_SYSTEM_HEADER.m4 AM_TYPE_PTRDIFF_T.m4 \
-AM_WITH_DMALLOC.m4 AM_WITH_NLS.m4 AM_WITH_REGEX.m4 AM_FUNC_STRTOD.m4
+AM_WITH_DMALLOC.m4 AM_WITH_NLS.m4 AM_WITH_REGEX.m4 AM_FUNC_STRTOD.m4 \
+AM_INIT_AUTOMAKE.m4
 mkinstalldirs = $(top_srcdir)/mkinstalldirs
 DATA = $(pkgdata_DATA)
 
index e44ff2e..dbd3d2f 100644 (file)
@@ -1,5 +1,9 @@
 Mon Aug  5 01:03:03 1996  Tom Tromey  <tromey@creche.cygnus.com>
 
+       * obsolete.test: New file.
+
+       * Many files: Use AM_ macros, not fp_ macros.
+
        * info.test: New file.
 
 Sun Aug  4 12:47:34 1996  Tom Tromey  <tromey@creche.cygnus.com>
index 594bc5b..89476c4 100644 (file)
@@ -11,6 +11,6 @@ canon3.test mdate2.test subdir.test backsl.test package.test number.test \
 insh2.test outdir.test fpinstall.test fpinst2.test texinfo.test dejagnu.test \
 yacc.test mkinstall2.test texinfo2.test ansi.test depacl.test depacl2.test \
 error.test colon.test vtexi2.test tags.test comment.test libfiles.test \
-man.test info.test
+man.test info.test obsolete.test
 
 EXTRA_DIST = defs $(TESTS)
index b8005ea..8161bbd 100644 (file)
@@ -49,7 +49,7 @@ canon3.test mdate2.test subdir.test backsl.test package.test number.test \
 insh2.test outdir.test fpinstall.test fpinst2.test texinfo.test dejagnu.test \
 yacc.test mkinstall2.test texinfo2.test ansi.test depacl.test depacl2.test \
 error.test colon.test vtexi2.test tags.test comment.test libfiles.test \
-man.test info.test
+man.test info.test obsolete.test
 
 EXTRA_DIST = defs $(TESTS)
 mkinstalldirs = $(top_srcdir)/mkinstalldirs
index 89d7449..7259418 100755 (executable)
@@ -12,7 +12,7 @@ magic:
 END
 
 cat >> configure.in << 'END'
-fp_C_PROTOTYPES
+AM_C_PROTOTYPES
 END
 
 : > ansi2knr.c
index 72a4963..56fb39b 100644 (file)
@@ -28,7 +28,7 @@ cat > configure.in << 'END'
 PACKAGE=nonesuch
 VERSION=nonesuch
 AC_ARG_PROGRAM
-fp_PROG_INSTALL
+AM_PROG_INSTALL
 AC_OUTPUT(Makefile)
 END
 
index 9e63091..f46a8a8 100755 (executable)
@@ -5,13 +5,13 @@
 . $srcdir/defs || exit 1
 
 cat > configure.in << 'END'
-fp_C_PROTOTYPES
+AM_C_PROTOTYPES
 END
 
-# Set up a strange environment, where fp_C_PROTOTYPES exists but its
+# Set up a strange environment, where AM_C_PROTOTYPES exists but its
 # dependency does not.
-cat > fp_C_PROTOTYPES.m4 << 'END'
-AC_REQUIRE([fp_PROG_CC_STDC])
+cat > AM_C_PROTOTYPES.m4 << 'END'
+AC_REQUIRE([AM_PROG_CC_STDC])
 END
 
 # Our --acdir overrides the one in $ACLOCAL.
index 48887f8..dfa23c2 100755 (executable)
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-# Test to make sure "reversed" order of fp_PROG_INSTALL and
+# Test to make sure "reversed" order of AM_PROG_INSTALL and
 # AC_PROG_INSTALL is not buggy.
 
 . $srcdir/defs || exit 1
@@ -9,7 +9,7 @@ cat > configure.in << 'END'
 PACKAGE=nonesuch
 VERSION=nonesuch
 AC_ARG_PROGRAM
-fp_PROG_INSTALL
+AM_PROG_INSTALL
 AC_PROG_INSTALL
 AC_OUTPUT(Makefile)
 END
index d76953a..001b423 100755 (executable)
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-# Test for bug reported by Thomas Morgan.  If both fp_PROG_INSTALL and
+# Test for bug reported by Thomas Morgan.  If both AM_PROG_INSTALL and
 # AC_PROG_INSTALL appear in configure.in, bad error results.
 
 . $srcdir/defs || exit 1
@@ -10,7 +10,7 @@ PACKAGE=nonesuch
 VERSION=nonesuch
 AC_ARG_PROGRAM
 AC_PROG_INSTALL
-fp_PROG_INSTALL
+AM_PROG_INSTALL
 AC_OUTPUT(Makefile)
 END
 
diff --git a/tests/obsolete.test b/tests/obsolete.test
new file mode 100755 (executable)
index 0000000..143999b
--- /dev/null
@@ -0,0 +1,19 @@
+#! /bin/sh
+
+# Test to make sure obsolete macros really are.
+
+. $srcdir/defs || exit 1
+
+cat > configure.in << 'END'
+PACKAGE=nonesuch
+VERSION=nonesuch
+AC_ARG_PROGRAM
+AC_PROG_MAKE_SET
+fp_PROG_INSTALL
+AC_OUTPUT(Makefile one/Makefile one/two/Makefile)
+END
+
+: > Makefile.am
+
+$AUTOMAKE && exit 1
+exit 0
index 8b872d5..a7f4852 100755 (executable)
@@ -6,7 +6,7 @@
 
 cat > configure.in << 'END'
 AC_ARG_PROGRAM
-fp_PROG_INSTALL
+AM_PROG_INSTALL
 AC_OUTPUT(Makefile)
 END
 
index b292b4d..8065437 100755 (executable)
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 # Test for bug where when multiple scripts are installed,
-# the check for fp_PROG_INSTALL fails.
+# the check for AM_PROG_INSTALL fails.
 
 . $srcdir/defs || exit 1
 
index 04ab9e0..4e66718 100755 (executable)
@@ -12,7 +12,7 @@ PACKAGE=nonesuch
 VERSION=nonesuch
 AC_ARG_PROGRAM
 AC_PROG_MAKE_SET
-fp_PROG_INSTALL
+AM_PROG_INSTALL
 AC_OUTPUT(Makefile zot/Makefile)
 END