Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 1 | SUMMARY = "Just-In-Time Compiler for Lua" |
| 2 | LICENSE = "MIT" |
| 3 | LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=10a96c93403affcc34765f4c2612bc22" |
| 4 | HOMEPAGE = "http://luajit.org" |
| 5 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 6 | PV .= "+git${SRCPV}" |
| 7 | SRCREV = "02b521981a1ab919ff2cd4d9bcaee80baf77dce2" |
| 8 | SRC_URI = "git://luajit.org/git/luajit-2.0.git;protocol=http \ |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 9 | file://0001-Do-not-strip-automatically-this-leaves-the-stripping.patch \ |
| 10 | file://clang.patch \ |
| 11 | " |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 12 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 13 | S = "${WORKDIR}/git" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 14 | |
| 15 | inherit pkgconfig binconfig siteinfo |
| 16 | |
| 17 | BBCLASSEXTEND = "native" |
| 18 | |
| 19 | # http://luajit.org/install.html#cross |
| 20 | # Host luajit needs to be compiled with the same pointer size |
| 21 | # If you want to cross-compile to any 32 bit target on an x64 OS, |
| 22 | # you need to install the multilib development package (e.g. |
| 23 | # libc6-dev-i386 on Debian/Ubuntu) and build a 32 bit host part |
| 24 | # (HOST_CC="gcc -m32"). |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 25 | BUILD_CC_ARCH_append = " ${@['-m32',''][d.getVar('SITEINFO_BITS') != '32']}" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 26 | |
| 27 | # The lua makefiles expect the TARGET_SYS to be from uname -s |
| 28 | # Values: Windows, Linux, Darwin, iOS, SunOS, PS3, GNU/kFreeBSD |
| 29 | LUA_TARGET_OS = "Unknown" |
| 30 | LUA_TARGET_OS_darwin = "Darwin" |
| 31 | LUA_TARGET_OS_linux = "Linux" |
| 32 | LUA_TARGET_OS_linux-gnueabi = "Linux" |
| 33 | LUA_TARGET_OS_mingw32 = "Windows" |
| 34 | |
| 35 | # We don't want the lua buildsystem's compiler optimizations, or its |
| 36 | # stripping, and we don't want it to pick up CFLAGS or LDFLAGS, as those apply |
| 37 | # to both host and target compiles |
| 38 | EXTRA_OEMAKE = "\ |
| 39 | Q= E='@:' \ |
| 40 | \ |
| 41 | CCOPT= CCOPT_x86= CFLAGS= LDFLAGS= TARGET_STRIP='@:' \ |
| 42 | \ |
| 43 | 'TARGET_SYS=${LUA_TARGET_OS}' \ |
| 44 | \ |
| 45 | 'CC=${CC}' \ |
| 46 | 'TARGET_AR=${AR} rcus' \ |
| 47 | 'TARGET_CFLAGS=${CFLAGS}' \ |
| 48 | 'TARGET_LDFLAGS=${LDFLAGS}' \ |
| 49 | 'TARGET_SHLDFLAGS=${LDFLAGS}' \ |
| 50 | 'HOST_CC=${BUILD_CC}' \ |
| 51 | 'HOST_CFLAGS=${BUILD_CFLAGS}' \ |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 52 | \ |
| 53 | 'PREFIX=${prefix}' \ |
| 54 | 'MULTILIB=${baselib}' \ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 55 | 'LDCONFIG=:' \ |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 56 | " |
| 57 | |
| 58 | do_compile () { |
| 59 | oe_runmake |
| 60 | } |
| 61 | |
| 62 | # There's INSTALL_LIB and INSTALL_SHARE also, but the lua binary hardcodes the |
| 63 | # '/share' and '/' + LUA_MULTILIB paths, so we don't want to break those |
| 64 | # expectations. |
| 65 | EXTRA_OEMAKEINST = "\ |
| 66 | 'DESTDIR=${D}' \ |
| 67 | 'INSTALL_BIN=${D}${bindir}' \ |
| 68 | 'INSTALL_INC=${D}${includedir}/luajit-$(MAJVER).$(MINVER)' \ |
| 69 | 'INSTALL_MAN=${D}${mandir}/man1' \ |
| 70 | " |
| 71 | do_install () { |
| 72 | oe_runmake ${EXTRA_OEMAKEINST} install |
| 73 | rmdir ${D}${datadir}/lua/5.* \ |
| 74 | ${D}${datadir}/lua \ |
| 75 | ${D}${libdir}/lua/5.* \ |
| 76 | ${D}${libdir}/lua |
| 77 | } |
| 78 | |
| 79 | PACKAGES += 'luajit-common' |
| 80 | |
| 81 | # See the comment for EXTRA_OEMAKEINST. This is needed to ensure the hardcoded |
| 82 | # paths are packaged regardless of what the libdir and datadir paths are. |
| 83 | FILES_${PN} += "${prefix}/${baselib} ${prefix}/share" |
| 84 | FILES_${PN} += "${libdir}/libluajit-5.1.so.2 \ |
| 85 | ${libdir}/libluajit-5.1.so.${PV} \ |
| 86 | " |
| 87 | FILES_${PN}-dev += "${libdir}/libluajit-5.1.a \ |
| 88 | ${libdir}/libluajit-5.1.so \ |
| 89 | ${libdir}/pkgconfig/luajit.pc \ |
| 90 | " |
| 91 | FILES_luajit-common = "${datadir}/${BPN}-${PV}" |
| 92 | |
Andrew Geissler | 1548c07 | 2019-02-22 16:03:50 -0600 | [diff] [blame] | 93 | # Aarch64/mips64 is not supported in this release |
| 94 | COMPATIBLE_HOST_aarch64 = "null" |
| 95 | COMPATIBLE_HOST_mipsarchn32 = "null" |
| 96 | COMPATIBLE_HOST_mipsarchn64 = "null" |