summaryrefslogtreecommitdiff
path: root/project/config
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2018-12-09 01:37:46 -0500
committermidipix <writeonce@midipix.org>2018-12-09 01:56:32 -0500
commitd1a04d855e8c28336a38a5d61e937996ab4b2ae4 (patch)
tree2502c86d902ee9fbc2a79b26280c893759245ddc /project/config
parent2d05b886690a0df4f148089099ad8816b64020b8 (diff)
downloadsbpython2-d1a04d855e8c28336a38a5d61e937996ab4b2ae4.tar.bz2
sbpython2-d1a04d855e8c28336a38a5d61e937996ab4b2ae4.tar.xz
project: added custom configuration bits (cfgdefs.sh and friends).
Diffstat (limited to 'project/config')
-rw-r--r--project/config/cfgdefs.in1
-rw-r--r--project/config/cfgdefs.sh55
-rw-r--r--project/config/cfgdefs.usage0
3 files changed, 56 insertions, 0 deletions
diff --git a/project/config/cfgdefs.in b/project/config/cfgdefs.in
new file mode 100644
index 0000000..7656eed
--- /dev/null
+++ b/project/config/cfgdefs.in
@@ -0,0 +1 @@
+PYCOMPILE_CFGHOST = @pycompile_cfghost@
diff --git a/project/config/cfgdefs.sh b/project/config/cfgdefs.sh
new file mode 100644
index 0000000..00dbde5
--- /dev/null
+++ b/project/config/cfgdefs.sh
@@ -0,0 +1,55 @@
+# in projects where [ $mb_use_custom_cfgdefs = yes ],
+# cfgdefs.sh is invoked from within ./configure via
+# . $mb_project_dir/project/cfgdefs.sh
+
+# a successful return from cfgdefs.sh will be followed
+# by a second invocation of the config_copy() function,
+# reflecting any changes to common config variables
+# made by cfgdefs.sh.
+
+# finally, cfgdefs.sh may update the contents of the
+# build-time-generated cfgdefs.mk.
+
+
+# no custom switches yet
+for arg ; do
+ case "$arg" in
+ *)
+ error_msg ${arg#}: "unsupported config argument."
+ exit 2
+ esac
+done
+
+
+# cfghost: target
+if [ -z "$mb_cfghost" ]; then
+ case "$mb_cchost" in
+ x86_64-*-linux | x86_64-*-linux-* | x86_64-linux-* )
+ mb_cfghost=x86_64-linux ;;
+
+ x86_64-*-midipix | x86_64-*-midipix-* | x86_64-midipix-* )
+ mb_cfghost=x86_64-midipix ;;
+ esac
+fi
+
+
+# cfghost: (native) pycompile
+mb_pycompile_cfghost=$($mb_native_cc -dumpmachine)
+
+case "$mb_pycompile_cfghost" in
+ x86_64-*-linux | x86_64-*-linux-* | x86_64-linux-* )
+ mb_pycompile_cfghost=x86_64-linux ;;
+
+ x86_64-*-midipix | x86_64-*-midipix-* | x86_64-midipix-* )
+ mb_pycompile_cfghost=x86_64-midipix ;;
+esac
+
+
+# update cfgdefs.mk
+sed -e 's^@pycompile_cfghost@^'"$mb_pycompile_cfghost"'^g' \
+ $mb_project_dir/project/config/cfgdefs.in \
+ > $mb_pwd/cfgdefs.mk || exit 2
+
+
+# all done
+return 0
diff --git a/project/config/cfgdefs.usage b/project/config/cfgdefs.usage
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/project/config/cfgdefs.usage