]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Make configure.ac work with autoconf 2.73 master 1485/head
authorSamuel Cabrero <scabrero@suse.com>
Tue, 17 Feb 2026 15:57:40 +0000 (16:57 +0100)
committerGreg Hudson <ghudson@mit.edu>
Mon, 13 Apr 2026 23:10:47 +0000 (19:10 -0400)
autoreconf requires "AC_INIT" to appear in configure.ac.  Prior to
autoconf 2.73, our indirect invocation via K5_AC_INIT() was
sufficient, but now the regular expression match checks for word
boundaries.  Get rid of K5_AC_INIT(), moving the version extraction
code from aclocal.m4 to a new file version.m4.  In the moved
versioning code, use m4_fatal() to simplify error handling.

[ghudson@mit.edu: made the m4_fatal() change; rewrote commit message]

ticket: 9202 (new)

src/aclocal.m4
src/configure.ac
src/version.m4 [new file with mode: 0644]

index bd75a8d7323b0b5b52c42abb8902b670c79c1485..f6dc817bfbf0abee478c80047f4ad0520177f02c 100644 (file)
@@ -16,30 +16,6 @@ ac_config_fragdir=$ac_reltopdir/config
 AC_CONFIG_AUX_DIR(K5_TOPDIR/config)
 ])dnl
 dnl
-dnl Version info.
-dnl
-pushdef([x],esyscmd([sed -n 's/#define \([A-Z0-9_]*\)[ \t]*\(.*\)/\1=\2/p' < ]K5_TOPDIR/patchlevel.h))
-define([PL_KRB5_MAJOR_RELEASE],regexp(x,[KRB5_MAJOR_RELEASE=\(.*\)],[\1]))
-ifelse(PL_KRB5_MAJOR_RELEASE,,[errprint([Can't determine KRB5_MAJOR_RELEASE value from patchlevel.h.
-]) m4exit(1) dnl sometimes that does not work?
-builtin(m4exit,1)])
-define([PL_KRB5_MINOR_RELEASE],regexp(x,[KRB5_MINOR_RELEASE=\(.*\)],[\1]))
-ifelse(PL_KRB5_MINOR_RELEASE,,[errprint([Can't determine KRB5_MINOR_RELEASE value from patchlevel.h.
-]) m4exit(1) dnl sometimes that does not work?
-builtin(m4exit,1)])
-define([PL_KRB5_PATCHLEVEL],regexp(x,[KRB5_PATCHLEVEL=\(.*\)],[\1]))
-ifelse(PL_KRB5_PATCHLEVEL,,[errprint([Can't determine KRB5_PATCHLEVEL value from patchlevel.h.
-]) m4exit(1) dnl sometimes that does not work?
-builtin(m4exit,1)])
-define([PL_KRB5_RELTAIL],regexp(x,[KRB5_RELTAIL="\(.*\)"],[\1]))
-dnl RELTAIL is allowed to not be defined.
-popdef([x])
-define([K5_VERSION],PL_KRB5_MAJOR_RELEASE.PL_KRB5_MINOR_RELEASE[]ifelse(PL_KRB5_PATCHLEVEL,0,,.PL_KRB5_PATCHLEVEL)ifelse(PL_KRB5_RELTAIL,,,-PL_KRB5_RELTAIL))
-define([K5_BUGADDR],krb5-bugs@mit.edu)
-define([K5_AC_INIT],[AC_INIT(Kerberos 5, K5_VERSION, K5_BUGADDR, krb5)
-AC_CONFIG_SRCDIR($1)
-build_dynobj=no])
-dnl
 dnl drop in standard rules for all configure files -- CONFIG_RULES
 dnl
 AC_DEFUN(CONFIG_RULES,[dnl
index ed67245018b22afdae365fb584a4ff665360fa27..f1cbe4b13ccd294f7a7b515aa9a6b33e5deb17db 100644 (file)
@@ -1,4 +1,6 @@
-K5_AC_INIT([aclocal.m4])
+m4_include([version.m4])
+AC_INIT(Kerberos 5, K5_VERSION, K5_BUGADDR, krb5)
+AC_CONFIG_SRCDIR([aclocal.m4])
 
 # If $runstatedir isn't set by autoconf (<2.70), set it manually.
 if test x"$runstatedir" = x; then
diff --git a/src/version.m4 b/src/version.m4
new file mode 100644 (file)
index 0000000..4b08edd
--- /dev/null
@@ -0,0 +1,14 @@
+define([K5_TOPDIR],[.])dnl
+dnl
+pushdef([x],esyscmd([sed -n 's/#define \([A-Z0-9_]*\)[ \t]*\(.*\)/\1=\2/p' < ]K5_TOPDIR/patchlevel.h))
+define([PL_KRB5_MAJOR_RELEASE],regexp(x,[KRB5_MAJOR_RELEASE=\(.*\)],[\1]))
+ifelse(PL_KRB5_MAJOR_RELEASE,,[m4_fatal([Can't determine KRB5_MAJOR_RELEASE value from patchlevel.h.])])
+define([PL_KRB5_MINOR_RELEASE],regexp(x,[KRB5_MINOR_RELEASE=\(.*\)],[\1]))
+ifelse(PL_KRB5_MINOR_RELEASE,,[m4_fatal([Can't determine KRB5_MINOR_RELEASE value from patchlevel.h.])])
+define([PL_KRB5_PATCHLEVEL],regexp(x,[KRB5_PATCHLEVEL=\(.*\)],[\1]))
+ifelse(PL_KRB5_PATCHLEVEL,,[m4_fatal([Can't determine KRB5_PATCHLEVEL value from patchlevel.h.])])
+define([PL_KRB5_RELTAIL],regexp(x,[KRB5_RELTAIL="\(.*\)"],[\1]))
+dnl RELTAIL is allowed to not be defined.
+popdef([x])
+m4_define([K5_VERSION],PL_KRB5_MAJOR_RELEASE.PL_KRB5_MINOR_RELEASE[]ifelse(PL_KRB5_PATCHLEVEL,0,,.PL_KRB5_PATCHLEVEL)ifelse(PL_KRB5_RELTAIL,,,-PL_KRB5_RELTAIL))
+m4_define([K5_BUGADDR],krb5-bugs@mit.edu)