aboutsummaryrefslogtreecommitdiff
path: root/etc/environments
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-10-03 12:34:08 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2022-10-03 12:34:08 +0200
commit3cfd94181841bd9acacc4704a07bf17d899aa103 (patch)
tree12aba3254f152f9c9f49e8a855d42ed5b6936070 /etc/environments
parentedc3a2150066fa8a594f7393e6dbe0d3048e0d07 (diff)
Make default environments arch-specific, add one for aarch64
Diffstat (limited to 'etc/environments')
-rwxr-xr-xetc/environments/default-aarch6440
-rwxr-xr-xetc/environments/default-x86_64 (renamed from etc/environments/default)2
2 files changed, 41 insertions, 1 deletions
diff --git a/etc/environments/default-aarch64 b/etc/environments/default-aarch64
new file mode 100755
index 0000000..3fb5ccb
--- /dev/null
+++ b/etc/environments/default-aarch64
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+# file : etc/environments/default-aarch64
+# license : MIT; see accompanying LICENSE file
+
+#
+# Environment setup script for C/C++ compilation.
+#
+
+# NOTE: don't forget to adjust the target mode selection below.
+#
+c=gcc
+cxx=g++
+
+# $1 - target
+# $2 - bbot executable (if absent, then run $SHELL)
+# $3+ - bbot options
+
+set -e # Exit on errors.
+
+# Based on target determine what we are building.
+#
+mode=
+case "$1" in
+ aarch64-*)
+ ;;
+ *)
+ echo "unknown target: '$1'" 1>&2
+ exit 1
+ ;;
+esac
+shift
+
+if test $# -ne 0; then
+ exec "$@" cc config.c="$c $mode" config.cxx="$cxx $mode"
+else
+ echo "config.c=$c $mode" 1>&2
+ echo "config.cxx=$cxx $mode" 1>&2
+ exec $SHELL -i
+fi
diff --git a/etc/environments/default b/etc/environments/default-x86_64
index f5a5b3c..e324fa1 100755
--- a/etc/environments/default
+++ b/etc/environments/default-x86_64
@@ -1,6 +1,6 @@
#!/bin/sh
-# file : etc/environments/default
+# file : etc/environments/default-x86_64
# license : MIT; see accompanying LICENSE file
#