Skip to content

Commit

Permalink
Auto-install binutils for the ld and ar commands.
Browse files Browse the repository at this point in the history
  • Loading branch information
postmodern committed May 5, 2024
1 parent 0654d2f commit 338de21
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion ronin-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,17 @@ function auto_install_rubygems()
detect_rubygems_install_dir
}

#
# Installs binutils for ld and ar commands, if they aren't already installed.
#
function auto_install_binutils()
{
if ! command -v ld >/dev/null || ! command -v ar >/dev/null; then
install_packages binutils || \
fail "Failed to install binutils!"
fi
}

#
# Install gcc or clang if there's no C compiler on the system.
#
Expand Down Expand Up @@ -343,7 +354,7 @@ function install_dependencies()
{
case "$package_manager" in
dnf|yum)libraries=(libyaml-devel git zip) ;;
termux) libraries=(binutils libxml2 libxslt git zip) ;;
termux) libraries=(libxml2 libxslt git zip) ;;
*) libraries=(git zip) ;;
esac

Expand Down Expand Up @@ -416,6 +427,7 @@ function parse_options()

parse_options "$@" || exit $?
detect_system
auto_install_binutils
auto_install_cc
auto_install_cpp
auto_install_make
Expand Down

0 comments on commit 338de21

Please sign in to comment.