summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorMike Gilbert <floppymaster@gmail.com>2017-01-10 02:39:05 -0500
committerMartin Pitt <martin.pitt@ubuntu.com>2017-01-10 08:39:05 +0100
commitc9f7b4d356a453a01aa77a6bb74ca7ef49732c08 (patch)
tree2a12f9a2e94d9fafe07af88d2eee2ee958f05c40 /configure.ac
parent64083a6078630372623bb1013a45d3bf31d8a836 (diff)
build-sys: add check for gperf lookup function signature (#5055)
gperf-3.1 generates lookup functions that take a size_t length parameter instead of unsigned int. Test for this at configure time. Fixes: https://github.com/systemd/systemd/issues/5039
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac22
1 files changed, 22 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 11bd46cbab..d58fff51c4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -255,6 +255,28 @@ AC_CHECK_SIZEOF(rlim_t,,[
#include <sys/resource.h>
])
+GPERF_TEST="$(echo foo,bar | ${GPERF} -L ANSI-C)"
+
+AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([
+ #include <string.h>
+ const char * in_word_set(const char *, size_t);
+ $GPERF_TEST]
+ )],
+ [GPERF_LEN_TYPE=size_t],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([
+ #include <string.h>
+ const char * in_word_set(const char *, unsigned);
+ $GPERF_TEST]
+ )],
+ [GPERF_LEN_TYPE=unsigned],
+ [AC_MSG_ERROR([** unable to determine gperf len type])]
+ )]
+)
+
+AC_DEFINE_UNQUOTED([GPERF_LEN_TYPE], [$GPERF_LEN_TYPE], [gperf len type])
+
# ------------------------------------------------------------------------------
# we use python to build the man page index
have_python=no