1
0

35 lines
702 B
Bash
Raw Permalink Normal View History

2022-01-30 00:10:40 +02:00
#!/bin/bash -e
2022-11-13 17:35:33 +01:00
LUAJIT_VERSION="v2.1"
2022-01-30 00:10:40 +02:00
. scripts/sdk.sh
export MACOSX_DEPLOYMENT_TARGET=10.15
mkdir -p deps; cd deps
2022-11-13 17:35:33 +01:00
if [ ! -d luajit-src ]; then
git clone -b $LUAJIT_VERSION --depth 1 -c core.autocrlf=false https://github.com/LuaJIT/LuaJIT luajit-src
2022-01-30 00:10:40 +02:00
fi
2022-11-13 17:35:33 +01:00
rm -rf luajit
2022-11-13 17:35:33 +01:00
cd luajit-src
2022-01-30 00:10:40 +02:00
for ARCH in x86_64 arm64
do
echo "Building LuaJIT for $ARCH"
make amalg -j \
2023-06-27 01:48:52 +03:00
TARGET_FLAGS="$OSX_FLAGS -fno-fast-math -Wno-overriding-t-option -arch $ARCH"
2022-11-13 17:35:33 +01:00
cp src/libluajit.a templib_$ARCH.a
2022-01-30 00:10:40 +02:00
make clean
done
# repack into one .a
lipo -create templib_*.a -output libluajit.a
rm templib_*.a
2022-11-13 17:35:33 +01:00
mkdir -p ../luajit/include
2022-01-30 00:10:40 +02:00
cp -v src/*.h ../luajit/include
2022-11-13 17:35:33 +01:00
cp -v libluajit.a ../luajit
2022-01-30 00:10:40 +02:00
echo "LuaJIT build successful"