Bug 1375798 - Limit the SO_VERSION option to openbsd builds. r?mshal
SO_VERSION has only an impact on those builds. Also set the default at
the option level, instead of doing that in the library_name_info
function.
--- a/moz.configure
+++ b/moz.configure
@@ -138,19 +138,28 @@ include('build/moz.configure/toolchain.c
when='--enable-compile-environment')
include('build/moz.configure/memory.configure',
when='--enable-compile-environment')
include('build/moz.configure/headers.configure',
when='--enable-compile-environment')
include('build/moz.configure/warnings.configure',
when='--enable-compile-environment')
-option(env='SO_VERSION', nargs=1, help='Shared library version for OpenBSD systems')
+@depends(target)
+def is_openbsd(target):
+ return target.kernel == 'OpenBSD'
-@depends(target, target_is_windows, target_is_darwin, c_compiler, 'SO_VERSION')
+option(env='SO_VERSION', nargs=1, default='1.0', when=is_openbsd,
+ help='Shared library version for OpenBSD systems')
+
+@depends('SO_VERSION', when=is_openbsd)
+def so_version(value):
+ return value
+
+@depends(target, target_is_windows, target_is_darwin, c_compiler, so_version)
def library_name_info(target, is_windows, is_darwin, c_compiler, so_version):
dll_prefix = 'lib'
dll_suffix = '.so'
lib_prefix = 'lib'
lib_suffix = 'a'
rust_lib_prefix = 'lib'
rust_lib_suffix = 'a'
obj_suffix = 'o'
@@ -169,21 +178,18 @@ def library_name_info(target, is_windows
import_lib_suffix = 'a'
else:
import_lib_suffix = 'lib'
lib_prefix = ''
lib_suffix = 'lib'
obj_suffix = 'obj'
elif is_darwin:
dll_suffix = '.dylib'
- elif target.kernel == 'OpenBSD':
- if so_version:
- dll_suffix = '.so.%s' % so_version
- else:
- dll_suffix = '.so.1.0'
+ elif so_version:
+ dll_suffix = '.so.%s' % so_version
assert dll_suffix[0] == '.'
assert obj_suffix[0] != '.'
assert lib_suffix[0] != '.'
assert rust_lib_suffix[0] != '.'
return namespace(
dll_prefix=dll_prefix,