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