diff options
| author | KO Myung-Hun <komh@chollian.net> | 2023-11-08 22:47:41 +0900 |
|---|---|---|
| committer | Dylan Baker <dylan@pnwbakers.com> | 2025-11-14 08:16:23 -0800 |
| commit | 6b87395b15a16a353ca28ad641dc7ff71de5f1e6 (patch) | |
| tree | ad83e2734b58750530b45ed38f33070e52405b3d | |
| parent | c3275c5a0a19ea70b8227a2c9fb3e604b1d8bb51 (diff) | |
| download | meson-6b87395b15a16a353ca28ad641dc7ff71de5f1e6.tar.gz | |
Get library name patterns with proper prefixes and suffixes on OS/2
| -rw-r--r-- | mesonbuild/compilers/mixins/clike.py | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/mesonbuild/compilers/mixins/clike.py b/mesonbuild/compilers/mixins/clike.py index c6bb570cc..0c088b63e 100644 --- a/mesonbuild/compilers/mixins/clike.py +++ b/mesonbuild/compilers/mixins/clike.py @@ -993,6 +993,19 @@ class CLikeCompiler(Compiler): def _get_patterns(self, env: 'Environment', prefixes: T.List[str], suffixes: T.List[str], shared: bool = False) -> T.List[str]: patterns: T.List[str] = [] + if env.machines[self.for_machine].is_os2(): + # On OS/2, search order for shared libs is + # 1. libfoo_dll.a + # 2. foo_dll.a + # 3. libfoo.a + # 4. foo.a + # 5. foo.dll + # For static libs, `_s' is used instead of `_dll'. + for s in suffixes: + dot = '' if s.startswith(('_dll.', '_s.')) else '.' + for p in prefixes: + patterns.append(p + '{}' + dot + s) + return patterns for p in prefixes: for s in suffixes: patterns.append(p + '{}.' + s) @@ -1018,7 +1031,8 @@ class CLikeCompiler(Compiler): # people depend on it. Also, some people use prebuilt `foo.so` instead # of `libfoo.so` for unknown reasons, and may also want to create # `foo.so` by setting name_prefix to '' - if strict and not isinstance(self, VisualStudioLikeCompiler): # lib prefix is not usually used with msvc + # lib prefix is not usually used with msvc and OS/2 + if strict and not isinstance(self, VisualStudioLikeCompiler) and not env.machines[self.for_machine].is_os2(): prefixes = ['lib'] else: prefixes = ['lib', ''] @@ -1041,6 +1055,9 @@ class CLikeCompiler(Compiler): # TI C28x compilers can use both extensions for static or dynamic libs. stlibext = ['a', 'lib'] shlibext = ['dll', 'so'] + elif env.machines[self.for_machine].is_os2(): + stlibext = ['_s.lib', '_s.a', 'lib', 'a'] + shlibext = ['_dll.lib', '_dll.a', 'lib', 'a', 'dll'] else: # Linux/BSDs shlibext = ['so'] |
