<commit_before>#!/bin/sh
#Copyright (c) 2006 <NAME>
#
#Permission is hereby granted, free of charge, to any person obtaining a copy of this
#software and associated documentation files (the "Software"), to deal in the Software
#without restriction, including without limitation the rights to use, copy, modify,
#merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
#permit persons to whom the Software is furnished to do so, subject to the following
#conditions:
#
#The above copyright notice and this permission notice shall be included in all copies
#or substantial portions of the Software.
#
#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
#INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
#PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
#LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
#TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
#OR OTHER DEALINGS IN THE SOFTWARE.
#
# Inspired by the build-cross.sh script by <NAME>, et al
# Usage: install.sh <platform> <architecture> <compiler> <compiler-version> <osVersion>"
# Windows i386, Linux i386, Solaris sparc

if [ ""$1"" = "" ];then
	targetPlatform="Windows"
else
	targetPlatform=$1
fi

if [ ""$2"" = "" ];then
	targetArchitecture="i386"
else
	targetArchitecture=$2
fi

if [ ""$3"" = "" ];then
	compiler="gcc"
else
	compiler=$3
fi

gccVersion="4.3.1"

if [ ""$4"" = "" ];then
	if [ "$compiler" = "gcc" ]; then
		compilerVersion=$gccVersion
	elif [ "$compiler" = "llvm-clang" ]; then
		compilerVersion="trunk"
	else
		/bin/echo "Unknown compiler "$compiler
		exit 1
	fi
else
	compilerVersion=$4
fi

if [ ""$5"" = "" ];then
	if [ "$compiler" = "gcc" ]; then
        compilerVersionDate="-02242010"
	elif [ "$compiler" = "llvm-clang" ]; then
        compilerVersionDate="-05042011"
	else
		/bin/echo "Unknown compiler "$compiler
		exit 1
	fi
else
	compilerVersionDate="-"$5
fi

osVersion=$6

if [ ""$6"" = "" ];then
	if [ ""$6"" = "" -a ""$targetPlatform"" = "Solaris" ];then
		osVersion="2.10"
	elif [ ""$6"" = "" -a ""$targetPlatform"" = "FreeBSD" ];then
		osVersion="7"
	else
		osVersion=""
	fi
else
	osVersion=$6
fi

set -eu

cd "`dirname \"$0\"`"
installResources=`pwd`/Resources

if [ ! -d "$installResources" ];then
 /bin/echo "Unable to locate Resources directory at "$installResources
 exit 1
fi

enableLanguages="c,objc,c++,obj-c++"

installFolder=/Developer
productName=Cocotron
productVersion=1.0

binutilsVersion=2.21-20111025
mingwRuntimeVersion=3.20
mingwAPIVersion=3.17-2
gmpVersion=4.2.3
mpfrVersion=2.3.2

binutilsConfigureFlags=""

if [ $targetPlatform = "Windows" ];then
	if [ $targetArchitecture = "i386" ];then
		compilerTarget=i386-pc-mingw32msvc$osVersion
		compilerConfigureFlags=""
	else
		/bin/echo "Unsupported architecture $targetArchitecture on $targetPlatform"
	exit 1
	fi
elif [ $targetPlatform = "Linux" ];then
	if [ $targetArchitecture = "i386" ];then
		compilerTarget=i386-ubuntu-linux$osVersion
		compilerConfigureFlags="--enable-version-specific-runtime-libs --enable-shared --enable-threads=posix --disable-checking --disable-libunwind-exceptions --with-system-zlib --enable-__cxa_atexit"
	elif [ $targetArchitecture = "arm" ];then
		compilerTarget=arm-none-linux-gnueabi$osVersion
		compilerConfigureFlags="--enable-version-specific-runtime-libs --enable-shared --enable-threads=posix --disable-checking --disable-libunwind-exceptions --with-system-zlib --enable-__cxa_atexit"
	elif [ $targetArchitecture = "ppc" ];then
   	 	compilerTarget=powerpc-unknown-linux$osVersion
    		compilerConfigureFlags="--enable-version-specific-runtime-libs --enable-shared --enable-threads=posix --disable-checking --disable-libunwind-exceptions --with-system-zlib --enable-__cxa_atexit"
	elif [ $targetArchitecture = "x86_64" ];then
		compilerTarget=x86_64-pc-linux$osVersion
		compilerConfigureFlags="--enable-version-specific-runtime-libs --enable-shared --enable-threads=posix --disable-checking --disable-libunwind-exceptions --with-system-zlib --enable-__cxa_atexit"
		binutilsConfigureFlags="--enable-64-bit-bfd"
	else
		/bin/echo "Unsupported architecture $targetArchitecture on $targetPlatform"
		exit 1
	fi
elif [ $targetPlatform = "FreeBSD" ];then
	if [ $targetArchitecture = "i386" ];then
		compilerTarget=i386-pc-freebsd$osVersion
		compilerConfigureFlags="--enable-version-specific-runtime-libs --enable-shared --enable-threads=posix --disable-checking --disable-libunwind-exceptions --with-system-zlib --enable-__cxa_atexit"
	else
		/bin/echo "Unsupported architecture $targetArchitecture on $targetPlatform"
		exit 1
	fi
elif [ $targetPlatform = "Solaris" ];then
	if [ $targetArchitecture = "sparc" ];then
		compilerTarget=sparc-sun-solaris$osVersion
		compilerConfigureFlags="--enable-version-specific-runtime-libs --enable-shared --enable-threads=posix --disable-checking --disable-libunwind-exceptions --with-system-zlib --enable-__cxa_atexit"
	else
		/bin/echo "Unsupported architecture $targetArchitecture on $targetPlatform"
		exit 1
	 fi
elif [ $targetPlatform = "Darwin" ];then
	if [ $targetArchitecture = "i386" ];then
		compilerTarget=i386-unknown-darwin$osVersion
		compilerConfigureFlags="--enable-version-specific-runtime-libs --enable-shared --enable-threads=posix --disable-checking --disable-libunwind-exceptions --with-system-zlib --enable-__cxa_atexit"
	else
		/bin/echo "Unsupported architecture $targetArchitecture on $targetPlatform"
		exit 1
	 fi

else
	/bin/echo "Unsupported platform $targetPlatform"
	exit 1
fi


scriptResources=$installResources/scripts
toolResources=$installResources/tools



productFolder=$installFolder/$productName/$productVersion

downloadFolder=$productFolder/Downloads
sourceFolder=$productFolder/Source
interfaceFolder=$productFolder/PlatformInterfaces/$compilerTarget
buildFolder=$productFolder/build/$targetPlatform/$targetArchitecture
resultFolder=$productFolder/$targetPlatform/$targetArchitecture/$compiler-$compilerVersion
toolFolder=$productFolder/bin

PATH="$resultFolder/bin:$PATH"

downloadCompilerIfNeeded(){
	$scriptResources/downloadFilesIfNeeded.sh $downloadFolder "http://cocotron-tools-gpl3.googlecode.com/files/$compiler-$compilerVersion$compilerVersionDate.tar.bz2 http://ftp.sunet.se/pub/gnu/gmp/gmp-$gmpVersion.tar.bz2 http://cocotron-binutils-2-21.googlecode.com/files/binutils-$binutilsVersion.tar.bz2 http://cocotron-tools-gpl3.googlecode.com/files/mpfr-$mpfrVersion.tar.bz2"
	$scriptResources/unarchiveFiles.sh $downloadFolder $sourceFolder "$compiler-$compilerVersion$compilerVersionDate binutils-$binutilsVersion gmp-$gmpVersion mpfr-$mpfrVersion"
}

createWindowsInterfaceIfNeeded(){
	$scriptResources/downloadFilesIfNeeded.sh $downloadFolder "http://cocotron-tools-gpl3.googlecode.com/files/mingwrt-$mingwRuntimeVersion-mingw32-dev.tar.gz http://cocotron-tools-gpl3.googlecode.com/files/w32api-$mingwAPIVersion-mingw32-dev.tar.gz"
	$scriptResources/unarchiveFiles.sh $downloadFolder $interfaceFolder "mingwrt-$mingwRuntimeVersion-mingw32-dev w32api-$mingwAPIVersion-mingw32-dev"
}

createLinuxInterfaceIfNeeded(){
# Interface is created before script execution, see doc.s
/bin/echo "Done."
}

createFreeBSDInterfaceIfNeeded(){
# Interface is created before script execution, see doc.s
/bin/echo "Done."
}
<commit_msg>fix link to binutils<commit_after>#!/bin/sh
#Copyright (c) 2006 <NAME>
#
#Permission is hereby granted, free of charge, to any person obtaining a copy of this
#software and associated documentation files (the "Software"), to deal in the Software
#without restriction, including without limitation the rights to use, copy, modify,
#merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
#permit persons to whom the Software is furnished to do so, subject to the following
#conditions:
#
#The above copyright notice and this permission notice shall be included in all copies
#or substantial portions of the Software.
#
#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
#INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
#PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
#LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
#TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
#OR OTHER DEALINGS IN THE SOFTWARE.
#
# Inspired by the build-cross.sh script by <NAME>, et al
# Usage: install.sh <platform> <architecture> <compiler> <compiler-version> <osVersion>"
# Windows i386, Linux i386, Solaris sparc

if [ ""$1"" = "" ];then
	targetPlatform="Windows"
else
	targetPlatform=$1
fi

if [ ""$2"" = "" ];then
	targetArchitecture="i386"
else
	targetArchitecture=$2
fi

if [ ""$3"" = "" ];then
	compiler="gcc"
else
	compiler=$3
fi

gccVersion="4.3.1"

if [ ""$4"" = "" ];then
	if [ "$compiler" = "gcc" ]; then
		compilerVersion=$gccVersion
	elif [ "$compiler" = "llvm-clang" ]; then
		compilerVersion="trunk"
	else
		/bin/echo "Unknown compiler "$compiler
		exit 1
	fi
else
	compilerVersion=$4
fi

if [ ""$5"" = "" ];then
	if [ "$compiler" = "gcc" ]; then
        compilerVersionDate="-02242010"
	elif [ "$compiler" = "llvm-clang" ]; then
        compilerVersionDate="-05042011"
	else
		/bin/echo "Unknown compiler "$compiler
		exit 1
	fi
else
	compilerVersionDate="-"$5
fi

osVersion=$6

if [ ""$6"" = "" ];then
	if [ ""$6"" = "" -a ""$targetPlatform"" = "Solaris" ];then
		osVersion="2.10"
	elif [ ""$6"" = "" -a ""$targetPlatform"" = "FreeBSD" ];then
		osVersion="7"
	else
		osVersion=""
	fi
else
	osVersion=$6
fi

set -eu

cd "`dirname \"$0\"`"
installResources=`pwd`/Resources

if [ ! -d "$installResources" ];then
 /bin/echo "Unable to locate Resources directory at "$installResources
 exit 1
fi

enableLanguages="c,objc,c++,obj-c++"

installFolder=/Developer
productName=Cocotron
productVersion=1.0

binutilsVersion=2.21-20111025
mingwRuntimeVersion=3.20
mingwAPIVersion=3.17-2
gmpVersion=4.2.3
mpfrVersion=2.3.2

binutilsConfigureFlags=""

if [ $targetPlatform = "Windows" ];then
	if [ $targetArchitecture = "i386" ];then
		compilerTarget=i386-pc-mingw32msvc$osVersion
		compilerConfigureFlags=""
	else
		/bin/echo "Unsupported architecture $targetArchitecture on $targetPlatform"
	exit 1
	fi
elif [ $targetPlatform = "Linux" ];then
	if [ $targetArchitecture = "i386" ];then
		compilerTarget=i386-ubuntu-linux$osVersion
		compilerConfigureFlags="--enable-version-specific-runtime-libs --enable-shared --enable-threads=posix --disable-checking --disable-libunwind-exceptions --with-system-zlib --enable-__cxa_atexit"
	elif [ $targetArchitecture = "arm" ];then
		compilerTarget=arm-none-linux-gnueabi$osVersion
		compilerConfigureFlags="--enable-version-specific-runtime-libs --enable-shared --enable-threads=posix --disable-checking --disable-libunwind-exceptions --with-system-zlib --enable-__cxa_atexit"
	elif [ $targetArchitecture = "ppc" ];then
   	 	compilerTarget=powerpc-unknown-linux$osVersion
    		compilerConfigureFlags="--enable-version-specific-runtime-libs --enable-shared --enable-threads=posix --disable-checking --disable-libunwind-exceptions --with-system-zlib --enable-__cxa_atexit"
	elif [ $targetArchitecture = "x86_64" ];then
		compilerTarget=x86_64-pc-linux$osVersion
		compilerConfigureFlags="--enable-version-specific-runtime-libs --enable-shared --enable-threads=posix --disable-checking --disable-libunwind-exceptions --with-system-zlib --enable-__cxa_atexit"
		binutilsConfigureFlags="--enable-64-bit-bfd"
	else
		/bin/echo "Unsupported architecture $targetArchitecture on $targetPlatform"
		exit 1
	fi
elif [ $targetPlatform = "FreeBSD" ];then
	if [ $targetArchitecture = "i386" ];then
		compilerTarget=i386-pc-freebsd$osVersion
		compilerConfigureFlags="--enable-version-specific-runtime-libs --enable-shared --enable-threads=posix --disable-checking --disable-libunwind-exceptions --with-system-zlib --enable-__cxa_atexit"
	else
		/bin/echo "Unsupported architecture $targetArchitecture on $targetPlatform"
		exit 1
	fi
elif [ $targetPlatform = "Solaris" ];then
	if [ $targetArchitecture = "sparc" ];then
		compilerTarget=sparc-sun-solaris$osVersion
		compilerConfigureFlags="--enable-version-specific-runtime-libs --enable-shared --enable-threads=posix --disable-checking --disable-libunwind-exceptions --with-system-zlib --enable-__cxa_atexit"
	else
		/bin/echo "Unsupported architecture $targetArchitecture on $targetPlatform"
		exit 1
	 fi
elif [ $targetPlatform = "Darwin" ];then
	if [ $targetArchitecture = "i386" ];then
		compilerTarget=i386-unknown-darwin$osVersion
		compilerConfigureFlags="--enable-version-specific-runtime-libs --enable-shared --enable-threads=posix --disable-checking --disable-libunwind-exceptions --with-system-zlib --enable-__cxa_atexit"
	else
		/bin/echo "Unsupported architecture $targetArchitecture on $targetPlatform"
		exit 1
	 fi

else
	/bin/echo "Unsupported platform $targetPlatform"
	exit 1
fi


scriptResources=$installResources/scripts
toolResources=$installResources/tools



productFolder=$installFolder/$productName/$productVersion

downloadFolder=$productFolder/Downloads
sourceFolder=$productFolder/Source
interfaceFolder=$productFolder/PlatformInterfaces/$compilerTarget
buildFolder=$productFolder/build/$targetPlatform/$targetArchitecture
resultFolder=$productFolder/$targetPlatform/$targetArchitecture/$compiler-$compilerVersion
toolFolder=$productFolder/bin

PATH="$resultFolder/bin:$PATH"

downloadCompilerIfNeeded(){
	$scriptResources/downloadFilesIfNeeded.sh $downloadFolder "http://cocotron-tools-gpl3.googlecode.com/files/$compiler-$compilerVersion$compilerVersionDate.tar.bz2 http://ftp.sunet.se/pub/gnu/gmp/gmp-$gmpVersion.tar.bz2 http://cocotron-binutils-2-21.googlecode.com/files/binutils-$binutilsVersion.tar.gz http://cocotron-tools-gpl3.googlecode.com/files/mpfr-$mpfrVersion.tar.bz2"
	$scriptResources/unarchiveFiles.sh $downloadFolder $sourceFolder "$compiler-$compilerVersion$compilerVersionDate binutils-$binutilsVersion gmp-$gmpVersion mpfr-$mpfrVersion"
}

createWindowsInterfaceIfNeeded(){
	$scriptResources/downloadFilesIfNeeded.sh $downloadFolder "http://cocotron-tools-gpl3.googlecode.com/files/mingwrt-$mingwRuntimeVersion-mingw32-dev.tar.gz http://cocotron-tools-gpl3.googlecode.com/files/w32api-$mingwAPIVersion-mingw32-dev.tar.gz"
	$scriptResources/unarchiveFiles.sh $downloadFolder $interfaceFolder "mingwrt-$mingwRuntimeVersion-mingw32-dev w32api-$mingwAPIVersion-mingw32-dev"
}

createLinuxInterfaceIfNeeded(){
# Interface is created before script execution, see doc.s
/bin/echo "Done."
}

createFreeBSDInterfaceIfNeeded(){
# Interface is created before script execution, see doc.s
/bin/echo "Done."
}

{'fraction_non_alphanumeric': 0.12763086886130598, 'fraction_numerical': 0.019630329195898542, 'mean_word_length': 5.3626609442060085, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 20, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4716588', 'n_tokens_mistral': 4979, 'n_tokens_neox': 4623, 'n_words': 1081}