Skip to content
Snippets Groups Projects
Commit 8136164f authored by Simon McVittie's avatar Simon McVittie
Browse files

helpers: Generically check for $LIB = lib/MULTIARCH or MULTIARCH


There's no real reason why we need to hard-code the x86 architectures
here - we can do this generically across all multiarch tuples. In
particular, this means we detect $LIB correctly on all Debian
derivatives and in the freedesktop.org SDK, even on non-x86.

Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
parent 8c11c69b
No related branches found
No related tags found
1 merge request!302helpers: Refactor $LIB, $PLATFORM detection
...@@ -4,11 +4,12 @@ ...@@ -4,11 +4,12 @@
shared_module( shared_module(
'identify-lib', 'identify-lib',
'../../identify-lib.c', '../../identify-lib.c',
c_args : ['-D_SRT_LIB_VALUE="lib/i386-linux-gnu"',], c_args : ['-D_SRT_LIB_VALUE="lib/' + multiarch + '"',],
install : true, install : true,
install_dir : join_paths( install_dir : join_paths(
pkglibexecdir, pkglibexecdir,
multiarch, multiarch,
'lib/i386-linux-gnu', 'lib',
multiarch,
) )
) )
# Copyright 2021 Collabora Ltd.
# SPDX-License-Identifier: MIT
shared_module(
'identify-lib',
'../../identify-lib.c',
c_args : ['-D_SRT_LIB_VALUE="lib/x86_64-linux-gnu"',],
install : true,
install_dir : join_paths(
pkglibexecdir,
multiarch,
'lib/x86_64-linux-gnu',
)
)
...@@ -162,36 +162,36 @@ executable( ...@@ -162,36 +162,36 @@ executable(
install_dir : pkglibexecdir, install_dir : pkglibexecdir,
) )
# Detect $LIB expanding to just lib (common case)
subdir('lib') subdir('lib')
sizeof_pointer = c_compiler.sizeof('void*') sizeof_pointer = c_compiler.sizeof('void*')
# Detect $LIB expanding to lib32 or lib64 (semi-common case)
if sizeof_pointer == 4 if sizeof_pointer == 4
subdir('lib32') subdir('lib32')
elif sizeof_pointer == 8 elif sizeof_pointer == 8
subdir('lib64') subdir('lib64')
endif endif
if multiarch != ''
# Detect $LIB expanding to lib/MULTIARCH (Debian, Ubuntu, fd.o SDK)
subdir('lib/multiarch')
# This is to support Ubuntu 12.04 where $LIB wrongly expanded to just
# the multiarch
subdir('multiarch')
endif
if multiarch == 'i386-linux-gnu' if multiarch == 'i386-linux-gnu'
subdir('i386') subdir('i386')
subdir('i486') subdir('i486')
subdir('i586') subdir('i586')
subdir('i686') subdir('i686')
subdir('lib/i386-linux-gnu')
# This is to support Ubuntu 12.04 where $LIB wrongly expanded to just
# the multiarch
subdir('i386-linux-gnu')
elif multiarch == 'x86_64-linux-gnu' elif multiarch == 'x86_64-linux-gnu'
subdir('haswell') subdir('haswell')
subdir('x86_64') subdir('x86_64')
subdir('xeon_phi') subdir('xeon_phi')
subdir('lib/x86_64-linux-gnu')
# To support Ubuntu 12.04, see above
subdir('x86_64-linux-gnu')
endif endif
# vim:set sw=2 sts=2 et: # vim:set sw=2 sts=2 et:
...@@ -4,11 +4,11 @@ ...@@ -4,11 +4,11 @@
shared_module( shared_module(
'identify-lib', 'identify-lib',
'../identify-lib.c', '../identify-lib.c',
c_args : ['-D_SRT_LIB_VALUE="i386-linux-gnu"',], c_args : ['-D_SRT_LIB_VALUE="' + multiarch + '"',],
install : true, install : true,
install_dir : join_paths( install_dir : join_paths(
pkglibexecdir, pkglibexecdir,
multiarch, multiarch,
'i386-linux-gnu', multiarch,
) )
) )
# Copyright 2021 Collabora Ltd.
# SPDX-License-Identifier: MIT
shared_module(
'identify-lib',
'../identify-lib.c',
c_args : ['-D_SRT_LIB_VALUE="x86_64-linux-gnu"',],
install : true,
install_dir : join_paths(
pkglibexecdir,
multiarch,
'x86_64-linux-gnu',
)
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment