summaryrefslogtreecommitdiff
path: root/project/config/cfgdefs.sh
diff options
context:
space:
mode:
Diffstat (limited to 'project/config/cfgdefs.sh')
-rw-r--r--project/config/cfgdefs.sh37
1 files changed, 31 insertions, 6 deletions
diff --git a/project/config/cfgdefs.sh b/project/config/cfgdefs.sh
index 34bd609..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
@@ -34,16 +51,17 @@ cfgdefs_bootstrap()
cfgdefs_objs=
- cfgdefs_utilsrc='make.c'
+ cfgdefs_utilsrc='main.c'
- cfgdefs_sources="arch.c buf.c compat.c cond.c dir.c enum.c for.c hash.c job.c"
- cfgdefs_sources="$cfgdefs_sources lst.c main.c make_malloc.c meta.c metachar.c parse.c"
+ cfgdefs_sources="arch.c buf.c compat.c cond.c dir.c for.c hash.c job.c"
+ cfgdefs_sources="$cfgdefs_sources lst.c make.c make_malloc.c meta.c metachar.c parse.c"
cfgdefs_sources="$cfgdefs_sources str.c suff.c targ.c trace.c util.c var.c"
cfgdefs_cflags=
cfgdefs_cflags="$cfgdefs_cflags -I${mb_source_dir}/src/internal"
cfgdefs_cflags="$cfgdefs_cflags -D_PATH_DEFSYSPATH=\"${mb_source_dir}/mk\""
cfgdefs_cflags="$cfgdefs_cflags $cfgdefs_added_defs"
+ cfgdefs_cflags="$cfgdefs_cflags -D_XOPEN_SOURCE=700"
cfgtest_native_section
@@ -64,7 +82,8 @@ cfgdefs_bootstrap()
output_step_prolog 'compiling' "./bootstrap/${obj}"
- printf '\n$ %s %s\n' "$mb_native_cc $cfgdefs_cflags" '\' >&3
+ printf '\n$ %s %s\n' "$mb_native_cc $mb_native_cflags" '\' >&3
+ printf '\n$ %s\n' "$cfgdefs_cflags" '\' >&3
printf '\t-c %s %s\n' "$mb_source_dir/src/${src}" '\' >&3
printf '\t-o %s %s\n\n\n' "$mb_pwd/bootstrap/${obj}" >&3
@@ -82,7 +101,8 @@ cfgdefs_bootstrap()
output_step_prolog 'compiling' "./bootstrap/${obj}"
- printf '\n$ %s %s\n' "$mb_native_cc $cfgdefs_cflags" '\' >&3
+ printf '\n$ %s %s\n' "$mb_native_cc $mb_native_cflags" '\' >&3
+ printf '\n$ %s\n' "$cfgdefs_cflags" '\' >&3
printf '\t-c %s %s\n' "$mb_source_dir/src/logic/${src}" '\' >&3
printf '\t-o %s %s\n\n\n' "$mb_pwd/bootstrap/${obj}" >&3
@@ -118,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
}