]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
(AC_PREREQ): New macro, with some helper macros.
authorDavid MacKenzie <djm@djmnet.org>
Thu, 24 Mar 1994 18:36:13 +0000 (18:36 +0000)
committerDavid MacKenzie <djm@djmnet.org>
Thu, 24 Mar 1994 18:36:13 +0000 (18:36 +0000)
acgeneral.m4
lib/autoconf/general.m4

index b4f6494eaa0b054aa2b569f5c6a4264e4d7e6344..b42e42cec685bbaf390fd224ccb3ef8851d49099 100644 (file)
@@ -27,13 +27,13 @@ undefine([shift])dnl
 undefine([format])dnl
 dnl
 ifdef([__gnu__], , [errprint(Autoconf requires GNU m4
-)exit(1)])dnl
+)m4exit(2)])dnl
 dnl
 dnl
 dnl Utility functions for stamping the configure script.
 dnl
 dnl
-define(AC_ACVERSION, 1.7.5)dnl
+define(AC_ACVERSION, 1.7.6)dnl
 dnl This is defined by the --version option of the autoconf script.
 ifdef([AC_PRINT_VERSION], [errprint(Autoconf version AC_ACVERSION
 )])dnl
@@ -285,6 +285,28 @@ define(AC_DOREV, [#!/bin/sh
 ])dnl
 define(AC_REVISION, [AC_DOREV(translit($1,$"))])dnl
 dnl
+dnl Subroutines of AC_PREREQ.
+dnl
+dnl Change the dots in version number $1 into commas.
+define(AC_PREREQ_SPLIT, [translit($1,.,[,])])dnl
+dnl
+dnl Default the ternary version number to 0 (e.g., 1,7 -> 1,7,0).
+define(AC_PREREQ_CANON, [$1,$2,ifelse([$3],,0,[$3])])dnl
+dnl
+dnl Complain and exit if the version number in $1 through $3 is less than
+dnl the version number in $4 through $6.
+dnl $7 is the printable version of the second version number.
+define(AC_PREREQ_COMPARE,
+[ifelse(builtin([eval],
+[$3 + $2 * 100 + $1 * 10000 < $6 + $5 * 100 + $4 * 10000]),1,
+[errprint(Autoconf version $7 or higher is required
+)m4exit(3)])])dnl
+dnl
+dnl Complain if the Autoconf version is less than $1.
+define(AC_PREREQ,
+[AC_PREREQ_COMPARE(AC_PREREQ_CANON(AC_PREREQ_SPLIT(AC_ACVERSION)),
+AC_PREREQ_CANON(AC_PREREQ_SPLIT([$1])),[$1])])dnl
+dnl
 dnl
 dnl Setting variables
 dnl
index b4f6494eaa0b054aa2b569f5c6a4264e4d7e6344..b42e42cec685bbaf390fd224ccb3ef8851d49099 100644 (file)
@@ -27,13 +27,13 @@ undefine([shift])dnl
 undefine([format])dnl
 dnl
 ifdef([__gnu__], , [errprint(Autoconf requires GNU m4
-)exit(1)])dnl
+)m4exit(2)])dnl
 dnl
 dnl
 dnl Utility functions for stamping the configure script.
 dnl
 dnl
-define(AC_ACVERSION, 1.7.5)dnl
+define(AC_ACVERSION, 1.7.6)dnl
 dnl This is defined by the --version option of the autoconf script.
 ifdef([AC_PRINT_VERSION], [errprint(Autoconf version AC_ACVERSION
 )])dnl
@@ -285,6 +285,28 @@ define(AC_DOREV, [#!/bin/sh
 ])dnl
 define(AC_REVISION, [AC_DOREV(translit($1,$"))])dnl
 dnl
+dnl Subroutines of AC_PREREQ.
+dnl
+dnl Change the dots in version number $1 into commas.
+define(AC_PREREQ_SPLIT, [translit($1,.,[,])])dnl
+dnl
+dnl Default the ternary version number to 0 (e.g., 1,7 -> 1,7,0).
+define(AC_PREREQ_CANON, [$1,$2,ifelse([$3],,0,[$3])])dnl
+dnl
+dnl Complain and exit if the version number in $1 through $3 is less than
+dnl the version number in $4 through $6.
+dnl $7 is the printable version of the second version number.
+define(AC_PREREQ_COMPARE,
+[ifelse(builtin([eval],
+[$3 + $2 * 100 + $1 * 10000 < $6 + $5 * 100 + $4 * 10000]),1,
+[errprint(Autoconf version $7 or higher is required
+)m4exit(3)])])dnl
+dnl
+dnl Complain if the Autoconf version is less than $1.
+define(AC_PREREQ,
+[AC_PREREQ_COMPARE(AC_PREREQ_CANON(AC_PREREQ_SPLIT(AC_ACVERSION)),
+AC_PREREQ_CANON(AC_PREREQ_SPLIT([$1])),[$1])])dnl
+dnl
 dnl
 dnl Setting variables
 dnl