summaryrefslogtreecommitdiffstats
path: root/src/opusfile-2-lrint-lib.patch
blob: ec848d2edeae28355528ab6d327b7aaa6388e666 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
This file is part of MXE.
See index.html for further information.

This patch has been taken from:
http://lists.xiph.org/pipermail/opus/2013-March/001972.html

From 6ab2eb850c467e9eaca1c67d37b3e49521a04460 Mon Sep 17 00:00:00 2001
From: Ulrich Klauer <ulrich@chirlu.de>
Date: Sun, 10 Mar 2013 04:02:49 +0100
Subject: [PATCH] Handle AC_SEARCH_LIBS special result value

AC_SEARCH_LIBS will give a result of "none required" if the relevant
function is available without any special libraries. (This is the case
for lrintf on MinGW.) Make sure this special value isn't put verbatim
into the pkg-config files, as it would cause the linker to search for
files named "none" and "required", and fail.
---
 configure.ac               |    6 +++++-
 opusfile-uninstalled.pc.in |    2 +-
 opusfile.pc.in             |    2 +-
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index 8b1a3b3..d82d53f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -107,7 +107,11 @@ AS_IF([test "x$enable_fixed_point" = "xyes"],
    ])
   ]
 )
-AC_SUBST(ac_cv_search_lrintf)
+lrintf_lib=" $ac_cv_search_lrintf"
+AS_IF([test "x$ac_cv_search_lrintf" = "xnone required"],
+  [lrintf_lib=""]
+)
+AC_SUBST(lrintf_lib)
 
 CC_ATTRIBUTE_VISIBILITY([default], [
   CC_FLAG_VISIBILITY([CFLAGS="${CFLAGS} -fvisibility=hidden"])
diff --git a/opusfile-uninstalled.pc.in b/opusfile-uninstalled.pc.in
index b63a23c..7f555d6 100644
--- a/opusfile-uninstalled.pc.in
+++ b/opusfile-uninstalled.pc.in
@@ -10,5 +10,5 @@ Description: Opus playback library (not installed)
 Version: @VERSION@
 Requires: ogg >= 1.3 opus >= 1.0.1 @openssl@
 Conflicts:
-Libs: ${libdir}/libopusfile.la @ac_cv_search_lrintf@
+Libs: ${libdir}/libopusfile.la@lrintf_lib@
 Cflags: -I${includedir}
diff --git a/opusfile.pc.in b/opusfile.pc.in
index 0a77f0c..c96d6a8 100644
--- a/opusfile.pc.in
+++ b/opusfile.pc.in
@@ -11,5 +11,5 @@ Version: @VERSION@
 Requires: ogg >= 1.3 opus >= 1.0.1 @openssl@
 Conflicts:
 Libs: -L${libdir} -lopusfile
-Libs.private: @ac_cv_search_lrintf@
+Libs.private:@lrintf_lib@
 Cflags: -I${includedir}/opus
-- 
1.7.10.4