summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Schmidt <jan@centricular.com>2018-03-17 01:28:46 +1100
committerJan Schmidt <jan@centricular.com>2018-03-17 01:28:46 +1100
commitb2f93015173945607fe7a35b9e81bb33b18eec4e (patch)
treecf17fbc3b66c7a1abf31e8a92ea6da75a7001cf7
parent529588f75df618ff12a4f873f4a01a45bb79ffea (diff)
gmp: Use dlltool to generate the mingw interface lib
Don't copy the dll as the import lib, generate it from the defs file in the build tree. This fixes the windows build using the new dlltool based dll-name extraction.
-rw-r--r--recipes/gmp.recipe13
1 files changed, 10 insertions, 3 deletions
diff --git a/recipes/gmp.recipe b/recipes/gmp.recipe
index 495b6ab0..e3487450 100644
--- a/recipes/gmp.recipe
+++ b/recipes/gmp.recipe
@@ -42,13 +42,20 @@ class Recipe(recipe.Recipe):
def post_install(self):
if self.config.target_platform == Platform.WINDOWS:
- src = os.path.join(self.config.prefix, 'lib', 'libgmp-10.dll')
- dll = os.path.join(self.config.prefix, 'bin', 'libgmp-10.dll')
+ dllname = 'libgmp-10.dll'
+
+ src = os.path.join(self.config.prefix, 'lib', dllname)
+ dll = os.path.join(self.config.prefix, 'bin', dllname)
dll_a = os.path.join(self.config.prefix, 'lib', 'libgmp.dll.a')
+ defs_file = os.path.join(self.build_dir, '.libs', 'libgmp-3.dll.def')
+ dlltool = os.environ.get('DLLTOOL', None)
+ if not dlltool:
+ raise FatalError('dlltool was not found, check cerbero configuration')
+
if os.path.exists(dll_a):
os.remove(dll_a)
+ shell.check_call([dlltool, '-D', dllname, '-d', defs_file, '-l', dll_a])
shutil.copy(src, dll)
- shutil.copy(src, dll_a)
gmp_la = os.path.join(self.config.prefix, 'lib', 'libgmp.la')
shell.replace(gmp_la, {'libgmp.lib': 'libgmp.dll.a'})
elif self.config.target_platform in [Platform.DARWIN, Platform.IOS]: