summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Kiagiadakis <george.kiagiadakis@collabora.com>2015-10-26 18:38:38 +0100
committerGeorge Kiagiadakis <george.kiagiadakis@collabora.com>2015-10-26 18:38:38 +0100
commit896b3fcfe101bd84a3cbf04b46022cc7f8c1c879 (patch)
tree6b4cf60b0a66b9a4ca374c132727194fe21d63df
parent19bcbaa8925c23249ce922573fdd60b628553a7c (diff)
spandsp: fix dllexport/dllimport usage on windows
LIBSPANDSP_EXPORTS must only be defined while building libspandsp, otherwise code that uses spandsp symbols will be using them with the dllexport attribute and the binaries will probably fail at runtime. The change in config_sh is required because we patch the Makefile.am, so automake needs to run again, and while "make" will detect that, the code in the tarball is configured to run "automake-1.13", which will fail on most systems nowadays. Calling autogen.sh again ensures that we call the correct automake.
-rw-r--r--recipes/spandsp.recipe4
-rw-r--r--recipes/spandsp/0001-Fix-build-for-windows-using-mingw.patch20
-rw-r--r--recipes/spandsp/0002-Define-LIBSPANDSP_EXPORTS-when-building-the-spandsp-.patch25
3 files changed, 31 insertions, 18 deletions
diff --git a/recipes/spandsp.recipe b/recipes/spandsp.recipe
index 9c982de2..fa57f83b 100644
--- a/recipes/spandsp.recipe
+++ b/recipes/spandsp.recipe
@@ -9,7 +9,9 @@ class Recipe(recipe.Recipe):
licenses = [License.LGPLv2_1Plus]
deps = ['tiff']
allow_parallel_build = False
- patches = [ 'spandsp/0001-spandsp-do-not-compile-has_X86FEATURE-symbols.patch' ]
+ config_sh = 'sh ./autogen.sh && sh ./configure'
+ patches = [ 'spandsp/0001-spandsp-do-not-compile-has_X86FEATURE-symbols.patch',
+ 'spandsp/0002-Define-LIBSPANDSP_EXPORTS-when-building-the-spandsp-.patch' ]
files_libs = ['libspandsp']
files_devel = ['include/spandsp', 'include/spandsp.h', 'lib/pkgconfig/spandsp.pc']
diff --git a/recipes/spandsp/0001-Fix-build-for-windows-using-mingw.patch b/recipes/spandsp/0001-Fix-build-for-windows-using-mingw.patch
index c21de497..66a272e7 100644
--- a/recipes/spandsp/0001-Fix-build-for-windows-using-mingw.patch
+++ b/recipes/spandsp/0001-Fix-build-for-windows-using-mingw.patch
@@ -1,26 +1,12 @@
-From a4941856fe595f8090caf229fc52a41f430d8002 Mon Sep 17 00:00:00 2001
+From 942e7b8b035e2b53575b56b27084c03399cd87d5 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(+)
+ src/t4_rx.c | 3 +++
+ 1 file changed, 3 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
diff --git a/recipes/spandsp/0002-Define-LIBSPANDSP_EXPORTS-when-building-the-spandsp-.patch b/recipes/spandsp/0002-Define-LIBSPANDSP_EXPORTS-when-building-the-spandsp-.patch
new file mode 100644
index 00000000..1ea8d9f8
--- /dev/null
+++ b/recipes/spandsp/0002-Define-LIBSPANDSP_EXPORTS-when-building-the-spandsp-.patch
@@ -0,0 +1,25 @@
+From 0769c5e6c28a08a15666764456046b753c0ca03b Mon Sep 17 00:00:00 2001
+From: George Kiagiadakis <george.kiagiadakis@collabora.com>
+Date: Mon, 26 Oct 2015 17:12:46 +0000
+Subject: [PATCH] Define LIBSPANDSP_EXPORTS when building the spandsp library
+ to fix mingw build
+
+---
+ src/Makefile.am | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 3aab162..72ff3af 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -173,6 +173,7 @@ libspandsp_la_SOURCES = ademco_contactid.c \
+ vector_int.c
+
+ libspandsp_la_LDFLAGS = -version-info @SPANDSP_LT_CURRENT@:@SPANDSP_LT_REVISION@:@SPANDSP_LT_AGE@ $(COMP_VENDOR_LDFLAGS)
++libspandsp_la_CFLAGS = -DLIBSPANDSP_EXPORTS=1 $(COMP_VENDOR_CFLAGS)
+
+ nobase_include_HEADERS = spandsp/ademco_contactid.h \
+ spandsp/adsi.h \
+--
+2.4.3
+