* aclocal.m4 (PL_KRB5_MAJOR_RELEASE, PL_KRB5_MINOR_RELEASE, PL_KRB5_PATCHLEVEL,
authorKen Raeburn <raeburn@mit.edu>
Sat, 20 Aug 2005 08:26:36 +0000 (08:26 +0000)
committerKen Raeburn <raeburn@mit.edu>
Sat, 20 Aug 2005 08:26:36 +0000 (08:26 +0000)
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: Set KRB5_VERSION from K5_VERSION, don't parse patchlevel.h.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17343 dc483132-0cff-0310-8789-dd5450dbe970

src/ChangeLog
src/aclocal.m4
src/configure.in

index 5def3494cd862a11e7d5ba3c06417f6383fc98df..b2af644efbad0b822a3dc54cdd45c236eb6c2139 100644 (file)
@@ -1,7 +1,14 @@
 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>
 
index 67c6e970cd55080d472d232f9070393364f3f6f1..c02426bcb72cc9ed1db2ffe787e3acae0cf5b93a 100644 (file)
@@ -21,7 +21,8 @@ ifelse(fileexists(../../aclocal.m4),YES,[../..],[dnl
 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"
@@ -42,7 +43,23 @@ fi
 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)])
index 5b79986b6e6da4dacbcfa0ac37b567fb3dc1b00f..5efb8c0bc8d0038664a1dfaa874ed409f266a817 100644 (file)
@@ -8,18 +8,10 @@ if test "x$cache_file" = "x/dev/null"; then
 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