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