From 979c100259ae917a0f181ef79d631182f49650a7 Mon Sep 17 00:00:00 2001 From: CherretGit Date: Tue, 20 Jan 2026 20:53:05 +0700 Subject: [PATCH] add luajit to justfile --- rust/justfile | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/rust/justfile b/rust/justfile index c1ab5a3..fab2d2b 100644 --- a/rust/justfile +++ b/rust/justfile @@ -61,6 +61,32 @@ _build_netfilter_libs target_arch: patch -p1 -d libnetfilter_queue-* -i $PATCH fi + if [ ! -d "luajit2-*" ]; then + wget -qO- https://github.com/openresty/luajit2/archive/refs/tags/v2.1-20250826.tar.gz | tar -xz + fi + + case "{{target_arch}}" in + *64*) + HOSTCC="cc" + ;; + *) + HOSTCC="cc -m32" + esac + + ( + cd luajit2-* + make BUILDMODE=static XCFLAGS=-DLUAJIT_DISABLE_FFI \ + HOST_CC="$HOSTCC" CROSS= CC="$CC" \ + TARGET_AR="$AR rcus" TARGET_STRIP=$STRIP \ + CFLAGS="-Os -flto=auto $CFLAGS" -j$(nproc) + + make install PREFIX= DESTDIR=$NETFILTER_LIBS-{{target_arch}} + ) + + LJIT=1 + LCFLAGS="-I${NETFILTER_LIBS-{{target_arch}}}/include/luajit-2.1" + LLIB="-L${NETFILTER_LIBS-{{target_arch}}}/lib -lluajit-2.1" + for i in libmnl libnfnetlink libnetfilter_queue ; do ( cd $i-* @@ -101,6 +127,9 @@ build-android *args: prepare-android export CFLAGS="-I$NETFILTER_LIBS-$t/include" export LDFLAGS="-L$NETFILTER_LIBS-$t/lib" export CXXFLAGS="$CFLAGS" + export LJIT=1 + export LCFLAGS="-I$NETFILTER_LIBS-$t/include/luajit-2.1" + export LLIB="-L$NETFILTER_LIBS-$t/lib -lluajit-2.1" just _build_netfilter_libs $t just _instal_rust_target $t