From 3938da1286534e4b280340411336eed5b6311d1b Mon Sep 17 00:00:00 2001 From: Fabrice Fontaine Date: Wed, 15 Jul 2020 23:21:32 +0200 Subject: [PATCH] Detect glob_pattern_p() The current popt build system tests the existence of , and then assumes that if __GLIBC__ is defined, then glob_pattern_p() must be available. Unfortunately, that's not true with uClibc: 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 [Retrieved (and slightly updated) from: https://git.buildroot.net/buildroot/tree/package/popt/0003-glob-detection.patch] Signed-off-by: Fabrice Fontaine --- configure.ac | 2 +- src/poptconfig.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index a5568c45..3b71d1a4 100755 --- a/configure.ac +++ b/configure.ac @@ -50,7 +50,7 @@ AC_ARG_ENABLE(build-gcov, ]) AC_SEARCH_LIBS(setreuid, [ucb]) -AC_CHECK_FUNCS(getuid geteuid iconv mtrace secure_getenv __secure_getenv setreuid setuid stpcpy strerror vasprintf srandom) +AC_CHECK_FUNCS(getuid geteuid iconv mtrace secure_getenv __secure_getenv setreuid setuid stpcpy strerror vasprintf srandom glob_pattern_p) AM_GNU_GETTEXT_VERSION([0.18.2]) AM_GNU_GETTEXT([external]) diff --git a/src/poptconfig.c b/src/poptconfig.c index 9d97ccdb..b4d1b76c 100644 --- a/src/poptconfig.c +++ b/src/poptconfig.c @@ -21,7 +21,7 @@ #if defined(HAVE_GLOB_H) #include -#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