On 12/23/20 4:51 PM, Mart Raudsepp wrote:
Ühel kenal päeval, K, 23.12.2020 kell 07:49, kirjutas Michael Orlitzky:
    AC_SEARCH_LIBS([whatever], [lua], [lua_found="yes"])

How do I pass the name "lua5.2" to that, without hacking configure.ac
and running autoreconf? The only option that comes to mind is to
build
the entire project with LIBS="-llua5.2", but that's not right if only
some of the executables are supposed to be linked with lua.

You either fix upstream to use pkg-config, or you set up the cache
variable for your configure call to tell configure what the answer is,
without making it do the work wrong.

Using pkg-config has a related problem. If lua-5.1 is eselected and if the upstream build system runs $(pkg-config ... lua), it's going to get the information for lua-5.1, even if you're trying to build against lua-5.2. So, first I have to patch upstream to use pkg-config, and then I have to hack it in Gentoo to avoid using pkg-config.

Overriding the cached check variable does work, but you have to override every single call to AC_SEARCH_LIBS(function...) with ac_cv_search_<function> which depends highly on the implementation details of configure.ac. This is roughly as invasive and hard to maintain as patching, and should just not be the default way to link against a library IMO.

Reply via email to