Skip to content

Instantly share code, notes, and snippets.

@jeeb
Created July 28, 2016 21:52
Show Gist options
  • Save jeeb/75f901d40fa0e3dc4a866db52fb9789c to your computer and use it in GitHub Desktop.
Save jeeb/75f901d40fa0e3dc4a866db52fb9789c to your computer and use it in GitHub Desktop.
--- a/.waf-1.8.12-f00e5b53f6bbeab1384a38c9cc5d51f7/waflib/Tools/ccroot.py 2016-07-28 23:33:59.985601243 +0300
+++ b/.waf-1.8.12-f00e5b53f6bbeab1384a38c9cc5d51f7/waflib/Tools/ccroot.py 2016-07-29 00:46:17.597861502 +0300
@@ -293,10 +293,10 @@
@feature('cshlib','cxxshlib','dshlib','fcshlib','vnum')
@after_method('apply_link','propagate_uselib_vars')
def apply_vnum(self):
- if not getattr(self,'vnum','')or os.name!='posix'or self.env.DEST_BINFMT not in('elf','mac-o'):
+ if getattr(self,'vnum',None) is None or os.name!='posix'or self.env.DEST_BINFMT not in('elf','mac-o'):
return
link=self.link_task
- if not re_vnum.match(self.vnum):
+ if not re_vnum.match(self.vnum) and self.vnum != '':
raise Errors.WafError('Invalid vnum %r for target %r'%(self.vnum,getattr(self,'name',self)))
nums=self.vnum.split('.')
node=link.outputs[0]
@@ -309,12 +309,19 @@
name3=libname.replace('.dylib','.%s.dylib'%self.vnum)
name2=libname.replace('.dylib','.%s.dylib'%cnum)
else:
- name3=libname+'.'+self.vnum
- name2=libname+'.'+cnum
+ if self.vnum == '':
+ name3=libname
+ name2=libname
+ else:
+ name3=libname+'.'+self.vnum
+ name2=libname+'.'+cnum
if self.env.SONAME_ST:
v=self.env.SONAME_ST%name2
self.env.append_value('LINKFLAGS',v.split())
if self.env.DEST_OS!='openbsd':
+ if self.vnum == '':
+ return
+
outs=[node.parent.find_or_declare(name3)]
if name2!=name3:
outs.append(node.parent.find_or_declare(name2))
--- a/.waf3-1.8.12-f00e5b53f6bbeab1384a38c9cc5d51f7/waflib/Tools/ccroot.py 2016-07-28 23:33:59.985601243 +0300
+++ b/.waf3-1.8.12-f00e5b53f6bbeab1384a38c9cc5d51f7/waflib/Tools/ccroot.py 2016-07-29 00:46:17.597861502 +0300
@@ -293,10 +293,10 @@
@feature('cshlib','cxxshlib','dshlib','fcshlib','vnum')
@after_method('apply_link','propagate_uselib_vars')
def apply_vnum(self):
- if not getattr(self,'vnum','')or os.name!='posix'or self.env.DEST_BINFMT not in('elf','mac-o'):
+ if getattr(self,'vnum',None) is None or os.name!='posix'or self.env.DEST_BINFMT not in('elf','mac-o'):
return
link=self.link_task
- if not re_vnum.match(self.vnum):
+ if not re_vnum.match(self.vnum) and self.vnum != '':
raise Errors.WafError('Invalid vnum %r for target %r'%(self.vnum,getattr(self,'name',self)))
nums=self.vnum.split('.')
node=link.outputs[0]
@@ -309,12 +309,19 @@
name3=libname.replace('.dylib','.%s.dylib'%self.vnum)
name2=libname.replace('.dylib','.%s.dylib'%cnum)
else:
- name3=libname+'.'+self.vnum
- name2=libname+'.'+cnum
+ if self.vnum == '':
+ name3=libname
+ name2=libname
+ else:
+ name3=libname+'.'+self.vnum
+ name2=libname+'.'+cnum
if self.env.SONAME_ST:
v=self.env.SONAME_ST%name2
self.env.append_value('LINKFLAGS',v.split())
if self.env.DEST_OS!='openbsd':
+ if self.vnum == '':
+ return
+
outs=[node.parent.find_or_declare(name3)]
if name2!=name3:
outs.append(node.parent.find_or_declare(name2))
diff --git a/wscript_build.py b/wscript_build.py
index 13d89ce..245c4dd 100644
--- a/wscript_build.py
+++ b/wscript_build.py
@@ -516,6 +516,10 @@ def build(ctx):
if not ctx.dependency_satisfied('android'):
# for all other configurations we want SONAME to be used
libmpv_kwargs["vnum"] = libversion
+ else:
+ # for Android we just return an empty string
+ # (as we still need the SONAME for proper linkage)
+ libmpv_kwargs["vnum"] = ''
ctx(**libmpv_kwargs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment