From f6995196e3bfa2b8ac069954acb7e169bcf7fb7b Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Wed, 11 Jul 2012 16:25:54 +0200 Subject: [PATCH] config/functions: add check for builddir and exit if building in /usr which we dont support Signed-off-by: Stephan Raue --- config/functions | 14 ++++++++++++++ config/path | 1 + 2 files changed, 15 insertions(+) diff --git a/config/functions b/config/functions index 6bec74fc11..c449af22c0 100644 --- a/config/functions +++ b/config/functions @@ -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 diff --git a/config/path b/config/path index 37d1eb4fe7..52c5fe8eb3 100644 --- a/config/path +++ b/config/path @@ -123,6 +123,7 @@ fi VERSION_SUFFIX=$TARGET_ARCH . config/functions +check_path check_config setup_toolchain target