Fix build errors with multiple Lua libraries #2718
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit fixes two items:
configure
would search for Lua in known paths, butthis could cause the Makefile to use inconsistent header and library
paths. For example, if luajit were installed in
/usr/local/include
but lua 5.1 were installed in
/usr/lib/liblua-5.1.so
, the buildwould attempt to use the luajit headers but link against the lua 5.1
library.
To fix this, we switch the order of the search:
pkg-config
.scan.
This is actually what is already documented in
LUA_POSSIBLE_PATHS
.Note that
PKG_CONFIG_PATH
can be specified inconfigure
to look in the right path:LUA_POSSIBLE_LIB_NAMES
. This was added in0ac23a4 but quietly reverted in fe98ce4. The changes in the first
item also ensure the
CFLAGS
are set properly for luajit.This should fix the issues raised in #1909.