]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUILD: makefile/lua: use the system's default library before all other variants
authorWilly Tarreau <w@1wt.eu>
Tue, 2 Jun 2026 14:34:37 +0000 (16:34 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 2 Jun 2026 15:13:20 +0000 (17:13 +0200)
commit99936889540a62aad41a80e1f57b478b271ed899
tree045dbfbd2be01f22c66fe3bfe698794a13b1a066
parentcb161bfeb74f79981359f054f043903282cfe4a8
BUILD: makefile/lua: use the system's default library before all other variants

The recent update to the makefile in commit bfbca23dc2 ("BUILD: makefile:
search for Lua 5.5 as well") to enable searching for Lua 5.5 revealed a
problem by which we were using the fallback versions before the main one
(e.g. /usr/include/lua-5.4/lua.h before /usr/include/lua.h). However, the
libs often contain the version in their name so that we can end up linking
with 5.5 while 5.4 was used in the include.

This was detected only when enabling lua 5.5 because in Lua 5.4
"luaL_openlibs()" was a symbol and became an inline in 5.5, preventing
from using a mix of the two versions.

The current change is minimal in that it skips all fallbacks when lua.h
is present in /usr/include, and includes it in the test to make sure that
the directory found contains valid C. LUA_LIB checks for lua before the
variants so as to remain consistent with the system provided version.

Thanks to @gene-git for reporting this problem in GH issue #3404.

This may have to be backported after a period of observation if users
face build issues for older releases on newer distros. In this case,
backporting 1c0f781994 ("MINOR: hlua: Add support for lua 5.5") would
equally be needed. However this will result in the system's version
being used first, which may or may not be desired.
Makefile