<commit_before>#!/bin/sh
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
LIPO="xcrun -sdk iphoneos lipo"
STRIP="xcrun -sdk iphoneos strip"

SRCDIR=$DIR/luajit/src
DESTDIR=$DIR/prebuilt/ios
IXCODE=`xcode-select -print-path`
ISDK=$IXCODE/Platforms/iPhoneOS.platform/Developer
INFOPLIST_PATH=$IXCODE/Platforms/iPhoneOS.platform/version.plist
BUNDLE_ID=$(/usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString" "${INFOPLIST_PATH}")
ISDKVER=iPhoneOS${BUNDLE_ID}.sdk

ABOVE_VERSION=` bc <<< "$BUNDLE_ID>=8.0" `

if [[ $ABOVE_VERSION -eq 1 ]]; then
ISDKP=$IXCODE/usr/bin/
else
ISDKP=$ISDK/usr/bin/
fi

# if [ ! -e $ISDKP/ar ]; then 
#   sudo cp $ISDK/usr/bin/ar $ISDKP
# fi

# if [ ! -e $ISDKP/ranlib ]; then
#   sudo cp $ISDK/usr/bin/ranlib $ISDKP
# fi

# if [ ! -e $ISDKP/strip ]; then
#   sudo cp $ISDK/usr/bin/strip $ISDKP
# fi

rm -rf "$DESTDIR"
mkdir "$DESTDIR"
cd $SRCDIR


make clean
ISDKF="-arch armv7 -isysroot $ISDK/SDKs/$ISDKVER"
if [[ $ABOVE_VERSION -eq 1 ]]; then
make HOST_CC="gcc -m32 -arch i386" TARGET_FLAGS="$ISDKF" TARGET=arm TARGET_SYS=iOS
else
make HOST_CC="gcc -m32 -arch i386" CROSS=$ISDKP TARGET_FLAGS="$ISDKF" TARGET_SYS=iOS
fi
mv "$SRCDIR"/libluajit.a "$DESTDIR"/libluajit-armv7.a


make clean
ISDKF="-arch armv7s -isysroot $ISDK/SDKs/$ISDKVER"
if [[ $ABOVE_VERSION -eq 1 ]]; then
make HOST_CC="gcc -m32 -arch i386" TARGET_FLAGS="$ISDKF" TARGET=arm TARGET_SYS=iOS
else
make HOST_CC="gcc -m32 -arch i386" CROSS=$ISDKP TARGET_FLAGS="$ISDKF" TARGET_SYS=iOS
fi
mv "$SRCDIR"/libluajit.a "$DESTDIR"/libluajit-armv7s.a


make clean
ISDKF="-arch arm64 -isysroot $ISDK/SDKs/$ISDKVER"
make HOST_CC="gcc " CROSS="$ISDKP" TARGET_FLAGS="$ISDKF" TARGET=arm64 TARGET_SYS=iOS
mv "$SRCDIR"/libluajit.a "$DESTDIR"/libluajit-arm64.a


make clean
make CC="gcc -m32 -arch i386" clean all
mv "$SRCDIR"/libluajit.a "$DESTDIR"/libluajit-i386.a

<commit_msg>fix build ios for xcode 7(ios 9)<commit_after>#!/bin/sh
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
LIPO="xcrun -sdk iphoneos lipo"
STRIP="xcrun -sdk iphoneos strip"

SRCDIR=$DIR/luajit/src
DESTDIR=$DIR/prebuilt/ios
IXCODE=`xcode-select -print-path`
ISDK=$IXCODE/Platforms/iPhoneOS.platform/Developer
INFOPLIST_PATH=$IXCODE/Platforms/iPhoneOS.platform/version.plist
BUNDLE_ID=$(/usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString" "${INFOPLIST_PATH}")
ISDKVER=iPhoneOS${BUNDLE_ID}.sdk

ABOVE_VERSION=` bc <<< "$BUNDLE_ID>=8.0" `

if [[ $ABOVE_VERSION -eq 1 ]]; then
ISDKP=$IXCODE/usr/bin/
else
ISDKP=$ISDK/usr/bin/
fi

# if [ ! -e $ISDKP/ar ]; then 
#   sudo cp $ISDK/usr/bin/ar $ISDKP
# fi

# if [ ! -e $ISDKP/ranlib ]; then
#   sudo cp $ISDK/usr/bin/ranlib $ISDKP
# fi

# if [ ! -e $ISDKP/strip ]; then
#   sudo cp $ISDK/usr/bin/strip $ISDKP
# fi

rm -rf "$DESTDIR"
mkdir "$DESTDIR"
cd $SRCDIR


make clean
ISDKF="-arch armv7 -isysroot $ISDK/SDKs/$ISDKVER"
if [[ $ABOVE_VERSION -eq 1 ]]; then
make HOST_CC="gcc -m32 -arch i386" TARGET_FLAGS="$ISDKF" TARGET=arm TARGET_SYS=iOS
else
make HOST_CC="gcc -m32 -arch i386" CROSS=$ISDKP TARGET_FLAGS="$ISDKF" TARGET_SYS=iOS
fi
mv "$SRCDIR"/libluajit.a "$DESTDIR"/libluajit-armv7.a


make clean
ISDKF="-arch armv7s -isysroot $ISDK/SDKs/$ISDKVER"
if [[ $ABOVE_VERSION -eq 1 ]]; then
make HOST_CC="gcc -m32 -arch i386" TARGET_FLAGS="$ISDKF" TARGET=arm TARGET_SYS=iOS
else
make HOST_CC="gcc -m32 -arch i386" CROSS=$ISDKP TARGET_FLAGS="$ISDKF" TARGET_SYS=iOS
fi
mv "$SRCDIR"/libluajit.a "$DESTDIR"/libluajit-armv7s.a


make clean
ISDKF="-arch arm64 -isysroot $ISDK/SDKs/$ISDKVER"
if [[ $ABOVE_VERSION -eq 1 ]]; then
make HOST_CC="gcc " TARGET_FLAGS="$ISDKF" TARGET=arm64 TARGET_SYS=iOS
else
make HOST_CC="gcc " CROSS=$ISDKP TARGET_FLAGS="$ISDKF" TARGET_SYS=iOS
fi
mv "$SRCDIR"/libluajit.a "$DESTDIR"/libluajit-arm64.a


make clean
make CC="gcc -m32 -arch i386" clean all
mv "$SRCDIR"/libluajit.a "$DESTDIR"/libluajit-i386.a


{'fraction_non_alphanumeric': 0.16683964711987545, 'fraction_numerical': 0.02361183186299948, 'mean_word_length': 5.0046728971962615, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7217310', 'n_tokens_mistral': 1843, 'n_tokens_neox': 1702, 'n_words': 343}