Bug 1375798 - Limit the SO_VERSION option to openbsd builds. r=mshal
authorMike Hommey <mh+mozilla@glandium.org>
Fri, 23 Jun 2017 14:58:05 +0900
changeset 405573 9e83254e336b774bf009035178a836bc0500cc9c
parent 405572 0f78019d37dc9ca9caf778cd7e1a4091e2b5005d
child 405574 374900b2142af725d4136758ac00dce2fbb824be
push id58
push userfmarier@mozilla.com
push dateThu, 06 Jul 2017 00:08:44 +0000
reviewersmshal
bugs1375798
milestone56.0a1
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.
moz.configure
--- 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,