From: David MacKenzie Date: Tue, 30 Aug 1994 20:24:50 +0000 (+0000) Subject: add freezing to autoheader X-Git-Tag: fsf-origin~488 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5863774fc74c305e1affc2185b8c4fc6d0f9517a;p=thirdparty%2Fautoconf.git add freezing to autoheader --- diff --git a/Makefile.in b/Makefile.in index 62542d840..c2619f508 100644 --- a/Makefile.in +++ b/Makefile.in @@ -52,7 +52,7 @@ SHELL = /bin/sh SUBDIRS = testsuite -M4FILES = autoconf.m4 acgeneral.m4 acoldnames.m4 acspecific.m4 +M4FILES = autoconf.m4 acgeneral.m4 acoldnames.m4 acspecific.m4 autoheader.m4 # Files that can be generated, but should be up to date for a distribution. DISTDEP = info Makefile @@ -129,7 +129,9 @@ installdirs: install: all $(M4FILES) acconfig.h installdirs install-info @case `$(M4) --help < /dev/null 2>&1` in \ - *reload-state*) $(M4) -F $(acdatadir)/autoconf.m4f autoconf.m4 ;; \ + *reload-state*) echo installing frozen m4 files; \ + $(M4) -F $(acdatadir)/autoconf.m4f autoconf.m4 ; \ + $(M4) -F $(acdatadir)/autoheader.m4f autoheader.m4 ;; \ *traditional*) ;; \ *) echo Error: Autoconf requires GNU m4 1.1 or later; exit 1 ;; \ esac diff --git a/acgeneral.m4 b/acgeneral.m4 index edf4abb9f..bba3c8c77 100644 --- a/acgeneral.m4 +++ b/acgeneral.m4 @@ -416,7 +416,8 @@ AC_DEFUN(AC_INIT_BINSH, dnl dnl AC_INIT(UNIQUE-FILE-IN-SOURCE-DIR) AC_DEFUN(AC_INIT, -[sinclude(./aclocal.m4)dnl +[sinclude(acsite.m4)dnl +sinclude(./aclocal.m4)dnl AC_REQUIRE([AC_INIT_BINSH])dnl AC_INIT_NOTICE AC_DIVERT_POP()dnl to NORMAL diff --git a/autoconf.m4 b/autoconf.m4 index 4517dbe53..2b1743559 100644 --- a/autoconf.m4 +++ b/autoconf.m4 @@ -22,5 +22,6 @@ dnl include(acgeneral.m4)dnl builtin(include, acspecific.m4)dnl builtin(include, acoldnames.m4)dnl -sinclude(acsite.m4)dnl +dnl Do not sinclude acsite.m4 here, because it may not be installed +dnl yet when Autoconf is frozen. dnl Do not sinclude ./aclocal.m4 here, to prevent it from being frozen. diff --git a/autoheader.in b/autoheader.in index dc0e6b461..2e28af524 100644 --- a/autoheader.in +++ b/autoheader.in @@ -79,46 +79,6 @@ case $# in *) echo "$usage" >&2; exit 1 ;; esac -# These are the alternate definitions of the acgeneral.m4 macros we want to -# redefine. They produce strings in the output marked with "@@@" so we can -# easily extract the information we want. The `#' at the end of the first -# line of each definition seems to be necessary to prevent m4 from eating -# the newline, which makes the @@@ not always be at the beginning of a line. -frob='define([AC_DEFINE],[# -@@@syms="$syms $1"@@@ -])dnl -define([AC_DEFINE_UNQUOTED],[# -@@@syms="$syms $1"@@@ -])dnl -define([AC_SIZEOF_TYPE],[# -@@@types="$types,$1"@@@ -])dnl -define([AC_CHECK_FUNCS],[# -@@@funcs="$funcs $1"@@@ -])dnl -define([AC_CHECK_HEADERS],[# -@@@headers="$headers $1"@@@ -])dnl -define([AC_CONFIG_HEADER],[# -@@@config_h=$1@@@ -])dnl -define([AC_CHECK_LIB], [# -changequote(/,/)dnl -define(/libname/, dnl -patsubst(patsubst($1, /lib\([^\.]*\)\.a/, /\1/), /-l/, //))dnl -changequote([,])dnl - ifelse([$3], , [ -@@@libs="$libs libname"@@@ -], [ -# If it was found, we do: -$3 -# If it was not found, we do: -$4 -]) -])dnl -dnl -' - config_h=config.h syms= types= @@ -126,11 +86,19 @@ funcs= headers= libs= -# We extract assignments of SYMS, TYPES, FUNCS, HEADERS, and LIBS from the +# Use the frozen version of Autoconf if available. +r= f= +# Some non-GNU m4's don't reject the --help option, so give them /dev/null. +case `$M4 --help < /dev/null 2>&1` in +*reload-state*) test -r $AC_MACRODIR/autoheader.m4f && { r=--reload f=f; } ;; +*traditional*) ;; +*) echo Autoconf requires GNU m4 1.1 or later >&2; rm -f $tmpin; exit 1 ;; +esac + +# Extract assignments of SYMS, TYPES, FUNCS, HEADERS, and LIBS from the # modified autoconf processing of the input file. The sed hair is # necessary to win for multi-line macro invocations. -eval "`echo \"$frob\" | - $M4 -I$AC_MACRODIR $print_version autoconf.m4 - $infile | +eval "`$M4 -I$AC_MACRODIR $print_version $r autoheader.m4$f $infile | sed -n -e ' : again /^@@@.*@@@$/s/^@@@\(.*\)@@@$/\1/p diff --git a/autoheader.sh b/autoheader.sh index dc0e6b461..2e28af524 100644 --- a/autoheader.sh +++ b/autoheader.sh @@ -79,46 +79,6 @@ case $# in *) echo "$usage" >&2; exit 1 ;; esac -# These are the alternate definitions of the acgeneral.m4 macros we want to -# redefine. They produce strings in the output marked with "@@@" so we can -# easily extract the information we want. The `#' at the end of the first -# line of each definition seems to be necessary to prevent m4 from eating -# the newline, which makes the @@@ not always be at the beginning of a line. -frob='define([AC_DEFINE],[# -@@@syms="$syms $1"@@@ -])dnl -define([AC_DEFINE_UNQUOTED],[# -@@@syms="$syms $1"@@@ -])dnl -define([AC_SIZEOF_TYPE],[# -@@@types="$types,$1"@@@ -])dnl -define([AC_CHECK_FUNCS],[# -@@@funcs="$funcs $1"@@@ -])dnl -define([AC_CHECK_HEADERS],[# -@@@headers="$headers $1"@@@ -])dnl -define([AC_CONFIG_HEADER],[# -@@@config_h=$1@@@ -])dnl -define([AC_CHECK_LIB], [# -changequote(/,/)dnl -define(/libname/, dnl -patsubst(patsubst($1, /lib\([^\.]*\)\.a/, /\1/), /-l/, //))dnl -changequote([,])dnl - ifelse([$3], , [ -@@@libs="$libs libname"@@@ -], [ -# If it was found, we do: -$3 -# If it was not found, we do: -$4 -]) -])dnl -dnl -' - config_h=config.h syms= types= @@ -126,11 +86,19 @@ funcs= headers= libs= -# We extract assignments of SYMS, TYPES, FUNCS, HEADERS, and LIBS from the +# Use the frozen version of Autoconf if available. +r= f= +# Some non-GNU m4's don't reject the --help option, so give them /dev/null. +case `$M4 --help < /dev/null 2>&1` in +*reload-state*) test -r $AC_MACRODIR/autoheader.m4f && { r=--reload f=f; } ;; +*traditional*) ;; +*) echo Autoconf requires GNU m4 1.1 or later >&2; rm -f $tmpin; exit 1 ;; +esac + +# Extract assignments of SYMS, TYPES, FUNCS, HEADERS, and LIBS from the # modified autoconf processing of the input file. The sed hair is # necessary to win for multi-line macro invocations. -eval "`echo \"$frob\" | - $M4 -I$AC_MACRODIR $print_version autoconf.m4 - $infile | +eval "`$M4 -I$AC_MACRODIR $print_version $r autoheader.m4$f $infile | sed -n -e ' : again /^@@@.*@@@$/s/^@@@\(.*\)@@@$/\1/p diff --git a/bin/autoheader.in b/bin/autoheader.in index dc0e6b461..2e28af524 100644 --- a/bin/autoheader.in +++ b/bin/autoheader.in @@ -79,46 +79,6 @@ case $# in *) echo "$usage" >&2; exit 1 ;; esac -# These are the alternate definitions of the acgeneral.m4 macros we want to -# redefine. They produce strings in the output marked with "@@@" so we can -# easily extract the information we want. The `#' at the end of the first -# line of each definition seems to be necessary to prevent m4 from eating -# the newline, which makes the @@@ not always be at the beginning of a line. -frob='define([AC_DEFINE],[# -@@@syms="$syms $1"@@@ -])dnl -define([AC_DEFINE_UNQUOTED],[# -@@@syms="$syms $1"@@@ -])dnl -define([AC_SIZEOF_TYPE],[# -@@@types="$types,$1"@@@ -])dnl -define([AC_CHECK_FUNCS],[# -@@@funcs="$funcs $1"@@@ -])dnl -define([AC_CHECK_HEADERS],[# -@@@headers="$headers $1"@@@ -])dnl -define([AC_CONFIG_HEADER],[# -@@@config_h=$1@@@ -])dnl -define([AC_CHECK_LIB], [# -changequote(/,/)dnl -define(/libname/, dnl -patsubst(patsubst($1, /lib\([^\.]*\)\.a/, /\1/), /-l/, //))dnl -changequote([,])dnl - ifelse([$3], , [ -@@@libs="$libs libname"@@@ -], [ -# If it was found, we do: -$3 -# If it was not found, we do: -$4 -]) -])dnl -dnl -' - config_h=config.h syms= types= @@ -126,11 +86,19 @@ funcs= headers= libs= -# We extract assignments of SYMS, TYPES, FUNCS, HEADERS, and LIBS from the +# Use the frozen version of Autoconf if available. +r= f= +# Some non-GNU m4's don't reject the --help option, so give them /dev/null. +case `$M4 --help < /dev/null 2>&1` in +*reload-state*) test -r $AC_MACRODIR/autoheader.m4f && { r=--reload f=f; } ;; +*traditional*) ;; +*) echo Autoconf requires GNU m4 1.1 or later >&2; rm -f $tmpin; exit 1 ;; +esac + +# Extract assignments of SYMS, TYPES, FUNCS, HEADERS, and LIBS from the # modified autoconf processing of the input file. The sed hair is # necessary to win for multi-line macro invocations. -eval "`echo \"$frob\" | - $M4 -I$AC_MACRODIR $print_version autoconf.m4 - $infile | +eval "`$M4 -I$AC_MACRODIR $print_version $r autoheader.m4$f $infile | sed -n -e ' : again /^@@@.*@@@$/s/^@@@\(.*\)@@@$/\1/p diff --git a/doc/Makefile.in b/doc/Makefile.in index 62542d840..c2619f508 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -52,7 +52,7 @@ SHELL = /bin/sh SUBDIRS = testsuite -M4FILES = autoconf.m4 acgeneral.m4 acoldnames.m4 acspecific.m4 +M4FILES = autoconf.m4 acgeneral.m4 acoldnames.m4 acspecific.m4 autoheader.m4 # Files that can be generated, but should be up to date for a distribution. DISTDEP = info Makefile @@ -129,7 +129,9 @@ installdirs: install: all $(M4FILES) acconfig.h installdirs install-info @case `$(M4) --help < /dev/null 2>&1` in \ - *reload-state*) $(M4) -F $(acdatadir)/autoconf.m4f autoconf.m4 ;; \ + *reload-state*) echo installing frozen m4 files; \ + $(M4) -F $(acdatadir)/autoconf.m4f autoconf.m4 ; \ + $(M4) -F $(acdatadir)/autoheader.m4f autoheader.m4 ;; \ *traditional*) ;; \ *) echo Error: Autoconf requires GNU m4 1.1 or later; exit 1 ;; \ esac diff --git a/lib/autoconf/autoconf.m4 b/lib/autoconf/autoconf.m4 index 4517dbe53..2b1743559 100644 --- a/lib/autoconf/autoconf.m4 +++ b/lib/autoconf/autoconf.m4 @@ -22,5 +22,6 @@ dnl include(acgeneral.m4)dnl builtin(include, acspecific.m4)dnl builtin(include, acoldnames.m4)dnl -sinclude(acsite.m4)dnl +dnl Do not sinclude acsite.m4 here, because it may not be installed +dnl yet when Autoconf is frozen. dnl Do not sinclude ./aclocal.m4 here, to prevent it from being frozen. diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4 index edf4abb9f..bba3c8c77 100644 --- a/lib/autoconf/general.m4 +++ b/lib/autoconf/general.m4 @@ -416,7 +416,8 @@ AC_DEFUN(AC_INIT_BINSH, dnl dnl AC_INIT(UNIQUE-FILE-IN-SOURCE-DIR) AC_DEFUN(AC_INIT, -[sinclude(./aclocal.m4)dnl +[sinclude(acsite.m4)dnl +sinclude(./aclocal.m4)dnl AC_REQUIRE([AC_INIT_BINSH])dnl AC_INIT_NOTICE AC_DIVERT_POP()dnl to NORMAL