From 3cfd94181841bd9acacc4704a07bf17d899aa103 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 3 Oct 2022 12:34:08 +0200 Subject: Make default environments arch-specific, add one for aarch64 --- etc/environments/default | 44 ---------------------------------------- etc/environments/default-aarch64 | 40 ++++++++++++++++++++++++++++++++++++ etc/environments/default-x86_64 | 44 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 84 insertions(+), 44 deletions(-) delete mode 100755 etc/environments/default create mode 100755 etc/environments/default-aarch64 create mode 100755 etc/environments/default-x86_64 (limited to 'etc') diff --git a/etc/environments/default b/etc/environments/default deleted file mode 100755 index f5a5b3c..0000000 --- a/etc/environments/default +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/sh - -# file : etc/environments/default -# 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 - x86_64-*) - #mode=-m64 - ;; - i?86-*) - mode=-m32 - ;; - *) - 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-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-x86_64 b/etc/environments/default-x86_64 new file mode 100755 index 0000000..e324fa1 --- /dev/null +++ b/etc/environments/default-x86_64 @@ -0,0 +1,44 @@ +#!/bin/sh + +# file : etc/environments/default-x86_64 +# 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 + x86_64-*) + #mode=-m64 + ;; + i?86-*) + mode=-m32 + ;; + *) + 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 -- cgit v1.1