From ae0c9a760eb89e70e3b9e4e855f5915c0d4eea48 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 5 Aug 1996 22:45:55 +0000 Subject: [PATCH] Better aclocal/AM_ support --- ChangeLog | 34 ++++++++++ Makefile.am | 12 ++-- Makefile.in | 18 +++--- NEWS | 2 + aclocal.in | 13 +++- aclocal.m4 | 23 ++++++- automake.in | 97 ++++++++++++++++++++++------- configure | 164 +++++++++++++++++++++++++++++++------------------ configure.in | 9 +-- lib/am/Makefile.am | 12 ++-- m4/AM_INIT_AUTOMAKE.m4 | 15 +++++ m4/Makefile.am | 3 +- m4/Makefile.in | 3 +- tests/ChangeLog | 4 ++ tests/Makefile.am | 2 +- tests/Makefile.in | 2 +- tests/ansi.test | 2 +- tests/defs | 2 +- tests/error.test | 8 +-- tests/fpinst2.test | 4 +- tests/fpinstall.test | 4 +- tests/obsolete.test | 19 ++++++ tests/package.test | 2 +- tests/proginst.test | 2 +- tests/subdir.test | 2 +- 25 files changed, 330 insertions(+), 128 deletions(-) create mode 100644 m4/AM_INIT_AUTOMAKE.m4 create mode 100755 tests/obsolete.test diff --git a/ChangeLog b/ChangeLog index 632c361..b994daa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,39 @@ Mon Aug 5 00:12:45 1996 Tom Tromey + * 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. diff --git a/Makefile.am b/Makefile.am index 23a695a..a0dde7f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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/Makefile.in b/Makefile.in index 96f2607..588b739 100644 --- a/Makefile.in +++ b/Makefile.in @@ -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 --- 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 New in 1.0: * Bug fixes diff --git a/aclocal.in b/aclocal.in index ff3dbc3..64dbc34 100644 --- a/aclocal.in +++ b/aclocal.in @@ -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') diff --git a/aclocal.m4 b/aclocal.m4 index cf180ad..8213147 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -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 ]) diff --git a/automake.in b/automake.in index 3dfbb13..b11b565 100755 --- a/automake.in +++ b/automake.in @@ -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 = ; + 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. diff --git a/configure b/configure index caa685d..c5a5d74 100755 --- a/configure +++ b/configure @@ -513,64 +513,6 @@ fi -PACKAGE=automake - -cat >> confdefs.h <> confdefs.h <&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 diff --git a/configure.in b/configure.in index cafc91c..66b1cea 100644 --- a/configure.in +++ b/configure.in @@ -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 diff --git a/lib/am/Makefile.am b/lib/am/Makefile.am index 23a695a..a0dde7f 100644 --- a/lib/am/Makefile.am +++ b/lib/am/Makefile.am @@ -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 index 0000000..340a57c --- /dev/null +++ b/m4/AM_INIT_AUTOMAKE.m4 @@ -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]) diff --git a/m4/Makefile.am b/m4/Makefile.am index 096ed05..9d70880 100644 --- a/m4/Makefile.am +++ b/m4/Makefile.am @@ -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 diff --git a/m4/Makefile.in b/m4/Makefile.in index 913929c..4f233a5 100644 --- a/m4/Makefile.in +++ b/m4/Makefile.in @@ -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) diff --git a/tests/ChangeLog b/tests/ChangeLog index e44ff2e..dbd3d2f 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,5 +1,9 @@ Mon Aug 5 01:03:03 1996 Tom Tromey + * 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 diff --git a/tests/Makefile.am b/tests/Makefile.am index 594bc5b..89476c4 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -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) diff --git a/tests/Makefile.in b/tests/Makefile.in index b8005ea..8161bbd 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -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 diff --git a/tests/ansi.test b/tests/ansi.test index 89d7449..7259418 100755 --- a/tests/ansi.test +++ b/tests/ansi.test @@ -12,7 +12,7 @@ magic: END cat >> configure.in << 'END' -fp_C_PROTOTYPES +AM_C_PROTOTYPES END : > ansi2knr.c diff --git a/tests/defs b/tests/defs index 72a4963..56fb39b 100644 --- a/tests/defs +++ b/tests/defs @@ -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 diff --git a/tests/error.test b/tests/error.test index 9e63091..f46a8a8 100755 --- a/tests/error.test +++ b/tests/error.test @@ -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. diff --git a/tests/fpinst2.test b/tests/fpinst2.test index 48887f8..dfa23c2 100755 --- a/tests/fpinst2.test +++ b/tests/fpinst2.test @@ -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 diff --git a/tests/fpinstall.test b/tests/fpinstall.test index d76953a..001b423 100755 --- a/tests/fpinstall.test +++ b/tests/fpinstall.test @@ -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 index 0000000..143999b --- /dev/null +++ b/tests/obsolete.test @@ -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 diff --git a/tests/package.test b/tests/package.test index 8b872d5..a7f4852 100755 --- a/tests/package.test +++ b/tests/package.test @@ -6,7 +6,7 @@ cat > configure.in << 'END' AC_ARG_PROGRAM -fp_PROG_INSTALL +AM_PROG_INSTALL AC_OUTPUT(Makefile) END diff --git a/tests/proginst.test b/tests/proginst.test index b292b4d..8065437 100755 --- a/tests/proginst.test +++ b/tests/proginst.test @@ -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 diff --git a/tests/subdir.test b/tests/subdir.test index 04ab9e0..4e66718 100755 --- a/tests/subdir.test +++ b/tests/subdir.test @@ -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 -- 2.7.4