aboutsummaryrefslogtreecommitdiff
path: root/package/popt/0002-Detect-glob_pattern_p.patch
diff options
context:
space:
mode:
Diffstat (limited to 'package/popt/0002-Detect-glob_pattern_p.patch')
-rw-r--r--package/popt/0002-Detect-glob_pattern_p.patch53
1 files changed, 53 insertions, 0 deletions
diff --git a/package/popt/0002-Detect-glob_pattern_p.patch b/package/popt/0002-Detect-glob_pattern_p.patch
new file mode 100644
index 0000000000..f64ad36f86
--- /dev/null
+++ b/package/popt/0002-Detect-glob_pattern_p.patch
@@ -0,0 +1,53 @@
+From 3938da1286534e4b280340411336eed5b6311d1b Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Wed, 15 Jul 2020 23:21:32 +0200
+Subject: [PATCH] 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>
+[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>
+[Retrieved from:
+https://github.com/rpm-software-management/popt/commit/3938da1286534e4b280340411336eed5b6311d1b]
+---
+ configure.ac | 2 +-
+ src/poptconfig.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index a5568c4..3b71d1a 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 9d97ccd..b4d1b76 100644
+--- a/src/poptconfig.c
++++ b/src/poptconfig.c
+@@ -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