config/functions: add support to check for valid PROJECT and ARCH, cosmetics

Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
Stephan Raue 2012-01-30 23:13:30 +01:00
parent 1fda70a58f
commit cde9b87110
2 changed files with 166 additions and 139 deletions

View File

@ -191,6 +191,37 @@ fix_module_depends() {
$OBJCOPY --remove-section=.modinfo --add-section=.modinfo=new.modinfo --set-section-flags .modinfo=contents,alloc,load,readonly,data ${MODULE}_orig ${MODULE}
rm new.modinfo*
}
check_config() {
dashes="==========================="
if [ ! -d $PROJECT_DIR/$PROJECT ]; then
check_project="$check_project\n $dashes$dashes$dashes"
check_project="$check_project\n ERROR: Project not found, use a valid project or create a new config"
check_project="$check_project\n $dashes$dashes$dashes"
check_project="$check_project\n\n Valid projects:"
for projects in $PROJECT_DIR/*; do
check_project="$check_project\n - $(basename $projects)"
done
echo -e $check_project
exit 1
fi
if [ ! -f $PROJECT_DIR/$PROJECT/linux/linux.$TARGET_ARCH.conf ]; then
check_arch="$check_arch\n $dashes$dashes$dashes"
check_arch="$check_arch\n ERROR: Architecture not found, use a valid Architecture"
check_arch="$check_arch\n for your project or create a new config"
check_arch="$check_arch\n $dashes$dashes$dashes"
check_arch="$check_arch\n\n Valid Architectures for your project: $PROJECT"
for arch in $PROJECT_DIR/$PROJECT/linux/*.conf; do
check_arch="$check_arch\n - $(echo $arch | cut -f2 -d".")"
done
echo -e $check_arch
exit 1
fi
}
show_config() {
dashes="==========================="
config_message="$config_message\n $dashes$dashes$dashes"
@ -334,11 +365,3 @@ config_message="$config_message\n\n\n"
echo -e $config_message
}

View File

@ -10,7 +10,9 @@ set -e
ADDONS=addons
# include ARCH specific options
if [ -f config/arch.$TARGET_ARCH ]; then
. config/arch.$TARGET_ARCH
fi
HOST_NAME=`$LOCAL_CC -dumpmachine`
TARGET_NAME=$(echo $TARGET_SUBARCH | sed -e "s,-,,")-openelec-linux-gnu${TARGET_ABI}
@ -117,6 +119,8 @@ fi
VERSION_SUFFIX=$TARGET_ARCH
. config/functions
check_config
setup_toolchain target
SILENT_OUT=3