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

Re: configure: -lpthread doesn't belong in CFLAGS

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Nov 2, 2015, 08:27 UTC
Message-ID
<vpqa8qwst4y.fsf@anie.imag.fr>
In-Reply-To
<201511012230.tA1MUGa5016836@tezro.nonet>
"Rainer M. Canavan" <git@canavan.de> writes:
> Hi,
Hi,

Thanks for the patch. However, it will need a bit more work to be integrated into git.git.

Please, read https://github.com/git/git/blob/master/Documentation/SubmittingPatches

The body of your email should end up being the commit message. It is not (yet) properly written as such. Also, read about Developer's Certificate of Origin in the document above.

Show 5 quoted lines
>    for opt in "" -mt -pthread -lpthread; do
>       old_CFLAGS="$CFLAGS"
> -     CFLAGS="$opt $CFLAGS"
> +     old_LIBS="$LIBS"
> +     if test "$(echo $opt | cut -b 1-2)" = -l ; then

Don't use "echo" on string that may begin with - (different versions of echo will have different behaviors). One option is to use "printf" which is more robust. Another one, more elegant IMHO in this case is to use a case:

case "$opt" in
   -l*)
      # ...
      ;;
   *)
      # ...
      ;;
esac
-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Rainer M. CanavanNext: Rainer M. Canavan
Message 2 of 7 in “configure: -lpthread doesn't belong in CFLAGS”
  1. Rainer M. CanavanNov 1, 2015
  2. Matthieu MoyNov 2, 2015
  3. In configure.ac, try -lpthread in $LIBS instead of $CFLAGS to make picky linkers happyRainer M. Canavan, Nov 6, 2015
  4. Matthieu MoyNov 6, 2015
  5. configure.ac: try -lpthread in $LIBS instead of $CFLAGSRainer M. Canavan, Nov 8, 2015
  6. Matthieu MoyNov 8, 2015
  7. Jeff KingNov 20, 2015

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.