Matthew Mitchell
Matthew Mitchell

Reputation: 5393

./configure script incorrectly passing a function check for asprintf

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.

Upvotes: 0

Views: 87

Answers (1)

DanielKO
DanielKO

Reputation: 4517

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.

Upvotes: 1

Related Questions