Cache variable name for AC_CHECK_LIBS

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

 



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

_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
https://lists.gnu.org/mailman/listinfo/autoconf



[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux