trusteddomainproject / OpenDKIM

Other
97 stars 52 forks source link

wrong pkg-config check for lua #62

Closed orlitzky closed 4 years ago

orlitzky commented 4 years ago

In confgure.ac we have among other things...

PKG_CHECK_MODULES([LIBLUA], [lua5.1],
    [
    lua_found="yes"
    LIBLUA_INCDIRS="$LIBLUA_CFLAGS"
    ],
    [AC_MSG_WARN([pkg-config for Lua not found, trying manual search...])])

The upstream pkg-config file is named lua.pc, so lua5.1 is the wrong name unless some distros have renamed it. Either way we should check for lua, but maybe we should also check for lua5.1 if someone knows why lua5.1 is there in the first place.

When the pkg-config check fails, the manual search looks first to /usr/lib which can detect 32-bit libs on a 64-bit system (Gentoo bug 704556).

martinbogo commented 4 years ago

We must check for lua5.1 in accordance with the package naming conventions used by the Linux Standard Base and package naming conventions. Just checking for "lua" is too broad. This will likely need to be something patched specifically in Gentoo as a downstream as it does not have an impact on the other distributions ( Debian / Ubuntu / Fedora / CentOS )

orlitzky commented 4 years ago

It doesn't affect the other distributions because they don't build OpenDKIM from source, it's still nonsense =)

The PKG_CHECK_MODULES call is looking for the name of a *.pc file, and has nothing to do with the name of the package in LSB. What name is Lua's pkg-config file installed with? Upstream (and on Gentoo), it's lua.pc, so we need to invoke the macro with "lua" and not "lua5.1" because using "lua5.1" would look for a nonexistent lua5.1.pc. You may want to leave the lua5.1 check there if you're superstitious, but it's pretty easy to verify that OpenDKIM can't detect upstream lua out of the box because the pkg-config check fails.