summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--project/config/cfgdefs.in10
-rw-r--r--project/config/cfgdefs.sh24
-rw-r--r--project/extras.mk3
3 files changed, 34 insertions, 3 deletions
diff --git a/project/config/cfgdefs.in b/project/config/cfgdefs.in
index e69de29..c63687f 100644
--- a/project/config/cfgdefs.in
+++ b/project/config/cfgdefs.in
@@ -0,0 +1,10 @@
+# cfgdefs.mk: build project definitions and variable assignments,
+# generated by the project-specific cfgdefs.sh.
+
+# changes made to this file will be gone the next time
+# you run ./configure.
+
+# for persistent post-configure, ad-hoc changes to the
+# build project, use usrdefs.mk instead.
+
+CFLAGS_CONFIG += -D_PATH_DEFSYSPATH=\"@cfgdefs_default_sys_path@\"
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
}
diff --git a/project/extras.mk b/project/extras.mk
index a5357a0..79b0dd2 100644
--- a/project/extras.mk
+++ b/project/extras.mk
@@ -1,5 +1,4 @@
-SYS_MK_DIR = $(DATADIR)/mk
-CFLAGS_CONFIG += -D_PATH_DEFSYSPATH=\"$(SYS_MK_DIR)\"
+SYS_MK_DIR = $(DATADIR)/mk
MK_FILES = \
$(SOURCE_DIR)/mk/ChangeLog \