blob: a0252aa94690a225ebb3f9137fc87fd6ac732c45 [file] [log] [blame]
Patrick Williamsb48b7b42016-08-17 15:04:38 -05001SUMMARY = "Just-In-Time Compiler for Lua"
2LICENSE = "MIT"
3LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=3992f1fbae3b8b061f9056b7fcda8cc6"
4HOMEPAGE = "http://luajit.org"
5
6SRC_URI = "http://luajit.org/download/LuaJIT-${PV}.tar.gz \
7 file://0001-Do-not-strip-automatically-this-leaves-the-stripping.patch \
8"
9SRC_URI[md5sum] = "dd9c38307f2223a504cbfb96e477eca0"
10SRC_URI[sha256sum] = "620fa4eb12375021bef6e4f237cbd2dd5d49e56beb414bee052c746beef1807d"
11
12S = "${WORKDIR}/LuaJIT-${PV}"
13
14inherit pkgconfig binconfig
15
16BBCLASSEXTEND = "native"
17
18do_configure_prepend() {
19 sed -i 's:PREFIX= /usr/local:PREFIX= ${prefix}:g' ${S}/Makefile
20 sed -i 's:MULTILIB= lib:MULTILIB= ${baselib}:g' ${S}/Makefile
21}
22
23# http://luajit.org/install.html#cross
24# Host luajit needs to be compiled with the same pointer size
25# If you want to cross-compile to any 32 bit target on an x64 OS,
26# you need to install the multilib development package (e.g.
27# libc6-dev-i386 on Debian/Ubuntu) and build a 32 bit host part
28# (HOST_CC="gcc -m32").
29BUILD_CC_ARCH_append_powerpc = ' -m32'
30BUILD_CC_ARCH_append_x86 = ' -m32'
31BUILD_CC_ARCH_append_arm = ' -m32'
32
33EXTRA_OEMAKE_append_class-target = '\
34 CROSS=${HOST_PREFIX} \
35 HOST_CC="${BUILD_CC} ${BUILD_CC_ARCH}" \
36 TARGET_CFLAGS="${TOOLCHAIN_OPTIONS} ${TARGET_CC_ARCH}" \
37 TARGET_LDFLAGS="${TOOLCHAIN_OPTIONS}" \
38 TARGET_SHLDFLAGS="${TOOLCHAIN_OPTIONS}" \
39'
40
41do_compile () {
42 oe_runmake
43}
44
45do_install () {
46 oe_runmake 'DESTDIR=${D}' install
47 rmdir ${D}${datadir}/lua/5.* \
48 ${D}${datadir}/lua \
49 ${D}${libdir}/lua/5.* \
50 ${D}${libdir}/lua
51}
52
53PACKAGES += 'luajit-common'
54
55FILES_${PN} += "${libdir}/libluajit-5.1.so.2 \
56 ${libdir}/libluajit-5.1.so.${PV} \
57"
58FILES_${PN}-dev += "${libdir}/libluajit-5.1.a \
59 ${libdir}/libluajit-5.1.so \
60 ${libdir}/pkgconfig/luajit.pc \
61"
62FILES_luajit-common = "${datadir}/${BPN}-${PV}"
63