diff options
-rw-r--r-- | cerbero/tools/libtool.py | 19 | ||||
-rw-r--r-- | recipes/bzip2.recipe | 3 | ||||
-rw-r--r-- | recipes/nettle.recipe | 6 | ||||
-rw-r--r-- | recipes/taglib.recipe | 3 | ||||
-rw-r--r-- | recipes/zlib.recipe | 3 |
5 files changed, 26 insertions, 8 deletions
diff --git a/cerbero/tools/libtool.py b/cerbero/tools/libtool.py index fc1ca242..ef84c53c 100644 --- a/cerbero/tools/libtool.py +++ b/cerbero/tools/libtool.py @@ -18,6 +18,7 @@ # Boston, MA 02111-1307, USA. import os +from cerbero.config import Platform class LibtoolLibrary(object): @@ -69,7 +70,7 @@ dlpreopen='' libdir='%(libdir)s' ''' - def __init__(self, libname, major, minor, micro, libdir, deps=None): + def __init__(self, libname, major, minor, micro, libdir, platform, deps=None): self.libtool_vars = { 'libname': '', 'dlname': '', @@ -81,14 +82,26 @@ libdir='%(libdir)s' 'revision': '', 'libdir': ''} + if platform == Platform.WINDOWS: + shared_ext = 'dll' + elif platform == Platform.DARWIN: + shared_ext = 'dylib' + else: + shared_ext = 'so' + if platform == Platform.WINDOWS: + shareddir = os.path.join(libdir, '..', 'bin') + else: + shareddir = libdir + if not libname.startswith('lib'): libname = 'lib%s' % libname if deps is None: deps = '' self.libname = libname self.libdir = libdir + self.shareddir = shareddir self.laname = '%s.la' % libname - dlname_base = '%s.so' % (libname) + dlname_base = '%s.%s' % (libname, shared_ext) dlname = dlname_base dlname_all = dlname_base major_str = '' @@ -113,7 +126,7 @@ libdir='%(libdir)s' self.change_value('current', minor_str) self.change_value('age', minor_str) self.change_value('revision', micro_str) - self.change_value('libdir', libdir) + self.change_value('libdir', shareddir) self.change_value('dependency_libs', self._parse_deps(deps)) def save(self): diff --git a/recipes/bzip2.recipe b/recipes/bzip2.recipe index c702936d..45f41d0b 100644 --- a/recipes/bzip2.recipe +++ b/recipes/bzip2.recipe @@ -26,7 +26,8 @@ class Recipe(recipe.Recipe): (shared_makefile, self.config.prefix, extension, self.config.prefix) def post_install(self): - libtool_la = LibtoolLibrary('bz2', 1, 0, 6, self.config.libdir) + libtool_la = LibtoolLibrary('bz2', 1, 0, 6, self.config.libdir, + self.config.target_platform) libtool_la.save() if self.config.target_platform != Platform.WINDOWS: libdir = os.path.join(self.config.prefix, 'lib') diff --git a/recipes/nettle.recipe b/recipes/nettle.recipe index 96c654aa..9203b98a 100644 --- a/recipes/nettle.recipe +++ b/recipes/nettle.recipe @@ -28,12 +28,14 @@ class Recipe(recipe.Recipe): def post_install(self): # Create libtool libraries (.la) - libtool_la = LibtoolLibrary('nettle', 4, 4, 0, self.config.libdir) + libtool_la = LibtoolLibrary('nettle', 4, 4, 0, self.config.libdir, + self.config.target_platform) libtool_la.save() deps = ['nettle', 'gmp', '-lc'] if self.config.target_platform != Platform.LINUX: deps += ['iconv', 'intl'] - libtool_la = LibtoolLibrary('hogweed', 2, 2, 0, self.config.libdir, deps) + libtool_la = LibtoolLibrary('hogweed', 2, 2, 0, self.config.libdir, + self.config.target_platform, deps) libtool_la.save() if self.config.target_platform == Platform.LINUX: diff --git a/recipes/taglib.recipe b/recipes/taglib.recipe index 4a021d11..0389640b 100644 --- a/recipes/taglib.recipe +++ b/recipes/taglib.recipe @@ -26,7 +26,8 @@ class Recipe(recipe.Recipe): deps = ['z'] if self.config.target_platform == Platform.ANDROID: deps.append('stlport') - libtool_la = LibtoolLibrary('tag', 1, 7, None, self.config.libdir, deps) + libtool_la = LibtoolLibrary('tag', 1, 7, None, self.config.libdir, + self.config.target_platform, deps) libtool_la.save() shutil.move( os.path.join(self.config.prefix, 'lib', 'libtag_static.a'), diff --git a/recipes/zlib.recipe b/recipes/zlib.recipe index 3786e66f..a418d279 100644 --- a/recipes/zlib.recipe +++ b/recipes/zlib.recipe @@ -25,5 +25,6 @@ class Recipe(recipe.Recipe): self._remove_steps ([BuildSteps.CONFIGURE]) def post_install(self): - libtool_la = LibtoolLibrary('z', 1, 2, 7, self.config.libdir) + libtool_la = LibtoolLibrary('z', 1, 2, 7, self.config.libdir, + self.config.target_platform) libtool_la.save() |