문제

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