diff options
author | L. E. Segovia <amy@centricular.com> | 2024-10-30 10:06:57 -0300 |
---|---|---|
committer | GStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2024-10-31 14:52:35 +0000 |
commit | 924a266ca4f561b029013f93cfef209389a27f27 (patch) | |
tree | a121f9e3b6d31509999831903a7e6b45c127b594 | |
parent | 51556b295df0fda310c2277baa38bf0104e924c8 (diff) |
cerbero: Check if ld is available at all before disabling Rust
Part-of: <https://gitlab.freedesktop.org/gstreamer/cerbero/-/merge_requests/1615>
-rw-r--r-- | config/linux.config | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/config/linux.config b/config/linux.config index e621a384..17dd6638 100644 --- a/config/linux.config +++ b/config/linux.config @@ -4,15 +4,18 @@ # PLEASE, DO NOT EDIT THIS FILE import os +import shutil from cerbero.utils import shell from cerbero.utils import messages as m -from cerbero.config import Architecture, Distro +from cerbero.config import Architecture, Distro, Platform -vlist = ['alsa', 'x11', 'pulse', 'cdparanoia', 'v4l2', 'gi', 'unwind'] -if '--export-dynamic-symbol' in shell.check_output(['ld', '--help']): - vlist += ['rust'] -elif prefix != build_tools_prefix: - m.warning('Disabling rust variant: binutils is too old, need >=2.36') +vlist = ['alsa', 'x11', 'pulse', 'cdparanoia', 'v4l2', 'gi', 'unwind', 'rust'] +is_cross_build = target_platform != platform or target_arch != arch or target_distro_version != distro_version +if not is_cross_build and shutil.which('ld'): + if '--export-dynamic-symbol' not in shell.check_output(['ld', '--help']): + vlist.remove('rust') + if prefix != build_tools_prefix: + m.warning('Disabling rust variant: binutils is too old, need >=2.36') # Set default values for some optional variants variants.override(vlist, False) |