python-dataproperty: bump version to 0.17.0
[buildroot-gz.git] / package / lua / lua.mk
blob5ef61e039e3653a9d79ab9b2aefae215dfcb3644
1 ################################################################################
3 # lua
5 ################################################################################
7 ifeq ($(BR2_PACKAGE_LUA_5_3),y)
8 LUA_VERSION = 5.3.4
9 else
10 ifeq ($(BR2_PACKAGE_LUA_5_2),y)
11 LUA_VERSION = 5.2.4
12 else
13 LUA_VERSION = 5.1.5
14 endif
15 endif
16 LUA_SITE = http://www.lua.org/ftp
17 LUA_INSTALL_STAGING = YES
18 LUA_LICENSE = MIT
19 ifeq ($(BR2_PACKAGE_LUA_5_1),y)
20 LUA_LICENSE_FILES = COPYRIGHT
21 else
22 LUA_LICENSE_FILES = doc/readme.html
23 endif
25 LUA_PROVIDES = luainterpreter
27 LUA_CFLAGS = -Wall -fPIC -DLUA_USE_POSIX
29 ifeq ($(BR2_PACKAGE_LUA_5_2),y)
30 LUA_CFLAGS += -DLUA_COMPAT_ALL
31 endif
33 ifeq ($(BR2_PACKAGE_LUA_5_3),y)
34 LUA_CFLAGS += -DLUA_COMPAT_5_2
35 endif
37 ifeq ($(BR2_STATIC_LIBS),y)
38 LUA_BUILDMODE = static
39 else
40 LUA_BUILDMODE = dynamic
41 LUA_CFLAGS += -DLUA_USE_DLOPEN
42 LUA_MYLIBS += -ldl
43 endif
45 ifeq ($(BR2_PACKAGE_LUA_READLINE),y)
46 LUA_DEPENDENCIES = readline ncurses
47 LUA_MYLIBS += -lreadline -lhistory -lncurses
48 LUA_CFLAGS += -DLUA_USE_READLINE
49 else
50 ifeq ($(BR2_PACKAGE_LUA_LINENOISE),y)
51 LUA_DEPENDENCIES = linenoise
52 LUA_MYLIBS += -llinenoise
53 LUA_CFLAGS += -DLUA_USE_LINENOISE
54 endif
55 endif
57 ifeq ($(BR2_PACKAGE_LUA_32BITS),y)
58 define LUA_32BITS_LUACONF
59 $(SED) 's/\/\* #define LUA_32BITS \*\//#define LUA_32BITS/' $(@D)/src/luaconf.h
60 endef
62 LUA_POST_PATCH_HOOKS += LUA_32BITS_LUACONF
63 endif
65 HOST_LUA_CFLAGS = -Wall -fPIC -DLUA_USE_DLOPEN -DLUA_USE_POSIX
66 HOST_LUA_MYLIBS = -ldl
68 define LUA_BUILD_CMDS
69 $(TARGET_MAKE_ENV) $(MAKE) \
70 CC="$(TARGET_CC)" RANLIB="$(TARGET_RANLIB)" \
71 CFLAGS="$(TARGET_CFLAGS) $(LUA_CFLAGS)" \
72 MYLIBS="$(LUA_MYLIBS)" AR="$(TARGET_CROSS)ar rcu" \
73 BUILDMODE=$(LUA_BUILDMODE) \
74 PKG_VERSION=$(LUA_VERSION) -C $(@D)/src all
75 endef
77 define HOST_LUA_BUILD_CMDS
78 $(HOST_MAKE_ENV) $(MAKE) \
79 CFLAGS="$(HOST_LUA_CFLAGS)" \
80 MYLDFLAGS="$(HOST_LDFLAGS)" \
81 MYLIBS="$(HOST_LUA_MYLIBS)" \
82 BUILDMODE=static \
83 PKG_VERSION=$(LUA_VERSION) -C $(@D)/src all
84 endef
86 define LUA_INSTALL_STAGING_CMDS
87 $(TARGET_MAKE_ENV) $(MAKE) INSTALL_TOP="$(STAGING_DIR)/usr" -C $(@D) install
88 $(INSTALL) -m 0644 -D $(@D)/etc/lua.pc \
89 $(STAGING_DIR)/usr/lib/pkgconfig/lua.pc
90 endef
92 define LUA_INSTALL_TARGET_CMDS
93 $(TARGET_MAKE_ENV) $(MAKE) INSTALL_TOP="$(TARGET_DIR)/usr" -C $(@D) install
94 endef
96 define HOST_LUA_INSTALL_CMDS
97 $(HOST_MAKE_ENV) $(MAKE) INSTALL_TOP="$(HOST_DIR)/usr" -C $(@D) install
98 $(INSTALL) -m 0644 -D $(@D)/etc/lua.pc \
99 $(HOST_DIR)/usr/lib/pkgconfig/lua.pc
100 endef
102 $(eval $(generic-package))
103 $(eval $(host-generic-package))