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

From: Matthieu Moy <[email-masked]>
Date: Mon, 02 Nov 2015 09:27:41 +0100

"Rainer M. Canavan" <[email-masked]> 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.

>    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/