summaryrefslogtreecommitdiff
path: root/recipes
diff options
context:
space:
mode:
authorNicolas Dufresne <nicolas.dufresne@collabora.com>2015-10-03 20:06:06 +0100
committerNicolas Dufresne <nicolas.dufresne@collabora.com>2015-10-03 20:06:06 +0100
commitb5ba15b218bce8587de29fd33b713400f427a1f2 (patch)
tree92d01b0c4be07440b0838f1aaa19d361f6558841 /recipes
parent98b2f6d036fc6705d6a075c38663f78b671082bc (diff)
spandsp: Fix build with mingw
This is a specific fix, an upstream solution would be nicer eventually. We basically properly select the naming convention and ensure we use the stdcall convention for gethostname. https://bugzilla.gnome.org/show_bug.cgi?id=754997
Diffstat (limited to 'recipes')
-rw-r--r--recipes/spandsp.recipe2
-rw-r--r--recipes/spandsp/0001-Fix-build-for-windows-using-mingw.patch40
2 files changed, 42 insertions, 0 deletions
diff --git a/recipes/spandsp.recipe b/recipes/spandsp.recipe
index 5cdad0c5..97e4b430 100644
--- a/recipes/spandsp.recipe
+++ b/recipes/spandsp.recipe
@@ -18,3 +18,5 @@ class Recipe(recipe.Recipe):
if self.config.arch != self.config.target_arch:
self.new_env['ac_cv_func_malloc_0_nonnull'] = 'yes'
self.new_env['ac_cv_func_realloc_0_nonnull'] = 'yes'
+ if self.config.target_platform == Platform.WINDOWS:
+ self.patches += ['spandsp/0001-Fix-build-for-windows-using-mingw.patch']
diff --git a/recipes/spandsp/0001-Fix-build-for-windows-using-mingw.patch b/recipes/spandsp/0001-Fix-build-for-windows-using-mingw.patch
new file mode 100644
index 00000000..c21de497
--- /dev/null
+++ b/recipes/spandsp/0001-Fix-build-for-windows-using-mingw.patch
@@ -0,0 +1,40 @@
+From a4941856fe595f8090caf229fc52a41f430d8002 Mon Sep 17 00:00:00 2001
+From: Nicolas Dufresne <nicolas.dufresne@collabora.com>
+Date: Sat, 3 Oct 2015 19:44:00 +0100
+Subject: [PATCH] Fix build for windows using mingw
+
+---
+ src/spandsp/telephony.h | 2 ++
+ src/t4_rx.c | 3 +++
+ 2 files changed, 5 insertions(+)
+
+diff --git a/src/spandsp/telephony.h b/src/spandsp/telephony.h
+index 49d7200..8614c75 100644
+--- a/src/spandsp/telephony.h
++++ b/src/spandsp/telephony.h
+@@ -26,6 +26,8 @@
+ #if !defined(_SPANDSP_TELEPHONY_H_)
+ #define _SPANDSP_TELEPHONY_H_
+
++#define LIBSPANDSP_EXPORTS 1
++
+ #if defined(_M_IX86) || defined(_M_X64)
+ #if defined(LIBSPANDSP_EXPORTS)
+ #define SPAN_DECLARE(type) __declspec(dllexport) type __stdcall
+diff --git a/src/t4_rx.c b/src/t4_rx.c
+index eb24bf1..b0f7490 100644
+--- a/src/t4_rx.c
++++ b/src/t4_rx.c
+@@ -60,6 +60,9 @@
+ #include "config.h"
+ #endif
+
++/* Avoid including winsock2.h */
++extern int __stdcall gethostname(char * name, int namelen);
++
+ #include <stdlib.h>
+ #include <inttypes.h>
+ #include <limits.h>
+--
+2.4.3
+