blob: 795e48ab2ed0102b066d7db691797ddfed70180b [file] [log] [blame]
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05001From 3408f8e78776b12f131e433749721602f87e0a70 Mon Sep 17 00:00:00 2001
Patrick Williamsc124f4f2015-09-15 14:41:29 -05002From: "Hong H. Pham" <hong.pham@windriver.com>
3Date: Fri, 29 Aug 2014 17:13:55 +0300
4Subject: [PATCH] Check if wordexp function is supported
5
6eglibc could be configured to build without wordexp, so it is not enough
7to check if wordexp.h exists (the header file could be installed, but it's
8possible that the wordexp() function is not supported). An additional
9check if wordexp() is supported by the system C library is needed.
10
11Upstream-Status: Inappropriate [configuration]
12
13Signed-off-by: Hong H. Pham <hong.pham@windriver.com>
14Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
15---
16 configure.ac | 5 ++++-
17 src/userfile.c | 2 +-
18 2 files changed, 5 insertions(+), 2 deletions(-)
19
20diff --git a/configure.ac b/configure.ac
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050021index 9490d39..b08a90a 100644
Patrick Williamsc124f4f2015-09-15 14:41:29 -050022--- a/configure.ac
23+++ b/configure.ac
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050024@@ -295,7 +295,10 @@ fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -050025 AC_SUBST(ALSA_DEPLIBS)
26
27 dnl Check for headers
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050028-AC_CHECK_HEADERS([wordexp.h endian.h sys/endian.h sys/shm.h])
29+AC_CHECK_HEADERS([wordexp.h endian.h sys/endian.h sys/shm.h],
Patrick Williamsc124f4f2015-09-15 14:41:29 -050030+ dnl Make sure wordexp is supported by the C library
31+ AC_CHECK_FUNCS([wordexp])
32+)
33
34 dnl Check for resmgr support...
35 AC_MSG_CHECKING(for resmgr support)
36diff --git a/src/userfile.c b/src/userfile.c
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050037index 72779da..e9d13e6 100644
Patrick Williamsc124f4f2015-09-15 14:41:29 -050038--- a/src/userfile.c
39+++ b/src/userfile.c
40@@ -32,7 +32,7 @@
41 * stores the first matchine one. The returned string is strdup'ed.
42 */
43
44-#ifdef HAVE_WORDEXP_H
45+#if (defined(HAVE_WORDEXP_H) && defined(HAVE_WORDEXP))
46 #include <wordexp.h>
47 #include <assert.h>
48 int snd_user_file(const char *file, char **result)
49--
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500502.6.4
Patrick Williamsc124f4f2015-09-15 14:41:29 -050051