0003-glob-detection.patch 1.6 KB

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