The cirros image was rebuilt against the 3.13.0-83 kernel, drivers e1000e, igbvf...
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / popt / 0003-glob-detection.patch
1 Detect glob_pattern_p()
2
3 The current popt build system tests the existence of <glob.h>, and
4 then assumes that if __GLIBC__ is defined, then glob_pattern_p() must
5 be available. Unfortunately, that's not true with uClibc: <glob.h> may
6 be installed, but not necessarily the GNU glob extensions... and
7 uClibc defines __GLIBC__. This is causing build issues with certain
8 uClibc toolchains that do not have GNU glob extensions enabled.
9
10 To fix this, this patch adds an AC_CHECK_FUNCS() test for
11 glob_pattern_p, and uses that to find out whether glob_pattern_p() is
12 available or not.
13
14 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
15
16 Index: b/configure.ac
17 ===================================================================
18 --- a/configure.ac
19 +++ b/configure.ac
20 @@ -81,7 +81,7 @@
21  AC_CHECK_FUNC(setreuid, [], [
22      AC_CHECK_LIB(ucb, setreuid, [if echo $LIBS | grep -- -lucb >/dev/null ;then :; else LIBS="$LIBS -lc -lucb" USEUCB=y;fi])
23  ])
24 -AC_CHECK_FUNCS(getuid geteuid iconv mtrace __secure_getenv setregid stpcpy strerror vasprintf srandom)
25 +AC_CHECK_FUNCS(getuid geteuid iconv mtrace __secure_getenv setregid stpcpy strerror vasprintf srandom glob_pattern_p)
26  
27  AM_GNU_GETTEXT([external])
28  AM_ICONV_LINK
29 Index: b/poptconfig.c
30 ===================================================================
31 --- a/poptconfig.c
32 +++ b/poptconfig.c
33 @@ -42,7 +42,7 @@
34  /*@=declundef =exportheader =incondefs =protoparammatch =redecl =type @*/
35  #endif /* __LCLINT__ */
36  
37 -#if !defined(__GLIBC__)
38 +#if !defined(HAVE_GLOB_PATTERN_P)
39  /* Return nonzero if PATTERN contains any metacharacters.
40     Metacharacters can be quoted with backslashes if QUOTE is nonzero.  */
41  static int