diff options
Diffstat (limited to 'project/config/cfgdefs.sh')
-rw-r--r-- | project/config/cfgdefs.sh | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/project/config/cfgdefs.sh b/project/config/cfgdefs.sh index 2ff7631..a4e859f 100644 --- a/project/config/cfgdefs.sh +++ b/project/config/cfgdefs.sh @@ -17,10 +17,27 @@ for arg ; do case "$arg" in + --with-default-sys-path=*) + cfgdefs_default_sys_path=${arg##*=} + ;; *) error_msg ${arg#}: "unsupported config argument." exit 2 esac + + case "${cfgdefs_default_sys_path:-empty}" in + /*) + ;; + + empty) + error_msg "$mb_script: --with-default-sys-path: empty paths are not allowed." + exit 2 + ;; + + *) + error_msg "$mb_script: --with-default-sys-path: relative paths are not allowed." + exit 2 + esac done @@ -121,7 +138,12 @@ cfgdefs_bootstrap() cfgdefs_output_custom_defs() { - cat "$mb_project_dir/project/config/cfgdefs.in" > cfgdefs.mk + cfgdefs_default_sys_path="${cfgdefs_default_sys_path:-/usr/share/mk}" + + sed \ + -e 's#@cfgdefs_default_sys_path@#'"$cfgdefs_default_sys_path"'#g' \ + "$mb_project_dir/project/config/cfgdefs.in" \ + > cfgdefs.mk } |