]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Implement `autom4te --freeze'.
authorAkim Demaille <akim@epita.fr>
Tue, 5 Feb 2002 08:24:06 +0000 (08:24 +0000)
committerAkim Demaille <akim@epita.fr>
Tue, 5 Feb 2002 08:24:06 +0000 (08:24 +0000)
* bin/autom4te.in (&freeze): New.
* lib/autoconf/autoconf.m4, lib/autotest/general.m4,
* lib/m4sugar/m4sh.m4: Don't include files given by autom4te.

12 files changed:
Makefile.am
Makefile.in
aclocal.m4
lib/Makefile.am
lib/Makefile.in
lib/autoconf/Makefile.am
lib/autoconf/Makefile.in
lib/autotest/Makefile.am
lib/autotest/Makefile.in
lib/m4sugar/Makefile.am
lib/m4sugar/Makefile.in
man/autom4te.1

index 4ef70a495e57962dd77bfac06d6a737a55fcf8f8..6e3844bb2fb12b0b1931d8af46de3cc9c82a9608 100644 (file)
@@ -1,7 +1,7 @@
 ## Process this file with automake to create Makefile.in. -*-Makefile-*-
 
 ## Makefile for Autoconf.
-## Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+## Copyright (C) 1999, 2000, 2001, 2002 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
@@ -20,7 +20,9 @@
 
 AUTOMAKE_OPTIONS = check-news 1.5b dist-bzip2 readme-alpha
 
-SUBDIRS = . lib bin config man doc tests
+# bin/ and tests/ must be run first, as they build the tests executables
+# (tests/autom4te etc.), that we happen to use here.
+SUBDIRS = bin tests . lib config man doc
 
 ACLOCAL_AMFLAGS = -I config
 
index cacc99b88144b5ac59a50dc6f858a7e21d8b3e29..ad8b5bc0ae95baf51aaf29c47c31e2e53e18fdd2 100644 (file)
@@ -81,7 +81,9 @@ lispdir = @lispdir@
 
 AUTOMAKE_OPTIONS = check-news 1.5b dist-bzip2 readme-alpha
 
-SUBDIRS = . lib bin config man doc tests
+# bin/ and tests/ must be run first, as they build the tests executables
+# (tests/autom4te etc.), that we happen to use here.
+SUBDIRS = bin tests . lib config man doc
 
 ACLOCAL_AMFLAGS = -I config
 
index 03f5c0191213c5015b8533710e5278542458dd81..f4b0d6a1c59df371ee10e1fde7b0638829368672 100644 (file)
@@ -1,4 +1,4 @@
-# aclocal.m4 generated automatically by aclocal 1.5c -*- Autoconf -*-
+# aclocal.m4t generated automatically by aclocal 1.5c -*- Autoconf -*-
 
 # Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
 # Free Software Foundation, Inc.
index 2d18d3a567999eb980a55322f0561e4ccabb7e95..ef3bc3846d3dcca19f927b5fb863d020653412f5 100644 (file)
@@ -1,8 +1,25 @@
 ## Process this file with automake to create Makefile.in
 
+## Copyright 2002 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.
+
 SUBDIRS = Autom4te m4sugar autoconf autotest autoscan emacs
 nodist_pkgdata_DATA = autom4te.cfg
-EXTRA_DIST = autom4te.in
+EXTRA_DIST = autom4te.in freeze.mk
 
 edit = sed \
        -e 's,@SHELL\@,$(SHELL),g' \
index af831b1a1a6b6144fc5a16ed0c8d49a817727afe..831b23a4a35ae899a6e8ea7ccadf5b6306a80546 100644 (file)
@@ -81,7 +81,7 @@ lispdir = @lispdir@
 
 SUBDIRS = Autom4te m4sugar autoconf autotest autoscan emacs
 nodist_pkgdata_DATA = autom4te.cfg
-EXTRA_DIST = autom4te.in
+EXTRA_DIST = autom4te.in freeze.mk
 
 edit = sed \
        -e 's,@SHELL\@,$(SHELL),g' \
index 7b0fad348753873a9e9590661d47f17502263857..6ffbad9d052e9f69df988902e40b885ac32feae4 100644 (file)
@@ -26,7 +26,7 @@ dist_autoconflib_DATA = \
         functions.m4 headers.m4 types.m4 libs.m4 programs.m4
 
 nodist_autoconflib_DATA = autoconf.m4f
-
+CLEANFILES = $(nodist_autoconflib_DATA)
 
 
 ## --------------- ##
@@ -62,71 +62,5 @@ check-local:
 ## The frozen files.  ##
 ## ------------------ ##
 
-SUFFIXES = .m4 .m4f
-M4_INCLUDES =  --include $(srcdir) \
-               --include $(top_builddir)/lib \
-               --include $(top_srcdir)/lib
-
-# When processing the file with diversion disabled, there must be no
-# output but comments and empty lines.
-# If freezing produces output, something went wrong: a bad `divert',
-# or an improper paren etc.
-# It may happen that the output does not end with a end of line, hence
-# force an end of line when reporting errors.
-.m4.m4f:
-       $(M4) $(M4_INCLUDES) --fatal-warning --define divert \
-             $*.m4 2>error.log | \
-         sed 's/#.*//;/^$$/d' >process.log
-       if grep . error.log >/dev/null 2>&1; then \
-         echo "ERROR: Processing $*.m4 produced errors:" >&2; \
-         sed "s,^,$*.m4: ," <error.log >&2; \
-         echo >&2; \
-         exit 1; \
-       else \
-         rm -f error.log; \
-       fi
-       if grep . process.log >/dev/null 2>&1; then \
-         echo "ERROR: Processing $*.m4 produced output:" >&2; \
-         sed "s,^,$*.m4: ," <process.log >&2; \
-         echo >&2; \
-         exit 1; \
-       else \
-         rm -f process.log; \
-       fi
-       $(M4) $(M4_INCLUDES) --fatal-warning --freeze-state=$*.m4f \
-             $*.m4 >freeze.log
-       if grep . freeze.log >/dev/null 2>&1; then \
-         echo "ERROR: Freezing $(libdir)/$*.m4 produced output:" >&2; \
-         sed "s,^,$*.m4: ," <freeze.log >&2; \
-         echo >&2; \
-         exit 1; \
-       else \
-         rm -f freeze.log; \
-       fi
-
-
-# Some day we should explain to Automake how to use autom4te to compute
-# the dependencies...
-srclibdir = $(top_srcdir)/lib
-autoconf.m4f: $(srclibdir)/m4sugar/m4sugar.m4  \
-              ../m4sugar/version.m4    \
-              $(srclibdir)/m4sugar/m4sh.m4     \
-              $(srclibdir)/autoconf/autoconf.m4        \
-              $(srclibdir)/autoconf/general.m4 \
-              $(srclibdir)/autoconf/autoheader.m4 \
-              $(srclibdir)/autoconf/autoupdate.m4 \
-              $(srclibdir)/autoconf/autotest.m4 \
-              $(srclibdir)/autoconf/status.m4  \
-              $(srclibdir)/autoconf/oldnames.m4        \
-              $(srclibdir)/autoconf/specific.m4        \
-              $(srclibdir)/autoconf/lang.m4    \
-              $(srclibdir)/autoconf/c.m4       \
-              $(srclibdir)/autoconf/fortran.m4 \
-              $(srclibdir)/autoconf/functions.m4 \
-              $(srclibdir)/autoconf/headers.m4 \
-              $(srclibdir)/autoconf/types.m4   \
-              $(srclibdir)/autoconf/libs.m4    \
-              $(srclibdir)/autoconf/programs.m4
-
-# Files that should be removed, but which Automake does not know.
-CLEANFILES = autoconf.m4f
+autoconf.m4f: $(autoconf_m4f_dependencies)
+include ../freeze.mk
index 54f3464e5903b298faae91c88bc9c97f509c9bdf..c0bace5917190332492d4d0d9e93958c77e1967a 100644 (file)
@@ -89,6 +89,7 @@ dist_autoconflib_DATA = \
 
 
 nodist_autoconflib_DATA = autoconf.m4f
+CLEANFILES = $(nodist_autoconflib_DATA)
 
 TAGS_FILES = $(dist_autoconflib_DATA)
 
@@ -97,17 +98,55 @@ ETAGS_ARGS = --lang=none \
 
 
 SUFFIXES = .m4 .m4f
-M4_INCLUDES = --include $(srcdir) \
-               --include $(top_builddir)/lib \
-               --include $(top_srcdir)/lib
 
+AUTOM4TE = $(top_builddir)/tests/autom4te
 
+AUTOM4TE_CFG = $(top_builddir)/lib/autom4te.cfg
+
+# Factor the dependencies between all the frozen files.
 # Some day we should explain to Automake how to use autom4te to compute
 # the dependencies...
-srclibdir = $(top_srcdir)/lib
+src_libdir = $(top_srcdir)/lib
+build_libdir = $(top_builddir)/lib
+
+m4f_dependencies = $(AUTOM4TE) $(AUTOM4TE_CFG)
+
+m4sugar_m4f_dependencies = \
+       $(m4f_dependencies)                     \
+       $(src_libdir)/m4sugar/m4sugar.m4        \
+       $(build_libdir)/m4sugar/version.m4
+
+
+m4sh_m4f_dependencies = \
+       $(m4sugar_m4f_dependencies)             \
+       $(src_libdir)/m4sugar/m4sh.m4
+
+
+autotest_m4f_dependencies = \
+       $(m4sh_m4f_dependencies)                \
+       $(src_libdir)/autotest/autotest.m4      \
+       $(src_libdir)/autotest/general.m4
+
+
+autoconf_m4f_dependencies = \
+       $(m4sh_m4f_dependencies)                \
+       $(src_libdir)/autoconf/general.m4       \
+       $(src_libdir)/autoconf/autoheader.m4    \
+       $(src_libdir)/autoconf/autoupdate.m4    \
+       $(src_libdir)/autoconf/autotest.m4      \
+       $(src_libdir)/autoconf/status.m4        \
+       $(src_libdir)/autoconf/oldnames.m4      \
+       $(src_libdir)/autoconf/specific.m4      \
+       $(src_libdir)/autoconf/lang.m4          \
+       $(src_libdir)/autoconf/c.m4             \
+       $(src_libdir)/autoconf/fortran.m4       \
+       $(src_libdir)/autoconf/functions.m4     \
+       $(src_libdir)/autoconf/headers.m4       \
+       $(src_libdir)/autoconf/types.m4         \
+       $(src_libdir)/autoconf/libs.m4          \
+       $(src_libdir)/autoconf/programs.m4      \
+       $(src_libdir)/autoconf/autoconf.m4
 
-# Files that should be removed, but which Automake does not know.
-CLEANFILES = autoconf.m4f
 subdir = lib/autoconf
 mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
 CONFIG_CLEAN_FILES =
@@ -119,7 +158,7 @@ all: all-am
 
 .SUFFIXES:
 .SUFFIXES: .m4 .m4f
-$(srcdir)/Makefile.in:  Makefile.am  $(top_srcdir)/configure.ac $(ACLOCAL_M4)
+$(srcdir)/Makefile.in:  Makefile.am $(srcdir)/../freeze.mk $(top_srcdir)/configure.ac $(ACLOCAL_M4)
        cd $(top_srcdir) && \
          $(AUTOMAKE) --gnu  lib/autoconf/Makefile
 Makefile:  $(srcdir)/Makefile.in  $(top_builddir)/config.status
@@ -315,6 +354,12 @@ check-local:
          rm -f eof.log; \
        fi
 
+autoconf.m4f: $(autoconf_m4f_dependencies)
+$(AUTOM4TE):
+       cd $(top_builddir)/tests && $(MAKE) $(AM_MAKEFLAGS) autom4te
+$(AUTOM4TE_CFG):
+       cd $(top_builddir)/lib && $(MAKE) $(AM_MAKEFLAGS) autom4te.cfg
+
 # When processing the file with diversion disabled, there must be no
 # output but comments and empty lines.
 # If freezing produces output, something went wrong: a bad `divert',
@@ -322,54 +367,12 @@ check-local:
 # It may happen that the output does not end with a end of line, hence
 # force an end of line when reporting errors.
 .m4.m4f:
-       $(M4) $(M4_INCLUDES) --fatal-warning --define divert \
-             $*.m4 2>error.log | \
-         sed 's/#.*//;/^$$/d' >process.log
-       if grep . error.log >/dev/null 2>&1; then \
-         echo "ERROR: Processing $*.m4 produced errors:" >&2; \
-         sed "s,^,$*.m4: ," <error.log >&2; \
-         echo >&2; \
-         exit 1; \
-       else \
-         rm -f error.log; \
-       fi
-       if grep . process.log >/dev/null 2>&1; then \
-         echo "ERROR: Processing $*.m4 produced output:" >&2; \
-         sed "s,^,$*.m4: ," <process.log >&2; \
-         echo >&2; \
-         exit 1; \
-       else \
-         rm -f process.log; \
-       fi
-       $(M4) $(M4_INCLUDES) --fatal-warning --freeze-state=$*.m4f \
-             $*.m4 >freeze.log
-       if grep . freeze.log >/dev/null 2>&1; then \
-         echo "ERROR: Freezing $(libdir)/$*.m4 produced output:" >&2; \
-         sed "s,^,$*.m4: ," <freeze.log >&2; \
-         echo >&2; \
-         exit 1; \
-       else \
-         rm -f freeze.log; \
-       fi
-autoconf.m4f: $(srclibdir)/m4sugar/m4sugar.m4  \
-              ../m4sugar/version.m4    \
-              $(srclibdir)/m4sugar/m4sh.m4     \
-              $(srclibdir)/autoconf/autoconf.m4        \
-              $(srclibdir)/autoconf/general.m4 \
-              $(srclibdir)/autoconf/autoheader.m4 \
-              $(srclibdir)/autoconf/autoupdate.m4 \
-              $(srclibdir)/autoconf/autotest.m4 \
-              $(srclibdir)/autoconf/status.m4  \
-              $(srclibdir)/autoconf/oldnames.m4        \
-              $(srclibdir)/autoconf/specific.m4        \
-              $(srclibdir)/autoconf/lang.m4    \
-              $(srclibdir)/autoconf/c.m4       \
-              $(srclibdir)/autoconf/fortran.m4 \
-              $(srclibdir)/autoconf/functions.m4 \
-              $(srclibdir)/autoconf/headers.m4 \
-              $(srclibdir)/autoconf/types.m4   \
-              $(srclibdir)/autoconf/libs.m4    \
-              $(srclibdir)/autoconf/programs.m4
+       $(AUTOM4TE)                             \
+               --language=$*                   \
+               --freeze                        \
+               --include=$(srcdir)/..          \
+               --include=..                    \
+               --output=$@
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
index bbda1df032665e7500ace23873dc8d60b9e0cab4..73ef2c3ef76775c7d8b00957b6113d8e94c31081 100644 (file)
@@ -1,10 +1,26 @@
 ## Process this file with automake to create Makefile.in
 
-autotestlibdir = $(pkgdatadir)/autotest
+## Copyright 2001, 2002 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.
 
+autotestlibdir = $(pkgdatadir)/autotest
 dist_autotestlib_DATA = autotest.m4 general.m4
-
-
+nodist_autotestlib_DATA = autotest.m4f
+CLEANFILES = $(nodist_autotestlib_DATA)
 
 ## --------------- ##
 ## Building TAGS.  ##
@@ -30,3 +46,11 @@ check-local:
        else \
          rm -f eof.log; \
        fi
+
+
+## ------------------ ##
+## The frozen files.  ##
+## ------------------ ##
+
+autotest.m4f: $(autotests_m4f_dependencies)
+include ../freeze.mk
index a1f1ea7126e8aecc3e620a3d1e7fee86880ed463..0cc40aa5b15b5991db343653a44df81bbf3d305c 100644 (file)
@@ -80,25 +80,78 @@ install_sh = @install_sh@
 lispdir = @lispdir@
 
 autotestlibdir = $(pkgdatadir)/autotest
-
 dist_autotestlib_DATA = autotest.m4 general.m4
+nodist_autotestlib_DATA = autotest.m4f
+CLEANFILES = $(nodist_autotestlib_DATA)
 
 TAGS_FILES = $(dist_autotestlib_DATA)
 
 ETAGS_ARGS = --lang=none \
   --regex='/\(A[CU]_DEFUN\|m4_\(defun\|define\)\|define\)(\[\([^]]*\)\]/\3/'
 
+
+SUFFIXES = .m4 .m4f
+
+AUTOM4TE = $(top_builddir)/tests/autom4te
+
+AUTOM4TE_CFG = $(top_builddir)/lib/autom4te.cfg
+
+# Factor the dependencies between all the frozen files.
+# Some day we should explain to Automake how to use autom4te to compute
+# the dependencies...
+src_libdir = $(top_srcdir)/lib
+build_libdir = $(top_builddir)/lib
+
+m4f_dependencies = $(AUTOM4TE) $(AUTOM4TE_CFG)
+
+m4sugar_m4f_dependencies = \
+       $(m4f_dependencies)                     \
+       $(src_libdir)/m4sugar/m4sugar.m4        \
+       $(build_libdir)/m4sugar/version.m4
+
+
+m4sh_m4f_dependencies = \
+       $(m4sugar_m4f_dependencies)             \
+       $(src_libdir)/m4sugar/m4sh.m4
+
+
+autotest_m4f_dependencies = \
+       $(m4sh_m4f_dependencies)                \
+       $(src_libdir)/autotest/autotest.m4      \
+       $(src_libdir)/autotest/general.m4
+
+
+autoconf_m4f_dependencies = \
+       $(m4sh_m4f_dependencies)                \
+       $(src_libdir)/autoconf/general.m4       \
+       $(src_libdir)/autoconf/autoheader.m4    \
+       $(src_libdir)/autoconf/autoupdate.m4    \
+       $(src_libdir)/autoconf/autotest.m4      \
+       $(src_libdir)/autoconf/status.m4        \
+       $(src_libdir)/autoconf/oldnames.m4      \
+       $(src_libdir)/autoconf/specific.m4      \
+       $(src_libdir)/autoconf/lang.m4          \
+       $(src_libdir)/autoconf/c.m4             \
+       $(src_libdir)/autoconf/fortran.m4       \
+       $(src_libdir)/autoconf/functions.m4     \
+       $(src_libdir)/autoconf/headers.m4       \
+       $(src_libdir)/autoconf/types.m4         \
+       $(src_libdir)/autoconf/libs.m4          \
+       $(src_libdir)/autoconf/programs.m4      \
+       $(src_libdir)/autoconf/autoconf.m4
+
 subdir = lib/autotest
 mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
 CONFIG_CLEAN_FILES =
 DIST_SOURCES =
-DATA = $(dist_autotestlib_DATA)
+DATA = $(dist_autotestlib_DATA) $(nodist_autotestlib_DATA)
 
 DIST_COMMON = $(dist_autotestlib_DATA) Makefile.am Makefile.in
 all: all-am
 
 .SUFFIXES:
-$(srcdir)/Makefile.in:  Makefile.am  $(top_srcdir)/configure.ac $(ACLOCAL_M4)
+.SUFFIXES: .m4 .m4f
+$(srcdir)/Makefile.in:  Makefile.am $(srcdir)/../freeze.mk $(top_srcdir)/configure.ac $(ACLOCAL_M4)
        cd $(top_srcdir) && \
          $(AUTOMAKE) --gnu  lib/autotest/Makefile
 Makefile:  $(srcdir)/Makefile.in  $(top_builddir)/config.status
@@ -122,6 +175,24 @@ uninstall-dist_autotestlibDATA:
          echo " rm -f $(DESTDIR)$(autotestlibdir)/$$f"; \
          rm -f $(DESTDIR)$(autotestlibdir)/$$f; \
        done
+nodist_autotestlibDATA_INSTALL = $(INSTALL_DATA)
+install-nodist_autotestlibDATA: $(nodist_autotestlib_DATA)
+       @$(NORMAL_INSTALL)
+       $(mkinstalldirs) $(DESTDIR)$(autotestlibdir)
+       @list='$(nodist_autotestlib_DATA)'; for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         f="`echo $$p | sed -e 's|^.*/||'`"; \
+         echo " $(nodist_autotestlibDATA_INSTALL) $$d$$p $(DESTDIR)$(autotestlibdir)/$$f"; \
+         $(nodist_autotestlibDATA_INSTALL) $$d$$p $(DESTDIR)$(autotestlibdir)/$$f; \
+       done
+
+uninstall-nodist_autotestlibDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(nodist_autotestlib_DATA)'; for p in $$list; do \
+         f="`echo $$p | sed -e 's|^.*/||'`"; \
+         echo " rm -f $(DESTDIR)$(autotestlibdir)/$$f"; \
+         rm -f $(DESTDIR)$(autotestlibdir)/$$f; \
+       done
 
 ETAGS = etags
 ETAGSFLAGS =
@@ -188,7 +259,7 @@ check: check-am
 all-am: Makefile $(DATA)
 
 installdirs:
-       $(mkinstalldirs) $(DESTDIR)$(autotestlibdir)
+       $(mkinstalldirs) $(DESTDIR)$(autotestlibdir) $(DESTDIR)$(autotestlibdir)
 
 install: install-am
 install-exec: install-exec-am
@@ -207,6 +278,7 @@ install-strip:
 mostlyclean-generic:
 
 clean-generic:
+       -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
 
 distclean-generic:
        -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]*
@@ -230,7 +302,8 @@ info: info-am
 
 info-am:
 
-install-data-am: install-dist_autotestlibDATA
+install-data-am: install-dist_autotestlibDATA \
+       install-nodist_autotestlibDATA
 
 install-exec-am:
 
@@ -248,17 +321,19 @@ mostlyclean: mostlyclean-am
 
 mostlyclean-am: mostlyclean-generic
 
-uninstall-am: uninstall-dist_autotestlibDATA uninstall-info-am
+uninstall-am: uninstall-dist_autotestlibDATA uninstall-info-am \
+       uninstall-nodist_autotestlibDATA
 
 .PHONY: GTAGS all all-am check check-am check-local clean clean-generic \
        distclean distclean-generic distclean-tags distdir dvi dvi-am \
        info info-am install install-am install-data install-data-am \
        install-dist_autotestlibDATA install-exec install-exec-am \
-       install-info install-info-am install-man install-strip \
-       installcheck installcheck-am installdirs maintainer-clean \
+       install-info install-info-am install-man \
+       install-nodist_autotestlibDATA install-strip installcheck \
+       installcheck-am installdirs maintainer-clean \
        maintainer-clean-generic mostlyclean mostlyclean-generic tags \
        uninstall uninstall-am uninstall-dist_autotestlibDATA \
-       uninstall-info-am
+       uninstall-info-am uninstall-nodist_autotestlibDATA
 
 
 check-local:
@@ -271,6 +346,26 @@ check-local:
        else \
          rm -f eof.log; \
        fi
+
+autotest.m4f: $(autotests_m4f_dependencies)
+$(AUTOM4TE):
+       cd $(top_builddir)/tests && $(MAKE) $(AM_MAKEFLAGS) autom4te
+$(AUTOM4TE_CFG):
+       cd $(top_builddir)/lib && $(MAKE) $(AM_MAKEFLAGS) autom4te.cfg
+
+# When processing the file with diversion disabled, there must be no
+# output but comments and empty lines.
+# If freezing produces output, something went wrong: a bad `divert',
+# or an improper paren etc.
+# It may happen that the output does not end with a end of line, hence
+# force an end of line when reporting errors.
+.m4.m4f:
+       $(AUTOM4TE)                             \
+               --language=$*                   \
+               --freeze                        \
+               --include=$(srcdir)/..          \
+               --include=..                    \
+               --output=$@
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
index ec7329db77fcdd6b8f3058e74ef6e23a0382a244..3d7761d60f283b4ce093136ee26370a036066037 100644 (file)
@@ -1,9 +1,26 @@
 ## Process this file with automake to create Makefile.in
 
+## Copyright 2001, 2002 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.
+
 m4sugarlibdir = $(pkgdatadir)/m4sugar
 dist_m4sugarlib_DATA = m4sugar.m4 m4sh.m4
-nodist_m4sugarlib_DATA = version.m4
-DISTCLEANFILES         = $(nodist_m4sugarlib_DATA)
+nodist_m4sugarlib_DATA = version.m4 m4sugar.m4f m4sh.m4f
+CLEANFILES = $(nodist_m4sugarlib_DATA)
 
 ## ------------ ##
 ## version.m4.  ##
@@ -13,7 +30,8 @@ version.m4: $(top_srcdir)/configure.ac
        {                                       \
          echo '# This file is part of -*- Autoconf -*-.'; \
          echo '# Version of Autoconf.'; \
-         echo '# Copyright 1999, 2000, 2001 Free Software Foundation, Inc.'; \
+         echo '# Copyright (C) 1999, 2000, 2001, 2002'; \
+         echo '# Free Software Foundation, Inc.'; \
          echo ;\
          echo 'm4_define([m4_PACKAGE_NAME],      [@PACKAGE_NAME@])'; \
          echo 'm4_define([m4_PACKAGE_TARNAME],   [@PACKAGE_TARNAME@])'; \
@@ -47,3 +65,12 @@ check-local:
        else \
          rm -f eof.log; \
        fi
+
+
+## ------------------ ##
+## The frozen files.  ##
+## ------------------ ##
+
+m4sugar.m4f: $(m4sugar_m4f_dependencies)
+m4sh.m4f: $(m4sh_m4f_dependencies)
+include ../freeze.mk
index 7eb0f58a8437394f8037140711d7479c38df31a3..022d63ca50af7bfdc18652100aee0fb5983ecbf2 100644 (file)
@@ -81,14 +81,65 @@ lispdir = @lispdir@
 
 m4sugarlibdir = $(pkgdatadir)/m4sugar
 dist_m4sugarlib_DATA = m4sugar.m4 m4sh.m4
-nodist_m4sugarlib_DATA = version.m4
-DISTCLEANFILES = $(nodist_m4sugarlib_DATA)
+nodist_m4sugarlib_DATA = version.m4 m4sugar.m4f m4sh.m4f
+CLEANFILES = $(nodist_m4sugarlib_DATA)
 
 TAGS_FILES = $(dist_m4sugarlib_DATA)
 
 ETAGS_ARGS = --lang=none \
   --regex='/\(A[CU]_DEFUN\|m4_\(defun\|define\)\|define\)(\[\([^]]*\)\]/\3/'
 
+
+SUFFIXES = .m4 .m4f
+
+AUTOM4TE = $(top_builddir)/tests/autom4te
+
+AUTOM4TE_CFG = $(top_builddir)/lib/autom4te.cfg
+
+# Factor the dependencies between all the frozen files.
+# Some day we should explain to Automake how to use autom4te to compute
+# the dependencies...
+src_libdir = $(top_srcdir)/lib
+build_libdir = $(top_builddir)/lib
+
+m4f_dependencies = $(AUTOM4TE) $(AUTOM4TE_CFG)
+
+m4sugar_m4f_dependencies = \
+       $(m4f_dependencies)                     \
+       $(src_libdir)/m4sugar/m4sugar.m4        \
+       $(build_libdir)/m4sugar/version.m4
+
+
+m4sh_m4f_dependencies = \
+       $(m4sugar_m4f_dependencies)             \
+       $(src_libdir)/m4sugar/m4sh.m4
+
+
+autotest_m4f_dependencies = \
+       $(m4sh_m4f_dependencies)                \
+       $(src_libdir)/autotest/autotest.m4      \
+       $(src_libdir)/autotest/general.m4
+
+
+autoconf_m4f_dependencies = \
+       $(m4sh_m4f_dependencies)                \
+       $(src_libdir)/autoconf/general.m4       \
+       $(src_libdir)/autoconf/autoheader.m4    \
+       $(src_libdir)/autoconf/autoupdate.m4    \
+       $(src_libdir)/autoconf/autotest.m4      \
+       $(src_libdir)/autoconf/status.m4        \
+       $(src_libdir)/autoconf/oldnames.m4      \
+       $(src_libdir)/autoconf/specific.m4      \
+       $(src_libdir)/autoconf/lang.m4          \
+       $(src_libdir)/autoconf/c.m4             \
+       $(src_libdir)/autoconf/fortran.m4       \
+       $(src_libdir)/autoconf/functions.m4     \
+       $(src_libdir)/autoconf/headers.m4       \
+       $(src_libdir)/autoconf/types.m4         \
+       $(src_libdir)/autoconf/libs.m4          \
+       $(src_libdir)/autoconf/programs.m4      \
+       $(src_libdir)/autoconf/autoconf.m4
+
 subdir = lib/m4sugar
 mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
 CONFIG_CLEAN_FILES =
@@ -99,7 +150,8 @@ DIST_COMMON = $(dist_m4sugarlib_DATA) Makefile.am Makefile.in
 all: all-am
 
 .SUFFIXES:
-$(srcdir)/Makefile.in:  Makefile.am  $(top_srcdir)/configure.ac $(ACLOCAL_M4)
+.SUFFIXES: .m4 .m4f
+$(srcdir)/Makefile.in:  Makefile.am $(srcdir)/../freeze.mk $(top_srcdir)/configure.ac $(ACLOCAL_M4)
        cd $(top_srcdir) && \
          $(AUTOMAKE) --gnu  lib/m4sugar/Makefile
 Makefile:  $(srcdir)/Makefile.in  $(top_builddir)/config.status
@@ -226,10 +278,10 @@ install-strip:
 mostlyclean-generic:
 
 clean-generic:
+       -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
 
 distclean-generic:
        -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]*
-       -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
 
 maintainer-clean-generic:
        @echo "This command is intended for maintainers to use"
@@ -288,7 +340,8 @@ version.m4: $(top_srcdir)/configure.ac
        {                                       \
          echo '# This file is part of -*- Autoconf -*-.'; \
          echo '# Version of Autoconf.'; \
-         echo '# Copyright 1999, 2000, 2001 Free Software Foundation, Inc.'; \
+         echo '# Copyright (C) 1999, 2000, 2001, 2002'; \
+         echo '# Free Software Foundation, Inc.'; \
          echo ;\
          echo 'm4_define([m4_PACKAGE_NAME],      [@PACKAGE_NAME@])'; \
          echo 'm4_define([m4_PACKAGE_TARNAME],   [@PACKAGE_TARNAME@])'; \
@@ -307,6 +360,27 @@ check-local:
        else \
          rm -f eof.log; \
        fi
+
+m4sugar.m4f: $(m4sugar_m4f_dependencies)
+m4sh.m4f: $(m4sh_m4f_dependencies)
+$(AUTOM4TE):
+       cd $(top_builddir)/tests && $(MAKE) $(AM_MAKEFLAGS) autom4te
+$(AUTOM4TE_CFG):
+       cd $(top_builddir)/lib && $(MAKE) $(AM_MAKEFLAGS) autom4te.cfg
+
+# When processing the file with diversion disabled, there must be no
+# output but comments and empty lines.
+# If freezing produces output, something went wrong: a bad `divert',
+# or an improper paren etc.
+# It may happen that the output does not end with a end of line, hence
+# force an end of line when reporting errors.
+.m4.m4f:
+       $(AUTOM4TE)                             \
+               --language=$*                   \
+               --freeze                        \
+               --include=$(srcdir)/..          \
+               --include=..                    \
+               --output=$@
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
index cd9c547e1ad683683ac14b44b759d19542681217..6613665abf6233584728874668fd64ea4c070b9a 100644 (file)
@@ -6,8 +6,8 @@ autom4te \- Generate files and scripts thanks to M4
 .B autom4te
 [\fIOPTION\fR] ... [\fIFILES\fR]
 .SH DESCRIPTION
-Run GNU M4 on the FILES, avoiding useless runs.  If tracing, the output
-consists of the traces only, otherwise output the expansion of the FILES.
+Run GNU M4 on the FILES, avoiding useless runs.  Output the traces if tracing,
+the frozen file if freezing, otherwise the expansion of the FILES.
 .PP
 If some of the FILES are named `FILE.m4f' they are considered to be M4
 frozen files of all the previous files (which are therefore not loaded).
@@ -96,6 +96,10 @@ report the MACRO invocations
 .TP
 \fB\-p\fR, \fB\-\-preselect\fR=\fIMACRO\fR
 prepare to trace MACRO in a future run
+.SS "Freezing:"
+.TP
+\fB\-F\fR, \fB\-\-freeze\fR
+produce an M4 frozen state file for FILES
 .SH AUTHOR
 Written by Akim Demaille.
 .PP