summaryrefslogtreecommitdiffstats
path: root/src/Makefile
diff options
context:
space:
mode:
authorRobin Stern <robinstern1290@gmail.com>2021-03-22 21:23:56 -0700
committerRobin Stern <robinstern1290@gmail.com>2021-03-22 21:23:56 -0700
commitda2c08799d4e0dab7a37f1df23245d6cf620ae49 (patch)
tree29171ad9b784c6d787c0c7d2b96b9d674060dc17 /src/Makefile
parenteb71c73868520db7fcd707698cbbe2a23d773c90 (diff)
Enabled higher versisons of lua by making compile independent of user's lua version. Now version to link to is not hard-coded, so it sc-im will link to whatever lua version user has installed as their default lua. If lua is not found, Makefile then checks for luajit & links to luajit instead. Given lua is checked before luajit, newer compiles will always link to latest version of lua user installs, this is what most users would care about. For advanced users who care about high-performance of luaJIT & do not mind keeping their code compliant to Lua 5.1 & have both lua+luaJIT installed on their machines, they can comment part of Makefile (or remove lua from pkg-config path) to force sc-im to link to luaJIT.
Diffstat (limited to 'src/Makefile')
-rwxr-xr-xsrc/Makefile18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/Makefile b/src/Makefile
index fadf0b5..5bea05b 100755
--- a/src/Makefile
+++ b/src/Makefile
@@ -135,15 +135,19 @@ ifneq (, $(shell which pkg-config))
endif
# NOTE: lua support
- ifneq ($(shell pkg-config --exists lua51 || echo 'no'),no)
- CFLAGS += -DXLUA $(shell pkg-config --cflags lua51)
- LDLIBS += $(shell pkg-config --libs lua51) -Wl,--export-dynamic
- else ifneq ($(shell pkg-config --exists lua-5.1 || echo 'no'),no) # FreeBSD
- CFLAGS += -DXLUA $(shell pkg-config --cflags lua-5.1)
+ ifneq ($(shell pkg-config --exists lua || echo 'no'),no) # Check for user's default lua
+ CFLAGS += -DXLUA $(shell pkg-config --cflags lua)
ifneq ($(shell uname -s),Darwin)
- LDLIBS += $(shell pkg-config --libs lua-5.1) -Wl,--export-dynamic
+ LDLIBS += $(shell pkg-config --libs lua) -Wl,--export-dynamic
else
- LDLIBS += $(shell pkg-config --libs lua-5.1) -rdynamic
+ LDLIBS += $(shell pkg-config --libs lua) -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)
+ ifneq ($(shell uname -s),Darwin)
+ LDLIBS += $(shell pkg-config --libs luajit) -Wl,--export-dynamic
+ else
+ LDLIBS += $(shell pkg-config --libs luajit) -rdynamic
endif
endif
else ifeq ($(shell uname -s),Darwin)