xfree86: fix meson build on 64-bit Solaris/SPARC systems

For cpu_family(), meson returns "sparc" for 32-bit sparc,
and "sparc64" for 64-bit sparc, regardless of the OS in use.

For cpu(), meson returns values like "sun4v" on Solaris/SPARC,
and doesn't promise stability of the values, or portability across
OS'es, unlike cpu_family().

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2070>
This commit is contained in:
Alan Coopersmith 2025-09-25 16:37:36 -07:00
parent 3ec5f6bcc3
commit 908f0a488d
2 changed files with 3 additions and 3 deletions

View file

@ -71,7 +71,7 @@ endif
if get_option('pciaccess') if get_option('pciaccess')
srcs_xorg_common += ['xf86pciBus.c', 'xf86VGAarbiter.c'] srcs_xorg_common += ['xf86pciBus.c', 'xf86VGAarbiter.c']
if host_machine.cpu() == 'sparc' or host_machine.cpu() == 'sparc64' if host_machine.cpu_family() in ['sparc', 'sparc64']
srcs_xorg_common += 'xf86sbusBus.c' srcs_xorg_common += 'xf86sbusBus.c'
endif endif
endif endif

View file

@ -16,7 +16,7 @@ os_c_args = []
if get_option('pciaccess') if get_option('pciaccess')
srcs_xorg_os_support += 'bus/Pci.c' srcs_xorg_os_support += 'bus/Pci.c'
if host_machine.cpu() == 'sparc' or host_machine.cpu() == 'sparc64' if host_machine.cpu_family() in ['sparc', 'sparc64']
srcs_xorg_os_support += 'bus/Sbus.c' srcs_xorg_os_support += 'bus/Sbus.c'
install_data('bus/xf86Sbus.h', install_dir: xorgsdkdir) install_data('bus/xf86Sbus.h', install_dir: xorgsdkdir)
endif endif
@ -82,7 +82,7 @@ elif host_machine.system() == 'sunos'
srcs_xorg_os_support += 'shared/agp_noop.c' srcs_xorg_os_support += 'shared/agp_noop.c'
endif endif
if host_machine.cpu_family() == 'sparc' if host_machine.cpu_family() in ['sparc', 'sparc64']
srcs_xorg_os_support += 'solaris/solaris-sparcv8plus.S' srcs_xorg_os_support += 'solaris/solaris-sparcv8plus.S'
elif host_machine.cpu_family() == 'x86_64' elif host_machine.cpu_family() == 'x86_64'
srcs_xorg_os_support += 'solaris/solaris-amd64.S' srcs_xorg_os_support += 'solaris/solaris-amd64.S'