1 ################################################################################
5 ################################################################################
8 LUAJIT_SOURCE
= LuaJIT-
$(LUAJIT_VERSION
).
tar.gz
9 LUAJIT_SITE
= http
://luajit.org
/download
11 LUAJIT_LICENSE_FILES
= COPYRIGHT
13 LUAJIT_INSTALL_STAGING
= YES
15 LUAJIT_PROVIDES
= luainterpreter
17 ifeq ($(BR2_STATIC_LIBS
),y
)
18 LUAJIT_BUILDMODE
= static
20 LUAJIT_BUILDMODE
= dynamic
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
)
33 LUAJIT_HOST_CC
= $(HOSTCC
) -m32
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 $(TARGET_MAKE_ENV
) $(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" \
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
) \
54 define LUAJIT_INSTALL_STAGING_CMDS
55 $(TARGET_MAKE_ENV
) $(MAKE
) PREFIX
="/usr" DESTDIR
="$(STAGING_DIR)" LDCONFIG
=true
-C
$(@D
) install
58 define LUAJIT_INSTALL_TARGET_CMDS
59 $(TARGET_MAKE_ENV
) $(MAKE
) PREFIX
="/usr" DESTDIR
="$(TARGET_DIR)" LDCONFIG
=true
-C
$(@D
) install
62 define LUAJIT_INSTALL_SYMLINK
63 ln
-fs luajit
$(TARGET_DIR
)/usr
/bin
/lua
65 LUAJIT_POST_INSTALL_TARGET_HOOKS
+= LUAJIT_INSTALL_SYMLINK
67 # host-efl package needs host-luajit to be linked dynamically.
68 define HOST_LUAJIT_BUILD_CMDS
69 $(HOST_MAKE_ENV
) $(MAKE
) PREFIX
="$(HOST_DIR)/usr" BUILDMODE
=dynamic \
70 TARGET_LDFLAGS
="$(HOST_LDFLAGS)" \
74 define HOST_LUAJIT_INSTALL_CMDS
75 $(HOST_MAKE_ENV
) $(MAKE
) PREFIX
="$(HOST_DIR)/usr" LDCONFIG
=true
-C
$(@D
) install
78 $(eval
$(generic-package
))
79 $(eval
$(host-generic-package
))