<commit_before>#!/bin/sh

## settings
SUPPORTED_ARCH="armv7 armv7s arm64 i386 x86_64"
COMMON_CFLAGS="-Os"
## end settings

XCRUN=`which xcrun`
LIPO=`which lipo`

if [ "$XCRUN" = "" -o "$LIPO" = "" ]; then
    echo "needs xcrun and lipo"
    exit 1
fi

COMMON_CONFIGURE_FLAGS=
WORKSPACE="`pwd`/workspace"

while (( $# > 0))
do
    if [ "`echo "$1" | grep "\--with-ssl="`" != "" ]; then
        COMMON_CONFIGURE_FLAGS="$COMMON_CONFIGURE_FLAGS $1"
    elif [ "`echo "$1" | grep "\--with-ssl"`" != "" ]; then
        COMMON_CONFIGURE_FLAGS="$COMMON_CONFIGURE_FLAGS --with-ssl=`pwd`/deps/OpenSSL-for-iPhone"
    else
        COMMON_CONFIGURE_FLAGS="$COMMON_CONFIGURE_FLAGS $1"
    fi
    shift
done

do_configure() {
    TARGET_ARCH=$1
    CFLAGS="${COMMON_CFLAGS}"

    case ${TARGET_ARCH} in
	armv7)
	    TARGET_HOST_OPTION="--host=arm-apple-darwin"
	    SDK_DIR="`$XCRUN -sdk iphoneos --show-sdk-path`"
	    CFLAGS="-arch armv7 ${CFLAGS} -D__ARM_EABI__" ## TODO: should use -target arm-darwin-eabi
	    ;;
	armv7s)
	    TARGET_HOST_OPTION="--host=arm-apple-darwin"
	    SDK_DIR="`$XCRUN -sdk iphoneos --show-sdk-path`"
	    CFLAGS="-arch armv7s ${CFLAGS} -D__ARM_EABI__" ## TODO: should use -target arm-darwin-eabi
	    ;;
	arm64)
	    TARGET_HOST_OPTION="--host=arm-apple-darwin"
	    SDK_DIR="`$XCRUN -sdk iphoneos --show-sdk-path`"
	    CFLAGS="-arch arm64 ${CFLAGS}"
	    ;;
	i386)
	    TARGET_HOST_OPTION=
	    SDK_DIR="`$XCRUN -sdk iphonesimulator --show-sdk-path`"
	    CFLAGS="-arch i386 ${CFLAGS}"
	    ;;
	x86_64)
	    TARGET_HOST_OPTION=
	    SDK_DIR="`$XCRUN -sdk iphonesimulator --show-sdk-path`"
	    CFLAGS="-arch x86_64 ${CFLAGS}"
	    ;;
	*)
	    echo "error: ${TARGET_ARCH} is not supported"
	    exit 1;
    esac

    export CC=clang
    export CXX=clang++<commit_msg>enable to work with Xcode7.0 and SDK9.0<commit_after>#!/bin/sh

## settings
SUPPORTED_ARCH="armv7 armv7s arm64 i386 x86_64"
COMMON_CFLAGS="-Os"
## end settings

XCRUN=`which xcrun`
LIPO=`which lipo`

if [ "$XCRUN" = "" -o "$LIPO" = "" ]; then
    echo "needs xcrun and lipo"
    exit 1
fi

COMMON_CONFIGURE_FLAGS=
WORKSPACE="`pwd`/workspace"

while (( $# > 0))
do
    if [ "`echo "$1" | grep "\--with-ssl="`" != "" ]; then
        COMMON_CONFIGURE_FLAGS="$COMMON_CONFIGURE_FLAGS $1"
    elif [ "`echo "$1" | grep "\--with-ssl"`" != "" ]; then
        COMMON_CONFIGURE_FLAGS="$COMMON_CONFIGURE_FLAGS --with-ssl=`pwd`/deps/OpenSSL-for-iPhone"
    else
        COMMON_CONFIGURE_FLAGS="$COMMON_CONFIGURE_FLAGS $1"
    fi
    shift
done

do_configure() {
    TARGET_ARCH=$1
    CFLAGS="${COMMON_CFLAGS}"
    if [ "`$XCRUN -sdk iphoneos --show-sdk-version`" == "9.0" ]; then
        CFLAGS="-fembed-bitcode ${CFLAGS}"
    fi
    case ${TARGET_ARCH} in
	armv7)
	    TARGET_HOST_OPTION="--host=arm-apple-darwin"
	    SDK_DIR="`$XCRUN -sdk iphoneos --show-sdk-path`"
	    CFLAGS="-arch armv7 ${CFLAGS} -D__ARM_EABI__" ## TODO: should use -target arm-darwin-eabi
	    ;;
	armv7s)
	    TARGET_HOST_OPTION="--host=arm-apple-darwin"
	    SDK_DIR="`$XCRUN -sdk iphoneos --show-sdk-path`"
	    CFLAGS="-arch armv7s ${CFLAGS} -D__ARM_EABI__" ## TODO: should use -target arm-darwin-eabi
	    ;;
	arm64)
	    TARGET_HOST_OPTION="--host=arm-apple-darwin"
	    SDK_DIR="`$XCRUN -sdk iphoneos --show-sdk-path`"
	    CFLAGS="-arch arm64 ${CFLAGS}"
	    ;;
	i386)
	    TARGET_HOST_OPTION="--host=i386-apple-darwin"
	    SDK_DIR="`$XCRUN -sdk iphonesimulator --show-sdk-path`"
	    CFLAGS="-arch i386 ${CFLAGS}"
	    ;;
	x86_64)
	    TARGET_HOST_OPTION="--host=x86_64-apple-darwin"
	    SDK_DIR="`$XCRUN -sdk iphonesimulator --show-sdk-path`"
	    CFLAGS="-arch x86_64 ${CFLAGS}"
	    ;;
	*)
	    echo "error: ${TARGET_ARCH} is not supported"
	    exit 1;
    esac

    export CC=clang
    export CXX=clang++
{'fraction_non_alphanumeric': 0.16768373573892278, 'fraction_numerical': 0.02520562483417352, 'mean_word_length': 3.1383095499451152, 'pattern_counts': {'":': 0, '<': 3, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '464062', 'n_tokens_mistral': 1645, 'n_tokens_neox': 1515, 'n_words': 275}