diff options
Diffstat (limited to 'lib/autoconf')
-rw-r--r-- | lib/autoconf/general.m4 | 23 | ||||
-rw-r--r-- | lib/autoconf/status.m4 | 6 | ||||
-rw-r--r-- | lib/autoconf/trailer.m4 | 4 |
3 files changed, 33 insertions, 0 deletions
diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4 index 4d5f021d..81360b78 100644 --- a/lib/autoconf/general.m4 +++ b/lib/autoconf/general.m4 @@ -1477,9 +1477,32 @@ _AC_ARG_VAR_PRECIOUS([host_alias])AC_SUBST([host_alias])dnl _AC_ARG_VAR_PRECIOUS([target_alias])AC_SUBST([target_alias])dnl dnl AC_LANG_PUSH(C) +dnl +dnl Record that AC_INIT has been called. It doesn't make sense to +dnl AC_REQUIRE AC_INIT, but it _does_ make sense for macros to say +dnl AC_BEFORE([self], [AC_INIT]) sometimes. Also, _AC_FINALIZE checks +dnl for AC_INIT having been called. +m4_provide([AC_INIT])dnl ]) +# _AC_FINALIZE +# ------------ +# Code to be run after the entire configure.ac is processed, but only +# when generating configure. This macro should only be called from +# trailer.m4, which is fed to m4 after configure.ac by autoconf (the +# program). We don't just call m4_wrap([_AC_FINALIZE]), because then +# it would run at freeze time and when tracing configure.ac for +# autoheader etc. +# +# Currently this doesn't emit anything; it just checks that AC_INIT +# and AC_OUTPUT were expanded at some point. Leaving either of these +# out of a configure script is likely to be a bug. +m4_define([_AC_FINALIZE], + [m4_provide_if([AC_INIT], [], + [m4_warn([syntax], [AC_INIT was never used])])dnl + m4_provide_if([AC_OUTPUT], [], + [m4_warn([syntax], [AC_OUTPUT was never used])])]) ## ------------------------------------------------------------- ## diff --git a/lib/autoconf/status.m4 b/lib/autoconf/status.m4 index dd2cb407..2d3f92ba 100644 --- a/lib/autoconf/status.m4 +++ b/lib/autoconf/status.m4 @@ -1310,6 +1310,12 @@ AC_PROVIDE_IFELSE([AC_CONFIG_SUBDIRS], [_AC_OUTPUT_SUBDIRS()])dnl if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then AC_MSG_WARN([unrecognized options: $ac_unrecognized_opts]) fi +dnl +dnl Record that AC_OUTPUT has been called. It doesn't make sense to +dnl AC_REQUIRE AC_OUTPUT, but it _does_ make sense for macros to say +dnl AC_BEFORE([self], [AC_OUTPUT]). Also, _AC_FINALIZE checks +dnl for AC_OUTPUT having been called. +m4_provide([AC_OUTPUT])dnl ])# AC_OUTPUT diff --git a/lib/autoconf/trailer.m4 b/lib/autoconf/trailer.m4 new file mode 100644 index 00000000..7c14cbff --- /dev/null +++ b/lib/autoconf/trailer.m4 @@ -0,0 +1,4 @@ +dnl This file is part of Autoconf. -*- Autoconf -*- +dnl This file exists solely to invoke _AC_FINALIZE at the right time. +dnl See the definition of _AC_FINALIZE (in general.m4) for further explanation. +m4_wrap([_AC_FINALIZE])dnl |