build: Deal with gperf 3.1 changing to size_t

https://bugzilla.redhat.com/show_bug.cgi?id=1424268

Closes: #631
Approved by: jlebon
This commit is contained in:
Colin Walters 2017-02-17 12:29:10 -05:00 committed by Atomic Bot
parent d520d0b368
commit f6842838d7
2 changed files with 21 additions and 1 deletions

View File

@ -102,6 +102,26 @@ AC_CHECK_TOOL(GPERF, gperf)
AS_IF([test -z "$GPERF"],
AC_MSG_ERROR([*** gperf not found])
)
dnl stolen from https://github.com/systemd/systemd/commit/c9f7b4d
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])
m4_ifdef([GOBJECT_INTROSPECTION_CHECK], [
GOBJECT_INTROSPECTION_CHECK([1.34.0])

View File

@ -43,7 +43,7 @@ struct RpmOstreePackageScriptHandler {
RpmOstreeScriptAction action;
};
const struct RpmOstreePackageScriptHandler* rpmostree_script_gperf_lookup(const char *key, unsigned length);
const struct RpmOstreePackageScriptHandler* rpmostree_script_gperf_lookup(const char *key, GPERF_LEN_TYPE length);
gboolean rpmostree_script_ignore_hash_from_strv (const char *const *strv,
GHashTable **out_hash,