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 8, 2024
1 parent 4cce38c commit cb31890
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
12 changes: 12 additions & 0 deletions ronin-dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,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 if there's no C compiler on the system.
#
Expand Down Expand Up @@ -492,6 +503,7 @@ function parse_options()
parse_options "$@" || exit $?
detect_system
auto_install_git
auto_install_binutils
auto_install_cc
auto_install_cpp
auto_install_make
Expand Down
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 @@ -356,7 +367,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 @@ -426,6 +437,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 cb31890

Please sign in to comment.