[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AC_INIT behaves confusingly with an empty version argument

From: Tim Cuthbertson
Subject: AC_INIT behaves confusingly with an empty version argument
Date: Sat, 7 Feb 2015 23:33:57 +1100

The fish-shell[0] configure.ac file contains the following call:

        m4_esyscmd([cut -f 3 -d ' ' FISH-BUILD-VERSION-FILE | tr -d '\n']),

Under certain circumstances (an unrelated bug), the second (version)
argument can end up being the empty string.

This is obviously not ideal use, but autoconf lets it go way too far.

Seeing that the second arg is empty, it treats the call as if it were
just AC_INIT(fish), an undocumented variant of the function which was
apparently deprecated over a decade ago[1]. This produces a
dramatically different ./configure script which fails because it can't
find a file named "fish" (as $ac_unique_file), which doesn't resemble
the real problem at all.

Rather than simply testing for an empty second argument, it would be
more correct to check the number of arguments- i.e if $# equals 1, act
like the old API. Otherwise, autoconf should act like the new API
(with an error reported for an empty version string, if that's a
required argument).

 - Tim.

[0]: https://github.com/fish-shell/fish-shell
[1]: http://stackoverflow.com/a/17664203/144135

reply via email to

[Prev in Thread] Current Thread [Next in Thread]