diff options
author | Alexey Neyman <stilor@att.net> | 2017-01-14 05:44:03 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-14 05:44:03 (GMT) |
commit | 8f1523abea5aee8c648529910a94a33683a96a4a (patch) | |
tree | e9631de939785e8998faedf3eb26560b6ee0011c /configure.ac | |
parent | cbb045ab333df1047a6a9851c19c4b0b61442011 (diff) | |
parent | 3bb2bcd2a328fb56332398783e91899ce3bc3556 (diff) |
Merge pull request #529 from stilor/gperf-3.1-fix
Add a check for gperf function signature.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac index 492d315..76f0d30 100644 --- a/configure.ac +++ b/configure.ac @@ -134,9 +134,9 @@ AS_IF([test -z "$CC"], AC_PROG_CPP #--------------------------------------------------------------------- -# Check to see if gcc can static link -AC_MSG_CHECKING([if gcc can static link]) -echo "int main() {}" | gcc -static -o /dev/null -xc - > /dev/null 2>&1 +# Check to see if the compiler can link statically +AC_MSG_CHECKING([if $CC can static link]) +echo "int main() {}" | ${CC} -static -o /dev/null -xc - > /dev/null 2>&1 static_test=$? AS_IF([test $static_test -eq 0], [static_link=y @@ -305,6 +305,22 @@ AC_CACHE_CHECK([for GNU automake >= 1.10], [ac_cv_path_automake], 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 <string.h>" > 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... #-------------------------------------------------------------------- |