2005-08-20 Ken Raeburn <raeburn@mit.edu>
- * aclocal.m4 (K5_AC_INIT, K5_VERSION, K5_BUGADDR): New macros.
- * configure.in: Use K5_AC_INIT instead of AC_INIT.
+ * aclocal.m4 (K5_AC_INIT, K5_BUGADDR): New macros.
+ (PL_KRB5_MAJOR_RELEASE, PL_KRB5_MINOR_RELEASE, PL_KRB5_PATCHLEVEL,
+ PL_KRB5_RELTAIL): New macros, holding values extracted from
+ patchlevel.h at autoconf time.
+ (K5_VERSION): Define in terms of the PL_* macros.
+ (K5_TOPDIR): If m4exit doesn't work, try builtin(m4exit,1).
+
+ * configure.in: Use K5_AC_INIT instead of AC_INIT. Set
+ KRB5_VERSION from K5_VERSION, don't parse patchlevel.h.
2005-08-16 Ken Raeburn <raeburn@mit.edu>
ifelse(fileexists(../../../aclocal.m4),YES,[../../..],[dnl
ifelse(fileexists(../../../../aclocal.m4),YES,[../../../..],[dnl
errprint(__file__:__line__: Cannot find path to aclocal.m4[
-])m4exit(1)UNKNOWN])])])])]))
+]) m4exit(1) dnl sometimes that does not work?
+builtin(m4exit,1)UNKNOWN])])])])]))
dnl
AC_DEFUN(V5_SET_TOPDIR,[dnl
ac_reltopdir="K5_TOPDIR"
dnl
dnl Version info.
dnl
-define([K5_VERSION],CVS) dnl fix up later
+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)])
fi
dnl
CONFIG_RULES
-dnl
-dnl Determine version from patchlevel.h
-eval `sed -n 's/#define \([A-Z0-9_]*\)[ \t]*\(.*\)/\1=\2/p' < $srcdir/patchlevel.h`
-KRB5_VERSION="$KRB5_MAJOR_RELEASE.$KRB5_MINOR_RELEASE"
-if test "$KRB5_PATCHLEVEL" = 0; then :; else
- KRB5_VERSION="$KRB5_VERSION.$KRB5_PATCHLEVEL"
-fi
-if test -n "$KRB5_RELTAIL"; then
- KRB5_VERSION="$KRB5_VERSION-$KRB5_RELTAIL"
-fi
+KRB5_VERSION=K5_VERSION
AC_SUBST(KRB5_VERSION)
dnl
+dnl
AC_REQUIRE_CPP
dnl
dnl The following lines are so that configure --help gives some global