diff -urd crosstool-ng.orig/configure crosstool-ng.new/configure --- crosstool-ng.orig/configure 2015-11-20 14:03:36.000000000 +0100 +++ crosstool-ng.new/configure 2017-05-27 10:12:40.383087059 +0200 @@ -635,6 +635,7 @@ lzma xz kconfig_options +GPERF_LEN_TYPE automake LIBTOOLIZE LIBTOOL @@ -5331,6 +5332,27 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_automake" >&5 $as_echo "$ac_cv_path_automake" >&6; } automake=$ac_cv_path_automake + + +#---------------------------------------- +# Gperf 3.1 started generating functions with size_t rather than unsigned int +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the type used in gperf declarations" >&5 +$as_echo_n "checking for the type used in gperf declarations... " >&6; } +echo "#include " > conftest.gperf.c +echo "const char * in_word_set(const char *, GPERF_LEN_TYPE);" >> conftest.gperf.c +echo foo,bar | ${GPERF} -L ANSI-C >> conftest.gperf.c +if ${CC} -c -o /dev/null conftest.gperf.c -DGPERF_LEN_TYPE='size_t' >/dev/null 2>&1; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: size_t" >&5 +$as_echo "size_t" >&6; } + GPERF_LEN_TYPE='size_t' +elif ${CC} -c -o /dev/null conftest.gperf.c -DGPERF_LEN_TYPE='unsigned int' >/dev/null 2>&1; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsigned int" >&5 +$as_echo "unsigned int" >&6; } + GPERF_LEN_TYPE='unsigned int' +else + as_fn_error $? "unable to determine gperf len type" "$LINENO" 5 +fi +rm -f conftest.gperf.c #-------------------------------------------------------------------- diff -urd crosstool-ng.orig/configure.ac crosstool-ng.new/configure.ac --- crosstool-ng.orig/configure.ac 2015-11-18 06:29:15.000000000 +0100 +++ crosstool-ng.new/configure.ac 2017-05-27 10:00:57.411342197 +0200 @@ -290,6 +290,22 @@ AC_MSG_ERROR([could not find GNU automake >= 1.10])])]) AC_SUBST([automake], [$ac_cv_path_automake]) +#---------------------------------------- +# Gperf 3.1 started generating functions with size_t rather than unsigned int +AC_MSG_CHECKING([for the type used in gperf declarations]) +echo "#include " > conftest.gperf.c +echo "const char * in_word_set(const char *, GPERF_LEN_TYPE);" >> conftest.gperf.c +echo foo,bar | ${GPERF} -L ANSI-C >> conftest.gperf.c +AS_IF([${CC} -c -o /dev/null conftest.gperf.c -DGPERF_LEN_TYPE='size_t' >/dev/null 2>&1], + [AC_MSG_RESULT([size_t]) + GPERF_LEN_TYPE='size_t'], + [${CC} -c -o /dev/null conftest.gperf.c -DGPERF_LEN_TYPE='unsigned int' >/dev/null 2>&1], + [AC_MSG_RESULT([unsigned int]) + GPERF_LEN_TYPE='unsigned int'], + [AC_MSG_ERROR([unable to determine gperf len type])]) +rm -f conftest.gperf.c +AC_SUBST([GPERF_LEN_TYPE]) + #-------------------------------------------------------------------- # Boring again... But still a bit of work to do... #-------------------------------------------------------------------- diff -urd crosstool-ng.orig/kconfig/Makefile crosstool-ng.new/kconfig/Makefile --- crosstool-ng.orig/kconfig/Makefile 2015-11-18 06:29:15.000000000 +0100 +++ crosstool-ng.new/kconfig/Makefile 2017-05-27 10:00:57.411342197 +0200 @@ -6,7 +6,8 @@ @true # Just be silent, you fscking son of a fscking beach... # Build flags -CFLAGS = -DCONFIG_=\"CT_\" -DPACKAGE="\"crosstool-NG $(VERSION)\"" +CFLAGS = -DCONFIG_=\"CT_\" -DPACKAGE="\"crosstool-NG $(VERSION)\"" \ + -DGPERF_LEN_TYPE="$(gperf_len_type)" LDFLAGS = $(INTL_LIBS) # Compiler flags to use gettext diff -urd crosstool-ng.orig/kconfig/zconf.gperf crosstool-ng.new/kconfig/zconf.gperf --- crosstool-ng.orig/kconfig/zconf.gperf 2015-11-18 06:29:15.000000000 +0100 +++ crosstool-ng.new/kconfig/zconf.gperf 2017-05-27 10:00:57.411342197 +0200 @@ -9,7 +9,7 @@ struct kconf_id; -static const struct kconf_id *kconf_id_lookup(register const char *str, register unsigned int len); +static const struct kconf_id *kconf_id_lookup(register const char *str, register GPERF_LEN_TYPE len); %% mainmenu, T_MAINMENU, TF_COMMAND diff -urd crosstool-ng.orig/Makefile.in crosstool-ng.new/Makefile.in --- crosstool-ng.orig/Makefile.in 2015-11-19 23:43:15.000000000 +0100 +++ crosstool-ng.new/Makefile.in 2017-05-27 10:00:57.411342197 +0200 @@ -69,6 +69,7 @@ export readelf := @READELF@ export patch := @PATCH@ export gperf := @GPERF@ +export gperf_len_type := @GPERF_LEN_TYPE@ export CC := @CC@ export CPP := @CPP@ export CPPFLAGS := @CPPFLAGS@