From 338de210c24c6c3e39ffc076f1ae6839cafc905a Mon Sep 17 00:00:00 2001 From: Postmodern Date: Sun, 5 May 2024 16:08:06 -0700 Subject: [PATCH] Auto-install binutils for the `ld` and `ar` commands. --- ronin-install.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/ronin-install.sh b/ronin-install.sh index 39bda5a..f8ee1f3 100755 --- a/ronin-install.sh +++ b/ronin-install.sh @@ -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. # @@ -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 @@ -416,6 +427,7 @@ function parse_options() parse_options "$@" || exit $? detect_system +auto_install_binutils auto_install_cc auto_install_cpp auto_install_make