Skip to content

Commit

Permalink
libgcc version detection alpine
Browse files Browse the repository at this point in the history
  • Loading branch information
vszakats committed Sep 1, 2023
1 parent d6bef4d commit 72add7d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions _build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1035,11 +1035,16 @@ build_single_target() {
versuffix="${versuffix_non_llvm_mingw}"
elif [ "${_OS}" = 'linux' ]; then
if [ "${_CC}" = 'llvm' ]; then
# FIXME: Debian-specific
if [ "${unamem}" = "${_machine}" ]; then
libgccver="$(dpkg-query --showformat='${Version}' --show 'libgcc-*-dev' || true)"
[ -n "${libgccver}" ] || libgccver="$(dpkg-query --showformat='${Version}' --show 'libgcc-*-dev' || true)"
[ -n "${libgccver}" ] || libgccver="$(rpm --query --queryformat '.%{VERSION}' libgcc || true)"
if [ -z "${libgccver}" ]; then
[ -n "${libgccver}" ] || libgccver="$(pacman --query --info gcc-libs || true)"
[ -n "${libgccver}" ] || libgccver="$(apk info --webpage libgcc || true)"
[ -n "${libgccver}" ] && libgccver="$(printf '%s' "${libgccver}" | grep -a -E '(^Version|webpage:)' | grep -a -m1 -o -E '[0-9][0-9.]*' | head -n 1 || true)"
fi
else
libgccver="$(dpkg-query --showformat='${Version}' --show 'libgcc-*-dev-*-cross' || true)"
[ -n "${libgccver}" ] || libgccver="$(dpkg-query --showformat='${Version}' --show 'libgcc-*-dev-*-cross' || true)"
fi
[ -n "${libgccver}" ] && libgccver="libgcc ${libgccver}"
fi
Expand Down

0 comments on commit 72add7d

Please sign in to comment.