summaryrefslogtreecommitdiffstats
path: root/package/popt/popt-03-glob-detection.patch
blob: 7bdce7d71766aed7705c1387b38102c5a56c3be9 (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
Detect glob_pattern_p()

The current popt build system tests the existence of <glob.h>, and
then assumes that if __GLIBC__ is defined, then glob_pattern_p() must
be available. Unfortunately, that's not true with uClibc: <glob.h> may
be installed, but not necessarily the GNU glob extensions... and
uClibc defines __GLIBC__. This is causing build issues with certain
uClibc toolchains that do not have GNU glob extensions enabled.

To fix this, this patch adds an AC_CHECK_FUNCS() test for
glob_pattern_p, and uses that to find out whether glob_pattern_p() is
available or not.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Index: b/configure.ac
===================================================================
--- a/configure.ac
+++ b/configure.ac
@@ -81,7 +81,7 @@
 AC_CHECK_FUNC(setreuid, [], [
     AC_CHECK_LIB(ucb, setreuid, [if echo $LIBS | grep -- -lucb >/dev/null ;then :; else LIBS="$LIBS -lc -lucb" USEUCB=y;fi])
 ])
-AC_CHECK_FUNCS(getuid geteuid iconv mtrace __secure_getenv setregid stpcpy strerror vasprintf srandom)
+AC_CHECK_FUNCS(getuid geteuid iconv mtrace __secure_getenv setregid stpcpy strerror vasprintf srandom glob_pattern_p)
 
 AM_GNU_GETTEXT([external])
 AM_ICONV_LINK
Index: b/poptconfig.c
===================================================================
--- a/poptconfig.c
+++ b/poptconfig.c
@@ -42,7 +42,7 @@
 /*@=declundef =exportheader =incondefs =protoparammatch =redecl =type @*/
 #endif	/* __LCLINT__ */
 
-#if !defined(__GLIBC__)
+#if !defined(HAVE_GLOB_PATTERN_P)
 /* Return nonzero if PATTERN contains any metacharacters.
    Metacharacters can be quoted with backslashes if QUOTE is nonzero.  */
 static int