meson/megadriver: support various lib suffixes
Cc: mesa-stable Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32333>
This commit is contained in:

committed by
Marge Bot

parent
6586f755b9
commit
ffd02b8ad8
@@ -42,8 +42,13 @@ def main():
|
|||||||
parser.add_argument('libdir')
|
parser.add_argument('libdir')
|
||||||
parser.add_argument('drivers', nargs='+')
|
parser.add_argument('drivers', nargs='+')
|
||||||
parser.add_argument('--megadriver-libdir')
|
parser.add_argument('--megadriver-libdir')
|
||||||
|
parser.add_argument('--libname-suffix', required=True)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
# Not neccesarily at the end, there might be a version suffix, but let's
|
||||||
|
# make sure that the same suffix is in the megadriver lib name.
|
||||||
|
assert '.' + args.libname_suffix in args.megadriver
|
||||||
|
|
||||||
to = resolve_libdir(args.libdir)
|
to = resolve_libdir(args.libdir)
|
||||||
if args.megadriver_libdir:
|
if args.megadriver_libdir:
|
||||||
md_to = resolve_libdir(args.megadriver_libdir)
|
md_to = resolve_libdir(args.megadriver_libdir)
|
||||||
@@ -74,7 +79,7 @@ def main():
|
|||||||
os.chdir(to)
|
os.chdir(to)
|
||||||
|
|
||||||
name, ext = os.path.splitext(driver)
|
name, ext = os.path.splitext(driver)
|
||||||
while ext != '.so':
|
while ext != '.' + args.libname_suffix:
|
||||||
if os.path.lexists(name):
|
if os.path.lexists(name):
|
||||||
os.unlink(name)
|
os.unlink(name)
|
||||||
os.symlink(driver, name)
|
os.symlink(driver, name)
|
||||||
@@ -82,9 +87,9 @@ def main():
|
|||||||
finally:
|
finally:
|
||||||
os.chdir(ret)
|
os.chdir(ret)
|
||||||
|
|
||||||
# Remove meson-created .so symlinks
|
# Remove meson-created symlinks
|
||||||
name, ext = os.path.splitext(master)
|
name, ext = os.path.splitext(master)
|
||||||
while ext != '.so':
|
while ext != '.' + args.libname_suffix:
|
||||||
if os.path.lexists(name):
|
if os.path.lexists(name):
|
||||||
os.unlink(name)
|
os.unlink(name)
|
||||||
name, ext = os.path.splitext(name)
|
name, ext = os.path.splitext(name)
|
||||||
|
@@ -13,4 +13,5 @@ symbols_check = find_program('symbols-check.py')
|
|||||||
install_megadrivers_py = find_program('install_megadrivers.py')
|
install_megadrivers_py = find_program('install_megadrivers.py')
|
||||||
install_megadrivers = [
|
install_megadrivers = [
|
||||||
install_megadrivers_py.full_path(),
|
install_megadrivers_py.full_path(),
|
||||||
|
'--libname-suffix', libname_suffix,
|
||||||
]
|
]
|
||||||
|
@@ -20,6 +20,11 @@ project(
|
|||||||
if host_machine.system() == 'darwin'
|
if host_machine.system() == 'darwin'
|
||||||
add_languages('objc', native : false)
|
add_languages('objc', native : false)
|
||||||
add_project_arguments('-fobjc-arc', language : 'objc')
|
add_project_arguments('-fobjc-arc', language : 'objc')
|
||||||
|
libname_suffix = 'dylib'
|
||||||
|
elif host_machine.system() == 'windows'
|
||||||
|
libname_suffix = 'dll'
|
||||||
|
else
|
||||||
|
libname_suffix = 'so'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
cc = meson.get_compiler('c')
|
cc = meson.get_compiler('c')
|
||||||
|
@@ -67,7 +67,7 @@ libgallium_dri = shared_library(
|
|||||||
driver_asahi, driver_crocus
|
driver_asahi, driver_crocus
|
||||||
],
|
],
|
||||||
install : true,
|
install : true,
|
||||||
name_suffix : 'so',
|
name_suffix : libname_suffix,
|
||||||
)
|
)
|
||||||
|
|
||||||
if with_gallium_va or with_gallium_vdpau
|
if with_gallium_va or with_gallium_vdpau
|
||||||
|
@@ -59,7 +59,7 @@ dril_dri = shared_library(
|
|||||||
# Will be deleted during installation, see install_megadrivers.py
|
# Will be deleted during installation, see install_megadrivers.py
|
||||||
install : true,
|
install : true,
|
||||||
install_dir : dri_drivers_path,
|
install_dir : dri_drivers_path,
|
||||||
name_suffix : 'so',
|
name_suffix : libname_suffix,
|
||||||
)
|
)
|
||||||
|
|
||||||
foreach d : [[with_gallium_kmsro, [
|
foreach d : [[with_gallium_kmsro, [
|
||||||
|
@@ -84,7 +84,7 @@ else
|
|||||||
link_depends : va_link_depends,
|
link_depends : va_link_depends,
|
||||||
install : true,
|
install : true,
|
||||||
install_dir : va_drivers_path,
|
install_dir : va_drivers_path,
|
||||||
name_suffix : 'so',
|
name_suffix : libname_suffix,
|
||||||
)
|
)
|
||||||
|
|
||||||
foreach d : [[with_gallium_r600, 'r600'],
|
foreach d : [[with_gallium_r600, 'r600'],
|
||||||
|
@@ -47,7 +47,7 @@ libvdpau_gallium = shared_library(
|
|||||||
soversion : '@0@.@1@.0'.format(VDPAU_MAJOR, VDPAU_MINOR),
|
soversion : '@0@.@1@.0'.format(VDPAU_MAJOR, VDPAU_MINOR),
|
||||||
install : true,
|
install : true,
|
||||||
install_dir : vdpau_drivers_path,
|
install_dir : vdpau_drivers_path,
|
||||||
name_suffix : 'so',
|
name_suffix : libname_suffix,
|
||||||
)
|
)
|
||||||
foreach d : [[with_gallium_r600, 'r600'],
|
foreach d : [[with_gallium_r600, 'r600'],
|
||||||
[with_gallium_radeonsi, 'radeonsi'],
|
[with_gallium_radeonsi, 'radeonsi'],
|
||||||
|
Reference in New Issue
Block a user