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 @@
shared_module(
'identify-lib',
'../../identify-lib.c',
c_args : ['-D_SRT_LIB_VALUE="lib/i386-linux-gnu"',],
c_args : ['-D_SRT_LIB_VALUE="lib/' + multiarch + '"',],
install : true,
install_dir : join_paths(
pkglibexecdir,
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(
install_dir : pkglibexecdir,
)
# Detect $LIB expanding to just lib (common case)
subdir('lib')
sizeof_pointer = c_compiler.sizeof('void*')
# Detect $LIB expanding to lib32 or lib64 (semi-common case)
if sizeof_pointer == 4
subdir('lib32')
elif sizeof_pointer == 8
subdir('lib64')
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'
subdir('i386')
subdir('i486')
subdir('i586')
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'
subdir('haswell')
subdir('x86_64')
subdir('xeon_phi')
subdir('lib/x86_64-linux-gnu')
# To support Ubuntu 12.04, see above
subdir('x86_64-linux-gnu')
endif
# vim:set sw=2 sts=2 et:
......@@ -4,11 +4,11 @@
shared_module(
'identify-lib',
'../identify-lib.c',
c_args : ['-D_SRT_LIB_VALUE="i386-linux-gnu"',],
c_args : ['-D_SRT_LIB_VALUE="' + multiarch + '"',],
install : true,
install_dir : join_paths(
pkglibexecdir,
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.
Finish editing this message first!
Please register or to comment