1
0
Maksym H c0f745994c macOS: minor update
(cherry picked from commit 01610cb8453077a6877f7b4ac9bacf7327fe282d)
2023-08-10 22:54:16 -04:00

35 lines
702 B
Bash
Executable File

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