diff options
author | Bryan Hundven <bryanhundven@gmail.com> | 2016-06-17 18:02:59 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-17 18:02:59 -0700 |
commit | 6e7c61650a39a67ee02ed58c11d64c94c436bb33 (patch) | |
tree | 199f985d8429efb8d075bba2051502f13a30ccf6 /scripts/functions | |
parent | 7300eb17b43a38320d25dff47230f483a82b4154 (diff) | |
parent | dc8f2d1c04258069101e913d22c898298b98384c (diff) | |
download | crosstool-ng-6e7c61650a39a67ee02ed58c11d64c94c436bb33.tar.gz crosstool-ng-6e7c61650a39a67ee02ed58c11d64c94c436bb33.tar.bz2 crosstool-ng-6e7c61650a39a67ee02ed58c11d64c94c436bb33.zip |
Merge pull request #403 from stilor/multilib-1
First chunk of multilib changes for merging
Diffstat (limited to 'scripts/functions')
-rw-r--r-- | scripts/functions | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/scripts/functions b/scripts/functions index 70c1ba61..62d264e3 100644 --- a/scripts/functions +++ b/scripts/functions @@ -1305,6 +1305,25 @@ CT_DoBuildTargetTuple() { CT_ARCH_TARGET_LDFLAGS="${CT_ARCH_TARGET_LDFLAGS} ${CT_ARCH_ENDIAN_LDFLAG}" } +# This function determines the target tuple for a given set of compiler +# flags, using either GCC's multiarch feature (if supported; if not, +# GCC prints nothing and exits with status 0), falling back to calling +# the architecture-specific functions. +CT_DoMultilibTarget() { + local target="$1"; shift + local -a multi_flags=( "$@" ) + local gcc_multiarch + + gcc_multiarch=$( "${CT_TARGET}-gcc" -print-multiarch "${multi_flags[@]}" ) + if [ -n "${gcc_multiarch}" ]; then + echo "${gcc_multiarch}" + return + fi + + # Fall back to arch-specific guesswork + CT_DoArchMultilibTarget "${target}" "${multi_flags[@]}" +} + # This function does pause the build until the user strikes "Return" # Usage: CT_DoPause [optional_message] CT_DoPause() { |