git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Nicolas Sebrecht <nicolas.s.dev@gmx.fr>
Cc: git@vger.kernel.org, Johannes Sixt <j6t@kdbg.org>,
	Jeff King <peff@peff.net>, Brandon Casey <casey@nrlssc.navy.mil>,
	David Syzdek <david@syzdek.net>,
	Jakub Narebski <jnareb@gmail.com>
Subject: Re: [PATCH] Re: configure: use AC_SEARCH_LIBS instead of AC_CHECK_LIB
Date: Sun, 19 Jul 2009 09:13:41 -0700	[thread overview]
Message-ID: <7v3a8szm4q.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <20090719131404.GA11546@vidovic> (Nicolas Sebrecht's message of "Sun\, 19 Jul 2009 15\:14\:04 +0200")

Nicolas Sebrecht <nicolas.s.dev@gmx.fr> writes:

> I wonder if we could have some feedbacks on this patch. The change on
> the whole file may make more bad than good. Works as expected here on
> Linux (glibc 2.9).
>
> Otherwise, the following lines are sufficient to correct the original
> error:
>
>>  test -n "$NEEDS_RESOLV" && LIBS="$LIBS -lresolv"
>>  
>> -AC_CHECK_LIB([gen], [basename],
>> +AC_SEARCH_LIBS([basename], [gen],
>>  [NEEDS_LIBGEN=],
>>  [NEEDS_LIBGEN=YesPlease])
>>  AC_SUBST(NEEDS_LIBGEN)

Thanks.

The autoconf documentation does not give much confidence either way:

	AC_CHECK_LIB requires some care in usage, and should be avoided in
	some common cases.

It is unclear what these "some" are, and is sufficiently unclear for us to
decide if our situation falls into these "some common cases."  The only
problem it cites is that alternative libraries may contain a variant
implementation of the same function found in a more common library, in
which case you may not want to use such an alternative implementation, and
I do not think "basename() in -lgen" falls into that category.

It does say

	These days it is normally better to use AC_SEARCH_LIBS(...)
	instead of AC_CHECK_LIB(...).

but without any further justification, which does not help building
confidence in the suggestion.

It is very tempting to revert the configure.ac part of commit ecc395c
especially in an -rc freeze, but if some autoconf experts can help us
decide by clarifying the situation, and explain why AC_SEARCH_LIBS() is
indeed the better way these days (which I suspect it is), I'd say we can
apply your patch to favor AC_SEARCH_LIBS() over AC_CHECK_LIB() with more
confidence.

If autoconf people say AC_SEARCH_LIBS() should be preferred over
AC_CHECK_LIB(), it probably is the right thing to do.  But I want to have
a warmer-and-fuzzier feeling that we understand why it went wrong, rather
than blindly doing what the documentation says because the documentation
tells us to.

  reply	other threads:[~2009-07-19 16:13 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-18 13:45 [test failure] t4114 binary file becomes symlink Nicolas Sebrecht
2009-07-18 13:56 ` Jeff King
2009-07-18 14:16   ` [test failure] " Nicolas Sebrecht
2009-07-18 15:31     ` Jeff King
2009-07-18 18:46       ` Junio C Hamano
2009-07-18 20:39         ` Nicolas Sebrecht
2009-07-18 23:18         ` Linus Torvalds
2009-07-18 19:06     ` Johannes Sixt
2009-07-18 20:17       ` Nicolas Sebrecht
2009-07-18 21:13         ` Nicolas Sebrecht
2009-07-19 10:33           ` ./configure misdetects SNPRINTF_RETURNS_BOGUS (was: [test failure] t4114 binary file becomes symlink) Jakub Narebski
2009-07-19 12:48             ` [PATCH] configure: use AC_SEARCH_LIBS instead of AC_CHECK_LIB Nicolas Sebrecht
2009-07-19 13:14               ` [PATCH] " Nicolas Sebrecht
2009-07-19 16:13                 ` Junio C Hamano [this message]
2009-07-19 22:53                   ` Eric Blake
2009-07-21 15:04               ` [PATCH] " Brandon Casey
2009-07-21 15:12                 ` Brandon Casey
2009-07-21 15:20                 ` Paolo Bonzini
2009-07-21 15:34                   ` Brandon Casey
2009-07-21 20:23                     ` [PATCH] configure.ac: rework/fix the NEEDS_RESOLV and NEEDS_LIBGEN tests Brandon Casey
2009-07-21 20:33                       ` Junio C Hamano
2009-07-22 14:59                         ` Brandon Casey
2009-07-22 22:15                       ` [PATCH] config.mak.in: continue fixing NEEDS_LIBGEN autoconfigure feature Brandon Casey
2009-07-22 22:35                         ` Junio C Hamano
2009-07-23 16:22                         ` Brandon Casey
2009-07-18 22:03         ` [test failure] Re: t4114 binary file becomes symlink Johannes Sixt
2009-07-18 22:29       ` Jeff King
2009-07-18 22:51         ` Nicolas Sebrecht
2009-07-19 11:01         ` Johannes Sixt
2009-07-20  9:09           ` Jeff King
2009-07-20 20:51             ` Johannes Sixt
2009-07-20 21:56               ` Linus Torvalds

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7v3a8szm4q.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=casey@nrlssc.navy.mil \
    --cc=david@syzdek.net \
    --cc=git@vger.kernel.org \
    --cc=j6t@kdbg.org \
    --cc=jnareb@gmail.com \
    --cc=nicolas.s.dev@gmx.fr \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).