<commit_before># Copyright © 2012, Intel Corporation.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU Lesser General Public License,
# version 2.1, as published by the Free Software Foundation.
#
# This program is distributed in the hope it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU Lesser General Public License along with
# this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St 
# - Fifth Floor, Boston, MA 02110-1301 USA

if [ ! -d $PWD/install ]; then
  echo "Please source this script from the top level directory of the clutter-android project"
  exit 1
fi


SOURCES="$PWD/sources"
PREFIX="$PWD/install"
LIBDIR="$PWD/install/lib"

export CFLAGS=
export CC=arm-linux-androideabi-gcc
export CXX=arm-linux-androideabi-g++

export C_INCLUDE_PATH=$PREFIX/include
export CPLUS_INCLUDE_PATH=$PREFIX/include

export ANDROID_SDK_DIR="$PWD/android-sdk-linux"
export ANDROID_NDK_DIR=`find $PWD/* -maxdepth 0 -type d -name 'android-ndk-r*'`
export ANDROID_NDK_TOOLCHAIN="$PWD/toolchain"

export gl_cv_header_working_stdint_h=yes

# remove other langauges
export LINGUAS=C

# avoid picking up system libraries
export PKG_CONFIG_LIBDIR=/foo/bar
export PKG_CONFIG_PATH=$LIBDIR/pkgconfig

export PATH="$PATH:$ANDROID_NDK_DIR:$ANDROID_NDK_TOOLCHAIN/bin"
export PATH="$PATH:$ANDROID_SDK_DIR/tools/:$ANDROID_SDK_DIR/platform-tools"

export NDK_MODULE_PATH=$PWD

export PKG_CONFIG="pkg-config --define-variable=glib_genmarshal=/usr/bin/glib-genmarshal --define-variable=gobject_query=/usr/bin/gobject-query --define-variable=glib_mkenums=/usr/bin/glib-mkenums --define-variable=glib_compile_resources=/usr/bin/glib-compile-resources"<commit_msg>set the ANDROID_SDK_DIR, NDK and TOOLCHAIN vars only if unset. And don't add to PATH if already there<commit_after># Copyright © 2012, Intel Corporation.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU Lesser General Public License,
# version 2.1, as published by the Free Software Foundation.
#
# This program is distributed in the hope it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU Lesser General Public License along with
# this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St
# - Fifth Floor, Boston, MA 02110-1301 USA

if [ ! -d $PWD/install ]; then
  echo "Please source this script from the top level directory of the clutter-android project"
  exit 1
fi

pathadd() {
    if [ -d "$1" ] && [[ ":$PATH:" != *":$1:"* ]]; then
        export PATH="${PATH:+"$PATH:"}$1"
    fi
}

SOURCES="$PWD/sources"
PREFIX="$PWD/install"
LIBDIR="$PWD/install/lib"

export CFLAGS=
export CC=arm-linux-androideabi-gcc
export CXX=arm-linux-androideabi-g++

export C_INCLUDE_PATH=$PREFIX/include
export CPLUS_INCLUDE_PATH=$PREFIX/include

[[ ! ${ANDROID_SDK_DIR:+isset} ]] && export ANDROID_SDK_DIR="$PWD/android-sdk-linux"
[[ ! ${ANDROID_NDK_DIR:+isset} ]] && export ANDROID_NDK_DIR=`find $PWD/* -maxdepth 0 -type d -name 'android-ndk-r*'`
[[ ! ${ANDROID_NDK_TOOLCHAIN:+isset} ]] && export ANDROID_NDK_TOOLCHAIN="$PWD/toolchain"

export gl_cv_header_working_stdint_h=yes

# remove other langauges
export LINGUAS=C

# avoid picking up system libraries
export PKG_CONFIG_LIBDIR=/foo/bar
export PKG_CONFIG_PATH=$LIBDIR/pkgconfig

pathadd "$ANDROID_NDK_DIR"
pathadd "$ANDROID_NDK_TOOLCHAIN/bin"
pathadd "$ANDROID_SDK_DIR/tools"
pathadd "$ANDROID_SDK_DIR/platform-tools"

export NDK_MODULE_PATH=$PWD

export PKG_CONFIG="pkg-config --define-variable=glib_genmarshal=/usr/bin/glib-genmarshal --define-variable=gobject_query=/usr/bin/gobject-query --define-variable=glib_mkenums=/usr/bin/glib-mkenums --define-variable=glib_compile_resources=/usr/bin/glib-compile-resources"
{'fraction_non_alphanumeric': 0.1057922450933461, 'fraction_numerical': 0.009813307802776448, 'mean_word_length': 5.341426403641882, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, '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': '7410385', 'n_tokens_mistral': 1438, 'n_tokens_neox': 1351, 'n_words': 405}