Commit cf6909d6 authored by Mike Hommey's avatar Mike Hommey
Browse files

Bug 1835428 - Do config.sub munging in a more generic way....

Bug 1835428 - Do config.sub munging in a more generic way. r=firefox-build-system-reviewers,nalexander

This will allow to add other munging more easily in the future.

Differential Revision: https://phabricator.services.mozilla.com/D179280
parent 5e446e5a
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -650,15 +650,19 @@ def config_sub(shell, triplet):
    # Config.sub doesn't like the *-windows-msvc/*-windows-gnu triplets, so
    # munge those before and after calling config.sub.
    suffix = None
    mingw_suffix = "-mingw32"
    for check_suffix in ("-windows-msvc", "-windows-gnu"):
    munging = {
        "-windows-msvc": "-mingw32",
        "-windows-gnu": "-mingw32",
    }
    for check_suffix, replacement in munging.items():
        if triplet.endswith(check_suffix):
            suffix = check_suffix
            triplet = triplet[: -len(suffix)] + mingw_suffix
            triplet = triplet[: -len(suffix)] + replacement
            break
    result = check_cmd_output(shell, config_sub, triplet).strip()
    if suffix:
        assert result.endswith(mingw_suffix)
        result = result[: -len(mingw_suffix)] + suffix
        assert result.endswith(replacement)
        result = result[: -len(replacement)] + suffix
    return result