Patchwork [2/2] alsa-lib: check if wordexp is supported in libc

login
register
mail settings
Submitter Jesse Zhang
Date June 17, 2013, 12:33 p.m.
Message ID <45e8001562afdc3b5a76a9c8fa1383453ecc13f4.1371472283.git.sen.zhang@windriver.com>
Download mbox | patch
Permalink /patch/51827/
State New
Headers show

Comments

Jesse Zhang - June 17, 2013, 12:33 p.m.
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.

Signed-off-by: Hong H. Pham <hong.pham@windriver.com>
Signed-off-by: Jesse Zhang <sen.zhang@windriver.com>
---
 .../Check-if-wordexp-function-is-supported.patch   | 48 ++++++++++++++++++++++
 meta/recipes-multimedia/alsa/alsa-lib_1.0.26.bb    |  1 +
 2 files changed, 49 insertions(+)
 create mode 100644 meta/recipes-multimedia/alsa/alsa-lib/Check-if-wordexp-function-is-supported.patch

Patch

diff --git a/meta/recipes-multimedia/alsa/alsa-lib/Check-if-wordexp-function-is-supported.patch b/meta/recipes-multimedia/alsa/alsa-lib/Check-if-wordexp-function-is-supported.patch
new file mode 100644
index 0000000..d605f0f
--- /dev/null
+++ b/meta/recipes-multimedia/alsa/alsa-lib/Check-if-wordexp-function-is-supported.patch
@@ -0,0 +1,48 @@ 
+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.
+
+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
+
diff --git a/meta/recipes-multimedia/alsa/alsa-lib_1.0.26.bb b/meta/recipes-multimedia/alsa/alsa-lib_1.0.26.bb
index 2695e6b..6f22d06 100644
--- a/meta/recipes-multimedia/alsa/alsa-lib_1.0.26.bb
+++ b/meta/recipes-multimedia/alsa/alsa-lib_1.0.26.bb
@@ -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"