meson/megadriver: support various lib suffixes

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32333>
(cherry picked from commit ffd02b8ad8)

Conflicts:
	bin/install_megadrivers.py
This commit is contained in:
Eric Engestrom
2024-11-25 18:16:11 +01:00
committed by Dylan Baker
parent 6865204891
commit 95dd4c1992
8 changed files with 19 additions and 8 deletions

View File

@@ -42,8 +42,13 @@ def main():
parser.add_argument('libdir')
parser.add_argument('drivers', nargs='+')
parser.add_argument('--megadriver_libdir')
parser.add_argument('--libname-suffix', required=True)
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)
if args.megadriver_libdir:
md_to = resolve_libdir(args.megadriver_libdir)
@@ -74,7 +79,7 @@ def main():
os.chdir(to)
name, ext = os.path.splitext(driver)
while ext != '.so':
while ext != '.' + args.libname_suffix:
if os.path.lexists(name):
os.unlink(name)
os.symlink(driver, name)
@@ -82,9 +87,9 @@ def main():
finally:
os.chdir(ret)
# Remove meson-created .so symlinks
# Remove meson-created symlinks
name, ext = os.path.splitext(master)
while ext != '.so':
while ext != '.' + args.libname_suffix:
if os.path.lexists(name):
os.unlink(name)
name, ext = os.path.splitext(name)

View File

@@ -13,4 +13,5 @@ symbols_check = find_program('symbols-check.py')
install_megadrivers_py = find_program('install_megadrivers.py')
install_megadrivers = [
install_megadrivers_py.full_path(),
'--libname-suffix', libname_suffix,
]