質問

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