Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame^] | 1 | SUMMARY = "Just-In-Time Compiler for Lua" |
| 2 | LICENSE = "MIT" |
| 3 | LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=3992f1fbae3b8b061f9056b7fcda8cc6" |
| 4 | HOMEPAGE = "http://luajit.org" |
| 5 | |
| 6 | SRC_URI = "http://luajit.org/download/LuaJIT-${PV}.tar.gz \ |
| 7 | file://0001-Do-not-strip-automatically-this-leaves-the-stripping.patch \ |
| 8 | " |
| 9 | SRC_URI[md5sum] = "dd9c38307f2223a504cbfb96e477eca0" |
| 10 | SRC_URI[sha256sum] = "620fa4eb12375021bef6e4f237cbd2dd5d49e56beb414bee052c746beef1807d" |
| 11 | |
| 12 | S = "${WORKDIR}/LuaJIT-${PV}" |
| 13 | |
| 14 | inherit pkgconfig binconfig |
| 15 | |
| 16 | BBCLASSEXTEND = "native" |
| 17 | |
| 18 | do_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"). |
| 29 | BUILD_CC_ARCH_append_powerpc = ' -m32' |
| 30 | BUILD_CC_ARCH_append_x86 = ' -m32' |
| 31 | BUILD_CC_ARCH_append_arm = ' -m32' |
| 32 | |
| 33 | EXTRA_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 | |
| 41 | do_compile () { |
| 42 | oe_runmake |
| 43 | } |
| 44 | |
| 45 | do_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 | |
| 53 | PACKAGES += 'luajit-common' |
| 54 | |
| 55 | FILES_${PN} += "${libdir}/libluajit-5.1.so.2 \ |
| 56 | ${libdir}/libluajit-5.1.so.${PV} \ |
| 57 | " |
| 58 | FILES_${PN}-dev += "${libdir}/libluajit-5.1.a \ |
| 59 | ${libdir}/libluajit-5.1.so \ |
| 60 | ${libdir}/pkgconfig/luajit.pc \ |
| 61 | " |
| 62 | FILES_luajit-common = "${datadir}/${BPN}-${PV}" |
| 63 | |