<commit_before><commit_msg>changes in tools: Came up with a configuration script to setup the environment for various (i.e. i386, x86_64, armv7, armv7s) SIP Sofia library builds<commit_after>#!/bin/bash

SDK="iphoneos"
ARCH="armv7"

if [[ $# -ne 2 ]]
then
	echo "Usage: ios.script.bash <sdk> <architecture>"
	exit 1
fi 

if [[ $1 == "simulator" ]]
then
	SDK="iphonesimulator"
fi

ARCH=$2
I386_FLAGS=""
if [[ $2 == "i386" ]]
then
	I386_FLAGS="-m32"
fi

export DEVROOT="$(xcrun --sdk $SDK --show-sdk-platform-path)/Developer"
export SDKROOT="$(xcrun --sdk $SDK --show-sdk-path)"

if [[ $1 == "simulator" ]]
then
	export CC=$DEVROOT/usr/bin/gcc
	export CXX=$DEVROOT/usr/bin/g++
else
	export CC="/usr/bin/clang"
	export CXX="/usr/bin/clang++"
fi

export LD="${DEVROOT}/usr/bin/ld"

if [[ $1 == "simulator" ]]
then
	# there was no 'ar' in simulator DEVROOT, so I used the OSX one and worked
	export AR="/usr/bin/ar"
else
	export AR="${DEVROOT}/usr/bin/ar"
fi

export AS="${DEVROOT}/usr/bin/as"
export NM="${DEVROOT}/usr/bin/nm"

if [[ $1 == "simulator" ]]
then
	# there was no 'ranlib' in simulator DEVROOT, so I used the OSX one and worked
	export RANLIB="/usr/bin/ranlib"
else
	export RANLIB="${DEVROOT}/usr/bin/ranlib"
fi

if [[ $1 == "simulator" ]]
then
	export LDFLAGS=${I386_FLAGS}" -L${SDKROOT}/usr/lib/  -miphoneos-version-min=7.0"
else
	export LDFLAGS="-L${SDKROOT}/usr/lib/"
fi

#export ARCH="armv7"
export ARCH
export CFLAGS=${I386_FLAGS}" -arch ${ARCH} -pipe -no-cpp-precomp -isysroot ${SDKROOT} -I${SDKROOT}/usr/include/"
#export CFLAGS="-arch ${ARCH} -pipe -no-cpp-precomp -isysroot ${SDKROOT} -I${SDKROOT}/usr/include/"

export CPPFLAGS="${CFLAGS}"
export CXXFLAGS="${CFLAGS}"

echo "---------------"
echo "Using CC: $CC"
echo "Using SDK: $SDK"
echo "Using ARCH: $ARCH"
echo "Using DEVROOT: $DEVROOT"
echo "Using SDKROOT: $SDKROOT"
echo "Using CFLAGS: $CFLAGS"
echo "Using LDFLAGS: $LDFLAGS"
echo "Using AR: $AR"
echo "Using AS: $AS"
echo "Using NM: $NM"
echo "Using RANLIB: $RANLIB"
echo "---------------"

{'fraction_non_alphanumeric': 0.19583539910758552, 'fraction_numerical': 0.019335647000495785, 'mean_word_length': 4.174358974358975, 'pattern_counts': {'":': 0, '<': 5, '<?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': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5605307', 'n_tokens_mistral': 835, 'n_tokens_neox': 781, 'n_words': 215}