Skip to content

Commit

Permalink
Merge pull request #730 from sourceryinstitute/download-gcc-release-t…
Browse files Browse the repository at this point in the history
…ar-balls

feat(install.sh): download GCC release tar balls
  • Loading branch information
everythingfunctional committed Mar 17, 2021
2 parents 5c4bd62 + 02dce3e commit ef8069d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
6 changes: 2 additions & 4 deletions prerequisites/build-functions/set_or_print_downloader.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ set_or_print_downloader()

package_name="${arg_p:-${arg_D:-${arg_P:-${arg_U:-${arg_V}}}}}"

if [[ "${package_name}" == "gcc" ]]; then
arg_b=${arg_b:-releases/gcc-${version_to_build}}
elif [[ "${package_name}" == "ofp" ]]; then
if [[ "${package_name}" == "ofp" ]]; then
"${OPENCOARRAYS_SRC_DIR}/prerequisites/install-ofp.sh" "${@}"
exit 0
fi
Expand All @@ -36,7 +34,7 @@ set_or_print_downloader()
tried="curl, wget, and ftp"
fi

if [[ "${package_name}" == "gcc" ]]; then
if [[ "${package_name}" == "gcc" && ! -z ${arg_b:-} ]]; then
if type git &> /dev/null; then
fetch=git
else
Expand Down
11 changes: 9 additions & 2 deletions prerequisites/build-functions/set_or_print_url.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ else
major_minor="${version_to_build%.*}"
fi
package_url_head=(
"gcc;https://gcc.gnu.org/git/"
"gcc;https://ftp.gnu.org/gnu/gcc/gcc-${version_to_build-}/"
"wget;https://ftpmirror.gnu.org/gnu/wget/"
"m4;https://ftpmirror.gnu.org/gnu/m4/"
"pkg-config;https://pkgconfig.freedesktop.org/releases/"
Expand All @@ -44,9 +44,13 @@ else
fi
done

if [[ ! -z ${arg_b:-} && ${package_to_build} == 'gcc' ]]; then
url_head="https://gcc.gnu.org/git/"
fi

# Set differing tails for GCC release downloads versus development branch checkouts
package_url_tail=(
"gcc;gcc"
"gcc;gcc-${version_to_build-}.tar.gz"
"wget;wget-${version_to_build-}.tar.gz"
"m4;m4-${version_to_build-}.tar.bz2"
"pkg-config;pkg-config-${version_to_build-}.tar.gz"
Expand All @@ -71,6 +75,9 @@ else
fi
done

if [[ ! -z ${arg_b:-} && ${package_to_build} == 'gcc' ]]; then
url_tail="gcc"
fi

if [[ -z "${url_head:-}" || -z "${url_tail}" ]]; then
emergency "Package ${package_name:-} not recognized. Use --l or --list-packages to list the allowable names."
Expand Down

0 comments on commit ef8069d

Please sign in to comment.