summaryrefslogtreecommitdiffstats
path: root/meta/recipes-multimedia/alsa/alsa-lib/Check-if-wordexp-function-is-supported.patch
blob: 41b3c23a403c61e79effa4b76f12aa02c56f814d (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
From 2555c5d62229cf269974f6ec6e4689ab97bbda42 Mon Sep 17 00:00:00 2001
From: "Hong H. Pham" <hong.pham@windriver.com>
Date: Tue, 26 Feb 2013 19:40:04 -0500
Subject: [PATCH] Check if wordexp function is supported

eglibc could be configured to build without wordexp, so it is not enough
to check if wordexp.h exists (the header file could be installed, but it's
possible that the wordexp() function is not supported).  An additional
check if wordexp() is supported by the system C library is needed.

Upstream-Status: Pending

Signed-off-by: Hong H. Pham <hong.pham@windriver.com>
---
 configure.in   |    5 ++++-
 src/userfile.c |    2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/configure.in b/configure.in
index 4bcb0d6..ba1c2dd 100644
--- a/configure.in
+++ b/configure.in
@@ -333,7 +333,10 @@ arm*)
 esac
 
 dnl Check for wordexp.h
-AC_CHECK_HEADERS([wordexp.h])
+AC_CHECK_HEADERS([wordexp.h],
+  dnl Make sure wordexp is supported by the C library
+  AC_CHECK_FUNCS([wordexp])
+)
 
 dnl Check for resmgr support...
 AC_MSG_CHECKING(for resmgr support)
diff --git a/src/userfile.c b/src/userfile.c
index 3a73836..b8ce809 100644
--- a/src/userfile.c
+++ b/src/userfile.c
@@ -32,7 +32,7 @@
  * stores the first matchine one.  The returned string is strdup'ed.
  */
 
-#ifdef HAVE_WORDEXP_H
+#if (defined(HAVE_WORDEXP_H) && defined(HAVE_WORDEXP))
 #include <wordexp.h>
 #include <assert.h>
 int snd_user_file(const char *file, char **result)
-- 
1.7.10.4