Вопрос

In an autoconf script I have:

AC_CHECK_FUNC([asprintf],
    [CONFIGFLAGS+=" -DCB_HAVE_ASPRINTF"],
    []
)

And this passes, thus defining CB_HAVE_ASPRINTF. But without defining _GNU_SOURCE the makefile will fail, so it is incorrect for the configure script to pass this function. What is wrong with it?

This problem is occurring on Linux Mint 13.

Это было полезно?

Решение

AC_CHECK_FUNC[S] only does link-time checks, it doesn't check the headers.

Also, it's documented as being a GNU extension, so you should only try to use it if you defined _GNU_SOURCE before the includes or in the command-line.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top