1
0
mirror of https://github.com/lammertb/libhttp.git synced 2025-12-22 04:02:04 +03:00

Support build for Lua 5.1 (for LuaJIT), Lua 5.2 and Lua 5.3 (Step 6/?)

See #195
This commit is contained in:
bel2125
2015-08-23 10:16:36 +02:00
parent 19b7e4d12e
commit e5adc3377d
2 changed files with 31 additions and 4 deletions

View File

@@ -77,13 +77,14 @@ else
LCC = $(CC) LCC = $(CC)
endif endif
ifdef WITH_LUAJIT_SHARED ifdef WITH_LUA_SHARED
WITH_LUA_SHARED = 1
WITH_LUA = 1 WITH_LUA = 1
endif endif
ifdef WITH_LUA_SHARED ifdef WITH_LUAJIT_SHARED
WITH_LUA_SHARED = 1
WITH_LUA = 1 WITH_LUA = 1
WITH_LUA_VERSION = 501
endif endif
ifdef WITH_LUA ifdef WITH_LUA

View File

@@ -9,7 +9,33 @@ ifndef WITH_LUA
$(error WITH_LUA is not defined) $(error WITH_LUA is not defined)
endif endif
LUA_DIR = src/third_party/lua-5.1.5/src # Lua Default version is 502
WITH_LUA_VERSION ?= 502
LUA_VERSION_KNOWN = 0
# Select src and header according to the Lua version
ifeq ($(WITH_LUA_VERSION), 501)
$(info Lua: Using version 5.1.5)
LUA_DIR = src/third_party/lua-5.1.5/src
LUA_VERSION_KNOWN = 1
endif
ifeq ($(WITH_LUA_VERSION), 502)
$(info Lua: Using version 5.2.4)
LUA_DIR = src/third_party/lua-5.2.4/src
LUA_VERSION_KNOWN = 1
endif
ifeq ($(WITH_LUA_VERSION), 503)
$(info Lua: Using version 5.3.0)
LUA_DIR = src/third_party/lua-5.3.0/src
LUA_VERSION_KNOWN = 1
endif
ifneq ($(LUA_VERSION_KNOWN), 1)
$(error Lua: Unknwon version - $(WITH_LUA_VERSION))
endif
# Add flags for all Lua versions
LUA_CFLAGS = -I$(LUA_DIR) -DLUA_COMPAT_ALL -DUSE_LUA LUA_CFLAGS = -I$(LUA_DIR) -DLUA_COMPAT_ALL -DUSE_LUA
ifneq ($(TARGET_OS),WIN32) ifneq ($(TARGET_OS),WIN32)