alsa-lib: check if wordexp is supported in libc

eglibc could be configured to build without the wordexp feature.  To
ensure that the wordexp feature could be used, the configure script must
check if wordexp() is supported in libc in addition to checking if
wordexp.h exists.

(From OE-Core rev: 3c3fe1d139fc84d7ff125f87a4692fac6dfc04e6)

Signed-off-by: Hong H. Pham <hong.pham@windriver.com>
Signed-off-by: Jesse Zhang <sen.zhang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Jesse Zhang 2013-06-17 12:23:18 +00:00 committed by Richard Purdie
parent a40435e339
commit 609a3671a9
2 changed files with 51 additions and 0 deletions

View File

@ -0,0 +1,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

View File

@ -20,6 +20,7 @@ SRC_URI = "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-${PV}.tar.bz2 \
file://fix-tstamp-declaration.patch \
file://obsolete_automake_macros.patch \
file://fix-O0-Optimize-unable-inline-function.patch \
file://Check-if-wordexp-function-is-supported.patch \
"
SRC_URI[md5sum] = "2dfa35d28471d721e592b616beedf965"
SRC_URI[sha256sum] = "8c9f8161603cc3db640619650401292c3e110da63429ab6938aac763319f6e7d"