Hello, Alexandre!

> Since we already have the machinery to compare autoconf versions,
> given AC_PREREQ, why not use it to offer an additional primitive such
> as AC_VERSION_CASE(VERSION, CMD, [VERSION, CMD, ...][, CMD])
>
> The pairs VERSION, CMD should have versions in decreasing order.  I

Exactly! No comparison operators. AC_PREREQ succeedes - Ok, no - move on
to the next pair.

AC_VERSION_CASE([3.0], [Action1],
                [2.51], [Action2],
                [2.50], [AC_MSG_ERROR([Out of luck!])],
                [0], [AC_MSG_ERROR([You should never see it!])])

I understand Akim's feelings about backward compatibility, but this macro
can be documented as potentially dangerous, say:

AC_VERSION_CASE should only be used if you absolutely must support more
than one version of Autoconf. In most cases it's better that you stick
with the latest released version of Autoconf.

Regards,
Pavel Roskin


Reply via email to