Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setup.sh: added support for multiple distros #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 39 additions & 2 deletions setup.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,40 @@
#!/bin/sh
#!/bin/env bash

if [ -f /etc/os-release ]; then
. /etc/os-release
DIST=$NAME
elif type lsb_release >/dev/null 2>&1; then
DIST=$(lsb_release -si)
elif [ -f /etc/lsb-release ]; then
. /etc/lsb-release
DIST=$DISTRIB_ID
elif [ -f /etc/debian_version ]; then
DIST=Debian
elif [ -f /etc/SuSe-release ]; then
DIST=SLES
fi

case "$DIST" in
"Arch Linux")
sudo pacman -S --needed --noconfirm aarch64-linux-gnu-gcc arm-none-eabi-gcc
echo "Arch does not provide an up-to-date PowerPC gcc compiler, you will have to manually install one."
;;
"Debian GNU/Linux" | "Ubuntu")
sudo apt install gcc-aarch64-linux-gnu gcc-arm-linux-gnueabi gcc-powerpc-linux-gnu
;;
"SLES")
# zypper addrepo https://download.opensuse.org/repositories/openSUSE:Factory/standard/openSUSE:Factory.refresh
# zypper refresh
# zypper install cross-aarch64-gcc7
echo "SUSE is not currently supported due to packaging errors"
exit
;; #not needed but included for symmetry
"Fedora Linux" | "Red Hat Enterprise Linux")
dnf -y install gcc-aarch64-linux-gnu.$(uname -m) arm-none-eabi-gcc-cs.$(uname -m) gcc-powerpc64-linux-gnu.$(uname -m)
;;
*)
echo -E "Script does not currently support installation for $DIST.\nPlease open an issue on the GitHub page detailing what distribution you are using."
;;
esac


sudo apt install gcc-aarch64-linux-gnu gcc-arm-linux-gnueabi gcc-powerpc-linux-gnu