Re: Cache variable name for AC_CHECK_LIBS
Bert Wesarg <[email protected]>
| Newsgroups | gmane.comp.sysutils.autoconf.bugs |
|---|---|
| Message-ID | <CAKPyHN31ZhpO+WC19jUcEVZhjmVeKcjTfA39pamGEQ0a1aoenw@mail.gmail.com> |
No reaction since 3.5 years. Bug still persists. On Mon, Apr 25, 2016 at 8:48 PM Bert Wesarg <[email protected]> wrote: > > Dear Autotconf developers, > > I just realized, that the cache variable name for AC_CHECK_LIBS does > not conform to the documented one if AS_LITERAL_WORD_IF fails for the > library name. I.e., One uses AC_CHECK_LIBS with a variable name for > its first argument: > > libname=foo > AC_CHECK_LIBS([$libname], [init_foo]) > > The full part in AC_CHECK_LIBS is this: > > AS_LITERAL_WORD_IF([$1], > [AS_VAR_PUSHDEF([ac_Lib], [ac_cv_lib_$1_$2])], > [AS_VAR_PUSHDEF([ac_Lib], [ac_cv_lib_$1''_$2])])dnl > > The second AS_VAR_PUSHDEF now expands to this: > > as_ac_Lib=`$as_echo "ac_cv_lib_$libname''_init_foo" | $as_tr_sh` > > Which results in the value of $as_ac_Lib > > ac_cv_lib_foo___init_foo > > Though the expected and documented variable name is > > ac_cv_lib_foo_init_foo > > The reason for the different name is the use of the two single-quotes > in the AS_VAR_PUSHDEF call, which is there to ensure, that the passed > '$lib' value stopped before the '_'. But as the whole variable is > passed in double-quotes to '$as_echo' the two single-quotes survive > the echo and will than be translated to underscores by '$as_tr_sh'. > > Any advice on how to fix this in Autoconf? > > Best, > Bert