xref: /OK3568_Linux_fs/buildroot/package/luvi/luvi.mk (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun################################################################################
2*4882a593Smuzhiyun#
3*4882a593Smuzhiyun# luvi
4*4882a593Smuzhiyun#
5*4882a593Smuzhiyun################################################################################
6*4882a593Smuzhiyun
7*4882a593SmuzhiyunLUVI_VERSION = 2.12.0
8*4882a593SmuzhiyunLUVI_SOURCE = luvi-src-v$(LUVI_VERSION).tar.gz
9*4882a593SmuzhiyunLUVI_SITE = https://github.com/luvit/luvi/releases/download/v$(LUVI_VERSION)
10*4882a593SmuzhiyunLUVI_LICENSE = Apache-2.0
11*4882a593SmuzhiyunLUVI_LICENSE_FILES = LICENSE.txt
12*4882a593SmuzhiyunLUVI_DEPENDENCIES = libuv luajit luv host-luajit host-pkgconf
13*4882a593Smuzhiyun
14*4882a593Smuzhiyun# Dispatch all architectures of LuaJIT
15*4882a593Smuzhiyunifeq ($(BR2_i386),y)
16*4882a593SmuzhiyunLUVI_TARGET_ARCH = x86
17*4882a593Smuzhiyunelse ifeq ($(BR2_x86_64),y)
18*4882a593SmuzhiyunLUVI_TARGET_ARCH = x64
19*4882a593Smuzhiyunelse ifeq ($(BR2_powerpc),y)
20*4882a593SmuzhiyunLUVI_TARGET_ARCH = ppc
21*4882a593Smuzhiyunelse ifeq ($(BR2_arm)$(BR2_armeb),y)
22*4882a593SmuzhiyunLUVI_TARGET_ARCH = arm
23*4882a593Smuzhiyunelse ifeq ($(BR2_aarch64),y)
24*4882a593SmuzhiyunLUVI_TARGET_ARCH = arm64
25*4882a593Smuzhiyunelse ifeq ($(BR2_mips),y)
26*4882a593SmuzhiyunLUVI_TARGET_ARCH = mips
27*4882a593Smuzhiyunelse ifeq ($(BR2_mipsel),y)
28*4882a593SmuzhiyunLUVI_TARGET_ARCH = mipsel
29*4882a593Smuzhiyunelse
30*4882a593SmuzhiyunLUVI_TARGET_ARCH = $(BR2_ARCH)
31*4882a593Smuzhiyunendif
32*4882a593Smuzhiyun
33*4882a593Smuzhiyun# LUAJIT_VERSION and the luajit installation path may not use the
34*4882a593Smuzhiyun# same value. Use the value from luajit.pc file.
35*4882a593SmuzhiyunLUVI_LUAJIT_VERSION = `$(PKG_CONFIG_HOST_BINARY) --variable=version luajit`
36*4882a593Smuzhiyun
37*4882a593Smuzhiyun# Bundled lua bindings have to be linked statically into the luvi executable
38*4882a593SmuzhiyunLUVI_CONF_OPTS = \
39*4882a593Smuzhiyun	-DBUILD_SHARED_LIBS=OFF \
40*4882a593Smuzhiyun	-DWithSharedLibluv=ON \
41*4882a593Smuzhiyun	-DTARGET_ARCH=$(LUVI_TARGET_ARCH) \
42*4882a593Smuzhiyun	-DLUA_PATH=$(HOST_DIR)/share/luajit-$(LUVI_LUAJIT_VERSION)/?.lua
43*4882a593Smuzhiyun
44*4882a593Smuzhiyun# Add "rex" module (PCRE via bundled lrexlib)
45*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_PCRE),y)
46*4882a593SmuzhiyunLUVI_DEPENDENCIES += pcre
47*4882a593SmuzhiyunLUVI_CONF_OPTS += -DWithPCRE=ON -DWithSharedPCRE=ON
48*4882a593Smuzhiyunelse
49*4882a593SmuzhiyunLUVI_CONF_OPTS += -DWithPCRE=OFF -DWithSharedPCRE=OFF
50*4882a593Smuzhiyunendif
51*4882a593Smuzhiyun
52*4882a593Smuzhiyun# Add "ssl" module (via bundled lua-openssl)
53*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_OPENSSL),y)
54*4882a593SmuzhiyunLUVI_DEPENDENCIES += openssl
55*4882a593SmuzhiyunLUVI_CONF_OPTS += -DWithOpenSSL=ON -DWithOpenSSLASM=ON -DWithSharedOpenSSL=ON
56*4882a593Smuzhiyunelse
57*4882a593SmuzhiyunLUVI_CONF_OPTS += -DWithOpenSSL=OFF -DWithOpenSSLASM=OFF -DWithSharedOpenSSL=OFF
58*4882a593Smuzhiyunendif
59*4882a593Smuzhiyun
60*4882a593Smuzhiyun# Add "zlib" module (via bundled lua-zlib)
61*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_ZLIB),y)
62*4882a593SmuzhiyunLUVI_DEPENDENCIES += zlib
63*4882a593SmuzhiyunLUVI_CONF_OPTS += -DWithZLIB=ON -DWithSharedZLIB=ON
64*4882a593Smuzhiyunelse
65*4882a593SmuzhiyunLUVI_CONF_OPTS += -DWithZLIB=OFF -DWithSharedZLIB=OFF
66*4882a593Smuzhiyunendif
67*4882a593Smuzhiyun
68*4882a593Smuzhiyun$(eval $(cmake-package))
69