The cirros image was rebuilt against the 3.13.0-83 kernel, drivers e1000e, igbvf...
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / luajit / luajit.mk
1 ################################################################################
2 #
3 # luajit
4 #
5 ################################################################################
6
7 LUAJIT_VERSION = 2.0.3
8 LUAJIT_SOURCE = LuaJIT-$(LUAJIT_VERSION).tar.gz
9 LUAJIT_SITE = http://luajit.org/download
10 LUAJIT_LICENSE = MIT
11 LUAJIT_LICENSE_FILES = COPYRIGHT
12
13 LUAJIT_INSTALL_STAGING = YES
14
15 LUAJIT_PROVIDES = luainterpreter
16
17 ifeq ($(BR2_STATIC_LIBS),y)
18 LUAJIT_BUILDMODE = static
19 else
20 LUAJIT_BUILDMODE = dynamic
21 endif
22
23 # The luajit build procedure requires the host compiler to have the
24 # same bitness as the target compiler. Therefore, on a x86 build
25 # machine, we can't build luajit for x86_64, which is checked in
26 # Config.in. When the target is a 32 bits target, we pass -m32 to
27 # ensure that even on 64 bits build machines, a compiler of the same
28 # bitness is used. Of course, this assumes that the 32 bits multilib
29 # libraries are installed.
30 ifeq ($(BR2_ARCH_IS_64),y)
31 LUAJIT_HOST_CC = $(HOSTCC)
32 else
33 LUAJIT_HOST_CC = $(HOSTCC) -m32
34 endif
35
36 # We unfortunately can't use TARGET_CONFIGURE_OPTS, because the luajit
37 # build system uses non conventional variable names.
38 define LUAJIT_BUILD_CMDS
39         $(MAKE) PREFIX="/usr" \
40                 STATIC_CC="$(TARGET_CC)" \
41                 DYNAMIC_CC="$(TARGET_CC) -fPIC" \
42                 TARGET_LD="$(TARGET_CC)" \
43                 TARGET_AR="$(TARGET_AR) rcus" \
44                 TARGET_STRIP=true \
45                 TARGET_CFLAGS="$(TARGET_CFLAGS)" \
46                 TARGET_LDFLAGS="$(TARGET_LDFLAGS)" \
47                 HOST_CC="$(LUAJIT_HOST_CC)" \
48                 HOST_CFLAGS="$(HOST_CFLAGS)" \
49                 HOST_LDFLAGS="$(HOST_LDFLAGS)" \
50                 BUILDMODE=$(LUAJIT_BUILDMODE) \
51                 -C $(@D) amalg
52 endef
53
54 define LUAJIT_INSTALL_STAGING_CMDS
55         $(MAKE) PREFIX="/usr" DESTDIR="$(STAGING_DIR)" LDCONFIG=true -C $(@D) install
56 endef
57
58 define LUAJIT_INSTALL_TARGET_CMDS
59         $(MAKE) PREFIX="/usr" DESTDIR="$(TARGET_DIR)" LDCONFIG=true -C $(@D) install
60 endef
61
62 define LUAJIT_INSTALL_SYMLINK
63         ln -fs luajit $(TARGET_DIR)/usr/bin/lua
64 endef
65 LUAJIT_POST_INSTALL_TARGET_HOOKS += LUAJIT_INSTALL_SYMLINK
66
67 define HOST_LUAJIT_BUILD_CMDS
68         $(MAKE) PREFIX="/usr" BUILDMODE=static -C $(@D) amalg
69 endef
70
71 define HOST_LUAJIT_INSTALL_CMDS
72         $(MAKE) PREFIX="/usr" DESTDIR="$(HOST_DIR)" -C $(@D) install
73 endef
74
75 $(eval $(generic-package))
76 $(eval $(host-generic-package))