<commit_before>#
# OpenBOR - http://www.LavaLit.com
# -----------------------------------------------------------------------
# Licensed under the BSD license, see LICENSE in OpenBOR root for details.
#
# Copyright (c) 2004 - 2011 OpenBOR Team
#

#!/bin/bash
# Environments for Specific HOST_PLATFORMs
# environ.sh by SX (<EMAIL>)

export HOST_PLATFORM=$(uname -s)
export MACHINENAME=$(uname -m)
export TOOLS=../tools/bin:../tools/7-Zip:../tools/svn/bin

if [ `echo $MACHINENAME | grep -o "ppc64"` ]; then
  export MACHINE=__ppc__
elif [ `echo $MACHINENAME | grep -o "powerpc"` ]; then
  export MACHINE=__powerpc__
elif [ `echo $MACHINENAME | grep -o "M680*[0-9]0"` ]; then
  export MACHINE=__${MACHINENAME}__
elif [ `echo $MACHINENAME | grep -o "i*[0-9]86"` ]; then
  export MACHINE=__${MACHINENAME%%-*}__
elif [ `echo $MACHINENAME | grep -o "x86"` ]; then
  export MACHINE=__${MACHINENAME%%-*}__
fi

case $1 in

############################################################################
#                                                                          #
#                           PSP Environment                                #
#                                                                          #
############################################################################
1) 
   if test -e "C:/pspsdk"; then
     export PSPDEV=C:/pspsdk
     export PATH=$PATH:$PSPDEV/bin
   elif test -e "c:/Cygwin/usr/local/pspdev"; then
     export PSPDEV=c:/Cygwin/usr/local/pspdev
     export PATH=$PATH:$PSPDEV/bin:C:/Cygwin/bin
   elif test -e "/usr/local/pspdev"; then
     export PSPDEV=/usr/local/pspdev
     export PATH=$PATH:$PSPDEV/bin
   elif [ `echo $HOST_PLATFORM | grep -o "windows"` ]; then
     if [ ! -d "../tools/psp-sdk/bin" ]; then
       echo "-------------------------------------------------------"
       echo "        PSP SDK - Not Found, Installing SDK!"
       echo "-------------------------------------------------------"
       ../tools/7-Zip/7za.exe x -y ../tools/psp-sdk/psp-sdk.7z -o../tools/psp-sdk/
       echo
       echo "-------------------------------------------------------"
       echo "        PSP SDK - Installation Has Completed!"
       echo "-------------------------------------------------------"
     fi
       export PSPDEV=../tools/psp-sdk
       export PATH=$TOOLS:$PSPDEV/bin
       HOST_PLATFORM="SVN";
   fi
   if test $PSPDEV; then
     export PSPSDK=$PSPDEV/psp/sdk
     echo "-------------------------------------------------------"
     echo "          PSP SDK ($HOST_PLATFORM) Environment Loaded!"
     echo "-------------------------------------------------------"
   else
     echo "-------------------------------------------------------"
     echo "            ERROR - PSP Environment Failed"
     echo "                   SDK Installed?"
     echo "-------------------------------------------------------"
   fi
   ;;

############################################################################
#                                                                          #
#                          Nothing Here Anymore                            #
#                                                                          #
############################################################################
2)
  ;;

############################################################################
#                                                                          #
#                            GP2X Environment                              #
#                                                                          #
############################################################################
3)
   if test -e "c:/Cygwin/opt/open2x/gcc-4.1.1-glibc-2.3.6/bin/arm-open2x-linux-gcc.exe"; then
     export GP2XDEV=c:/Cygwin/opt/open2x/gcc-4.1.1-glibc-2.3.6/bin
     export SDKPATH=c:/Cygwin/opt/open2x/gcc-4.1.1-glibc-2.3.6
     export PATH=$PATH:$GP2XDEV
   elif test -e "/opt/open2x/gcc-4.1.1-glibc-2.3.6/bin/arm-open2x-linux-gcc"; then
     export GP2XDEV=/opt/open2x/gcc-4.1.1-glibc-2.3.6/bin
     export SDKPATH=/opt/open2x/gcc-4.1.1-glibc-2.3.6
     export PATH=$PATH:$GP2XDEV
   elif test -e "c:/Cygwin/opt/open2x/gcc-4.1.1-glibc-2.3.6/arm-open2x-linux/bin/arm-open2x-linux-gcc.exe"; then
     export GP2XDEV=/opt/open2x/gcc-4.1.1-glibc-2.3.6/arm-open2x-linux/bin
     export SDKPATH=/opt/open2x/gcc-4.1.1-glibc-2.3.6/arm-open2x-linux
     export PATH=$PATH:$GP2XDEV
   elif test -e "/opt/open2x/gcc-4.1.1-glibc-2.3.6/arm-open2x-linux/bin/arm-open2x-linux-gcc"; then
     export GP2XDEV=/opt/open2x/gcc-4.1.1-glibc-2.3.6/arm-open2x-linux/bin
     export SDKPATH=/opt/open2x/gcc-4.1.1-glibc-2.3.6/arm-open2x-linux
     export PATH=$PATH:$GP2XDEV
   elif [ `echo $HOST_PLATFORM | grep -o "windows"` ]; then
     if [ ! -d "../tools/gp2x-sdk/bin" ]; then
       echo "-------------------------------------------------------"
       echo "         GP2X SDK - Not Found, Installing SDK!"
       echo "-------------------------------------------------------"
       ../tools/7-Zip/7za.exe x -y ../tools/gp2x-sdk/gp2x-sdk.7z -o../tools/gp2x-sdk/
       echo
       echo "-------------------------------------------------------"
       echo "         GP2X SDK - Installation Has Completed!"
       echo "-------------------------------------------------------"
     fi
     export GP2XDEV=../tools/gp2x-sdk/bin
     export SDKPATH=../tools/gp2x-sdk/arm-open2x-linux
     export PATH=$TOOLS:$GP2XDEV
     HOST_PLATFORM="SVN"
   fi
   if test $GP2XDEV; then
     echo "-------------------------------------------------------"
     echo "           GP2X SDK ($HOST_PLATFORM) Environment Loaded!"
     echo "-------------------------------------------------------"
   else
     echo "-------------------------------------------------------"
     echo "            ERROR - GP2X Environment Failed"
     echo "                   SDK Installed?"
     echo "-------------------------------------------------------"
   fi
   ;;

############################################################################
#                                                                          #
#                           Linux Environment                              #
#                                                                          #
############################################################################
4)
   if test -e "/usr/local/i386-linux-4.1.1"; then
     export LNXDEV=/usr/local/i386-linux-4.1.1/bin
     export SDKPATH=/usr/local/i386-linux-4.1.1
     export PREFIX=i386-linux-
     export PATH=$LNXDEV:$PATH
	 export GCC_TARGET=`i386-linux-gcc -dumpmachine`
   elif [ `gcc -dumpmachine | grep -o $GCC_TARGET` ]; then
     export GCC_TARGET=`gcc -dumpmachine`
     export LNXDEV=`dirname \`which gcc\``
     export PREFIX=
     export SDKPATH=$LNXDEV/..
   elif [ `ls \`echo $PATH | sed 'y/:/ /'\` | grep -o "$GCC_TARGET-gcc" | tail -n 1` ]; then
     export TARGET_CC_NAME=`ls \`echo $PATH | sed 'y/:/ /'\` | grep -o $GCC_TARGET-gcc | tail -n 1`
     export TARGET_CC=`which $TARGET_CC_NAME`
     export GCC_TARGET=`$TARGET_CC -dumpmachine`
     export LNXDEV=`dirname $TARGET_CC`
     export PREFIX=`echo $TARGET_CC_NAME | sed 's/gcc$//'`
     export SDKPATH=$LNXDEV/..
   fi
   if test $LNXDEV; then
     echo "-------------------------------------------------------"
     echo "   Linux $TARGET_ARCH SDK ($GCC_TARGET) Environment Loaded!"
     echo "-------------------------------------------------------"
   else
     echo "-------------------------------------------------------"
     echo "     ERROR - Linux $TARGET_ARCH Environment Failed"
     echo "                 SDK Installed?"
     echo "-------------------------------------------------------"
   fi
   ;;

############################################################################
#                                                                          #
#                           Windows Environment                            #
#                                                                          #
############################################################################
5)<commit_msg>r3211| Fixed linux environment check for host_platform check.<commit_after>#
# OpenBOR - http://www.Lava<EMAIL>
# -----------------------------------------------------------------------
# Licensed under the BSD license, see LICENSE in OpenBOR root for details.
#
# Copyright (c) 2004 - 2011 OpenBOR Team
#

#!/bin/bash
# Environments for Specific HOST_PLATFORMs
# environ.sh by SX (<EMAIL>)

export HOST_PLATFORM=$(uname -s)
export MACHINENAME=$(uname -m)
export TOOLS=../tools/bin:../tools/7-Zip:../tools/svn/bin

if [ `echo $MACHINENAME | grep -o "ppc64"` ]; then
  export MACHINE=__ppc__
elif [ `echo $MACHINENAME | grep -o "powerpc"` ]; then
  export MACHINE=__powerpc__
elif [ `echo $MACHINENAME | grep -o "M680*[0-9]0"` ]; then
  export MACHINE=__${MACHINENAME}__
elif [ `echo $MACHINENAME | grep -o "i*[0-9]86"` ]; then
  export MACHINE=__${MACHINENAME%%-*}__
elif [ `echo $MACHINENAME | grep -o "x86"` ]; then
  export MACHINE=__${MACHINENAME%%-*}__
fi

case $1 in

############################################################################
#                                                                          #
#                           PSP Environment                                #
#                                                                          #
############################################################################
1) 
   if test -e "C:/pspsdk"; then
     export PSPDEV=C:/pspsdk
     export PATH=$PATH:$PSPDEV/bin
   elif test -e "c:/Cygwin/usr/local/pspdev"; then
     export PSPDEV=c:/Cygwin/usr/local/pspdev
     export PATH=$PATH:$PSPDEV/bin:C:/Cygwin/bin
   elif test -e "/usr/local/pspdev"; then
     export PSPDEV=/usr/local/pspdev
     export PATH=$PATH:$PSPDEV/bin
   elif [ `echo $HOST_PLATFORM | grep -o "windows"` ]; then
     if [ ! -d "../tools/psp-sdk/bin" ]; then
       echo "-------------------------------------------------------"
       echo "        PSP SDK - Not Found, Installing SDK!"
       echo "-------------------------------------------------------"
       ../tools/7-Zip/7za.exe x -y ../tools/psp-sdk/psp-sdk.7z -o../tools/psp-sdk/
       echo
       echo "-------------------------------------------------------"
       echo "        PSP SDK - Installation Has Completed!"
       echo "-------------------------------------------------------"
     fi
       export PSPDEV=../tools/psp-sdk
       export PATH=$TOOLS:$PSPDEV/bin
       HOST_PLATFORM="SVN";
   fi
   if test $PSPDEV; then
     export PSPSDK=$PSPDEV/psp/sdk
     echo "-------------------------------------------------------"
     echo "          PSP SDK ($HOST_PLATFORM) Environment Loaded!"
     echo "-------------------------------------------------------"
   else
     echo "-------------------------------------------------------"
     echo "            ERROR - PSP Environment Failed"
     echo "                   SDK Installed?"
     echo "-------------------------------------------------------"
   fi
   ;;

############################################################################
#                                                                          #
#                          Nothing Here Anymore                            #
#                                                                          #
############################################################################
2)
  ;;

############################################################################
#                                                                          #
#                            GP2X Environment                              #
#                                                                          #
############################################################################
3)
   if test -e "c:/Cygwin/opt/open2x/gcc-4.1.1-glibc-2.3.6/bin/arm-open2x-linux-gcc.exe"; then
     export GP2XDEV=c:/Cygwin/opt/open2x/gcc-4.1.1-glibc-2.3.6/bin
     export SDKPATH=c:/Cygwin/opt/open2x/gcc-4.1.1-glibc-2.3.6
     export PATH=$PATH:$GP2XDEV
   elif test -e "/opt/open2x/gcc-4.1.1-glibc-2.3.6/bin/arm-open2x-linux-gcc"; then
     export GP2XDEV=/opt/open2x/gcc-4.1.1-glibc-2.3.6/bin
     export SDKPATH=/opt/open2x/gcc-4.1.1-glibc-2.3.6
     export PATH=$PATH:$GP2XDEV
   elif test -e "c:/Cygwin/opt/open2x/gcc-4.1.1-glibc-2.3.6/arm-open2x-linux/bin/arm-open2x-linux-gcc.exe"; then
     export GP2XDEV=/opt/open2x/gcc-4.1.1-glibc-2.3.6/arm-open2x-linux/bin
     export SDKPATH=/opt/open2x/gcc-4.1.1-glibc-2.3.6/arm-open2x-linux
     export PATH=$PATH:$GP2XDEV
   elif test -e "/opt/open2x/gcc-4.1.1-glibc-2.3.6/arm-open2x-linux/bin/arm-open2x-linux-gcc"; then
     export GP2XDEV=/opt/open2x/gcc-4.1.1-glibc-2.3.6/arm-open2x-linux/bin
     export SDKPATH=/opt/open2x/gcc-4.1.1-glibc-2.3.6/arm-open2x-linux
     export PATH=$PATH:$GP2XDEV
   elif [ `echo $HOST_PLATFORM | grep -o "windows"` ]; then
     if [ ! -d "../tools/gp2x-sdk/bin" ]; then
       echo "-------------------------------------------------------"
       echo "         GP2X SDK - Not Found, Installing SDK!"
       echo "-------------------------------------------------------"
       ../tools/7-Zip/7za.exe x -y ../tools/gp2x-sdk/gp2x-sdk.7z -o../tools/gp2x-sdk/
       echo
       echo "-------------------------------------------------------"
       echo "         GP2X SDK - Installation Has Completed!"
       echo "-------------------------------------------------------"
     fi
     export GP2XDEV=../tools/gp2x-sdk/bin
     export SDKPATH=../tools/gp2x-sdk/arm-open2x-linux
     export PATH=$TOOLS:$GP2XDEV
     HOST_PLATFORM="SVN"
   fi
   if test $GP2XDEV; then
     echo "-------------------------------------------------------"
     echo "           GP2X SDK ($HOST_PLATFORM) Environment Loaded!"
     echo "-------------------------------------------------------"
   else
     echo "-------------------------------------------------------"
     echo "            ERROR - GP2X Environment Failed"
     echo "                   SDK Installed?"
     echo "-------------------------------------------------------"
   fi
   ;;

############################################################################
#                                                                          #
#                           Linux Environment                              #
#                                                                          #
############################################################################
4)
   if test -e "/usr/local/i386-linux-4.1.1"; then
     export LNXDEV=/usr/local/i386-linux-4.1.1/bin
     export SDKPATH=/usr/local/i386-linux-4.1.1
     export PREFIX=i386-linux-
     export PATH=$LNXDEV:$PATH
     export GCC_TARGET=`i386-linux-gcc -dumpmachine`
   elif [ -z "${GCC_TARGET+xxx}" ] || [ `gcc -dumpmachine | grep -o "$GCC_TARGET"` ]; then
     export GCC_TARGET=`gcc -dumpmachine`
     export LNXDEV=`dirname \`which gcc\``
     export PREFIX=
     export SDKPATH=$LNXDEV/..
   elif [ `ls \`echo $PATH | sed 'y/:/ /'\` | grep -o "$GCC_TARGET-gcc" | tail -n 1` ]; then
     export TARGET_CC_NAME=`ls \`echo $PATH | sed 'y/:/ /'\` | grep -o "$GCC_TARGET-gcc" | tail -n 1`
     export TARGET_CC=`which $TARGET_CC_NAME`
     export GCC_TARGET=`$TARGET_CC -dumpmachine`
     export LNXDEV=`dirname $TARGET_CC`
     export PREFIX=`echo $TARGET_CC_NAME | sed 's/gcc$//'`
     export SDKPATH=$LNXDEV/..
   fi
   if test $LNXDEV; then
     echo "-------------------------------------------------------"
     echo "   Linux $TARGET_ARCH SDK ($GCC_TARGET) Environment Loaded!"
     echo "-------------------------------------------------------"
   else
     echo "-------------------------------------------------------"
     echo "     ERROR - Linux $TARGET_ARCH Environment Failed"
     echo "                 SDK Installed?"
     echo "-------------------------------------------------------"
   fi
   ;;

############################################################################
#                                                                          #
#                           Windows Environment                            #
#                                                                          #
############################################################################
5)
{'fraction_non_alphanumeric': 0.337212845042959, 'fraction_numerical': 0.02193650600207178, 'mean_word_length': 1.1677453440760799, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 60, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3648883', 'n_tokens_mistral': 4735, 'n_tokens_neox': 4330, 'n_words': 828}