1 ################################################################################
5 ################################################################################
7 ifeq ($(BR2_PACKAGE_LUA_5_3
),y
)
10 ifeq ($(BR2_PACKAGE_LUA_5_2
),y
)
16 LUA_SITE
= http
://www.lua.org
/ftp
17 LUA_INSTALL_STAGING
= YES
19 ifeq ($(BR2_PACKAGE_LUA_5_1
),y
)
20 LUA_LICENSE_FILES
= COPYRIGHT
22 LUA_LICENSE_FILES
= doc
/readme.html
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
33 ifeq ($(BR2_PACKAGE_LUA_5_3
),y
)
34 LUA_CFLAGS
+= -DLUA_COMPAT_5_2
37 ifeq ($(BR2_STATIC_LIBS
),y
)
38 LUA_BUILDMODE
= static
40 LUA_BUILDMODE
= dynamic
41 LUA_CFLAGS
+= -DLUA_USE_DLOPEN
45 ifeq ($(BR2_PACKAGE_LUA_READLINE
),y
)
46 LUA_DEPENDENCIES
= readline ncurses
47 LUA_MYLIBS
+= -lreadline
-lhistory
-lncurses
48 LUA_CFLAGS
+= -DLUA_USE_READLINE
50 ifeq ($(BR2_PACKAGE_LUA_LINENOISE
),y
)
51 LUA_DEPENDENCIES
= linenoise
52 LUA_MYLIBS
+= -llinenoise
53 LUA_CFLAGS
+= -DLUA_USE_LINENOISE
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
62 LUA_POST_PATCH_HOOKS
+= LUA_32BITS_LUACONF
65 HOST_LUA_CFLAGS
= -Wall
-fPIC
-DLUA_USE_DLOPEN
-DLUA_USE_POSIX
66 HOST_LUA_MYLIBS
= -ldl
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
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)" \
83 PKG_VERSION
=$(LUA_VERSION
) -C
$(@D
)/src
all
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
92 define LUA_INSTALL_TARGET_CMDS
93 $(TARGET_MAKE_ENV
) $(MAKE
) INSTALL_TOP
="$(TARGET_DIR)/usr" -C
$(@D
) install
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
102 $(eval
$(generic-package
))
103 $(eval
$(host-generic-package
))