Skip to content

Commit

Permalink
Detect glob_pattern_p()
Browse files Browse the repository at this point in the history
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>
[Retrieved (and slightly updated) from:
https://git.buildroot.net/buildroot/tree/package/popt/0003-glob-detection.patch]
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  • Loading branch information
ffontaine authored and ffesti committed Jul 21, 2020
1 parent 7fd0c9b commit 3938da1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Expand Up @@ -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])
Expand Down
2 changes: 1 addition & 1 deletion src/poptconfig.c
Expand Up @@ -21,7 +21,7 @@
#if defined(HAVE_GLOB_H)
#include <glob.h>

#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
Expand Down

0 comments on commit 3938da1

Please sign in to comment.