git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] autoconf: Add link tests to each AC_CHECK_FUNC() test

From
RWRalf Wildenhues <ralf.wildenhues@gmx.de>
Date
Jun 8, 2009, 21:24 UTC
Message-ID
<20090608212454.GA834@gmx.de>
In-Reply-To
<7v4p2q3662.fsf@gitster.siamese.dyndns.org>

Hello, and please forgive me for replying to a very old thread, <http://thread.gmane.org/gmane.comp.version-control.git/99159>. (BTW, is that frowned upon on this list?)

* Junio C Hamano wrote on Sun, Nov 02, 2008 at 09:04:21AM CET:
Show 7 quoted lines
> "David M. Syzdek" <david.syzdek@acsalaska.net> writes:
> > Update configure.ac to test libraries for getaddrinfo, strcasestr, memmem,
> > strlcpy, strtoumax, setenv, unsetenv, and mkdtemp.  The default compilers
> > on FreeBSD 4.9-SECURITY and FreeBSD 6.2-RELEASE-p4 do not generate warnings
> > for missing prototypes unless `-Wall' is used. This behavior renders the
> > results of AC_CHECK_FUNC() void on these platforms. The test AC_SEARCH_LIBS()
> > verifies a function is valid by linking to symbol within the system libraries.

This description does not make sense. AC_CHECK_FUNC does not take into account prototypes in the test; instead, it tries to link a program that requires the function symbol. In that matter, the patch that introduced

Show 13 quoted lines
> It's been a looong time since I did any sizeable autoconf/m4 hacking, but
> the repetitititiveness of this patch loudly calls for a convenience macro
> of a higher order, perhaps something like:
> 
>         AC_DEFUN([GIT_CHECK_FUNC],[
>          AC_CHECK_FUNC([$1],[
>           AC_SEARCH_LIBS([$1},,
>           [$2],[$3])],
>           [$3])])
> 
> Then we can use it like:
> 
> 	GIT_CHECK_FUNC([getaddrinfo],[NO_IPV6=],[NO_IPV6=YesPlease])

(which is 1689c5de8730ea334535337a341db3c7a21ad002) is not necessary. However, there might have been another reason altogether why David was seeing false configure test results on his system, and it would be interesting to know about them (both to possibly fix Autoconf, and the comment introducing GIT_CHECK_FUNC in configure.ac).

Otherwise, I'd propose reverting the commit.

Thanks for any feedback, Ralf

Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 4 in “autoconf: Add link tests to each AC_CHECK_FUNC() test”
  1. autoconf: Add link tests to each AC_CHECK_FUNC() testDavid M. Syzdek, Oct 26, 2008
  2. Junio C HamanoNov 2, 2008
  3. Ralf WildenhuesJun 8, 2009
  4. Junio C HamanoJun 9, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.