summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrés <andmarti@gmail.com>2023-08-05 11:48:29 -0300
committerAndrés <andmarti@gmail.com>2023-08-05 11:48:29 -0300
commit74ce4e84b985203f85906ae799d9ae5663817f43 (patch)
tree6bbf00348e72e66428582234aa5aabadf8e7b318
parent89791b53ea311c0ca2ec2a116c0b35d1b30da08d (diff)
parent5c2e0a19e26a99e899751f72f9715fd35f3131eb (diff)
Merge branch 'pr-773' into dev
-rwxr-xr-xsrc/Makefile9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Makefile b/src/Makefile
index defd77a..0915f41 100755
--- a/src/Makefile
+++ b/src/Makefile
@@ -134,12 +134,13 @@ ifneq (, $(shell which pkg-config))
endif
# NOTE: lua support
- ifneq ($(shell pkg-config --exists lua || echo 'no'),no) # Check for user's default lua
- CFLAGS += -DXLUA $(shell pkg-config --cflags lua)
+ LUA_PKGNAME ?= $(shell pkg-config --list-all | awk '/^lua-?[0-9.]+[[:space:]]/ { p=$$1; gsub("[^[0-9]", "", p); print p " " $$1; }' | LC_ALL=C sort -nrk1 | uniq | head -n 1 | awk '{print $$2}')
+ ifneq ($(LUA_PKGNAME),)
+ CFLAGS += -DXLUA $(shell pkg-config --cflags $(LUA_PKGNAME))
ifneq ($(shell uname -s),Darwin)
- LDLIBS += $(shell pkg-config --libs lua) -Wl,--export-dynamic
+ LDLIBS += $(shell pkg-config --libs $(LUA_PKGNAME)) -Wl,--export-dynamic
else
- LDLIBS += $(shell pkg-config --libs lua) -rdynamic
+ LDLIBS += $(shell pkg-config --libs $(LUA_PKGNAME)) -rdynamic
endif
else ifneq ($(shell pkg-config --exists luajit || echo 'no'),no) # If not found, check for luajit
CFLAGS += -DXLUA $(shell pkg-config --cflags luajit)