config/functions: add check for builddir and exit if building in /usr which we dont support

Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
Stephan Raue 2012-07-11 16:25:54 +02:00
parent 0a78fc9396
commit f6995196e3
2 changed files with 15 additions and 0 deletions

View File

@ -186,6 +186,20 @@ fix_module_depends() {
rm new.modinfo*
}
check_path() {
dashes="==========================="
if [ "${PWD##/usr}" != "${PWD}" ]; then
check_pathmessage="$check_pathmessage\n $dashes$dashes$dashes"
check_pathmessage="$check_pathmessage\n ERROR: You try to build inside /usr"
check_pathmessage="$check_pathmessage\n $dashes$dashes$dashes"
check_pathmessage="$check_pathmessage\n This is not supported with our buildsystem."
check_pathmessage="$check_pathmessage\n Please use another dir (for example your \$HOME) to build $DISTRONAME"
echo -e $check_pathmessage
exit 1
fi
}
check_config() {
dashes="==========================="
if [ ! -d $PROJECT_DIR/$PROJECT ]; then

View File

@ -123,6 +123,7 @@ fi
VERSION_SUFFIX=$TARGET_ARCH
. config/functions
check_path
check_config
setup_toolchain target