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

Re: [PATCH] Change configure to check if pthreads are usable without any extra flags

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 9, 2012, 17:44 UTC
Message-ID
<7vy5mskewg.fsf@alter.siamese.dyndns.org>
In-Reply-To
<C56B4151-8912-4B3A-8A97-E769A878AE68@quendi.de>
Max Horn <max@quendi.de> writes:
Show 15 quoted lines
>>> diff --git a/configure.ac b/configure.ac
>>> index 4e9012f..d767ef3 100644
>>> --- a/configure.ac
>>> +++ b/configure.ac
>>> @@ -1002,7 +1002,7 @@ if test -n "$USER_NOPTHREAD"; then
>>> # -D_REENTRANT' or some such.
>>> elif test -z "$PTHREAD_CFLAGS"; then
>>>   threads_found=no
>>> -  for opt in -mt -pthread -lpthread; do
>>> +  for opt in "" -mt -pthread -lpthread; do
>> 
>> Hmph.  Would it work to append the new empty string at the end of
>> the existing list, as opposed to prepending it?
>
> No, because that loop aborts on the first match that "works". Since no flags are necessary on OS X, but adding "-mt" to the flags "works" in the sense that it does nothing (except triggering a warning about an unknown argument), we need to check the empty string before "-mt" that. 

If the test in that "for opt ...; do" considers the linking "work", why do you even want to tweak it, and instead let "-mt" be passed?

If the warning troubles you, would it be feasible for the purpose of the check to tweak the definition of "works" used in the loop so that it considers the warning as "not working"?

Previous: Max HornNext: Max Horn
Message 4 of 9 in “Change configure to check if pthreads are usable without any extra flags”
  1. Change configure to check if pthreads are usable without any extra flagsMax Horn, Jul 5, 2012
  2. Junio C HamanoJul 9, 2012
  3. Max HornJul 9, 2012
  4. Junio C HamanoJul 9, 2012
  5. Max HornJul 9, 2012
  6. Junio C HamanoJul 9, 2012
  7. Max HornJul 9, 2012
  8. Junio C HamanoJul 9, 2012
  9. Max HornJul 10, 2012

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.