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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Max Horn <max@xxxxxxxxx> writes:

> The configure script checks whether certain flags / libraries are
> required to use pthreads. But so far it did not consider the possibility
> that no extra compiler flags are needed (as is the case on Mac OS X). As
> a result, configure would always add "-mt" to the list of flags. This in
> turn triggered a warning in clang about an unknown argument.
> To solve this, we now first check if pthreads work without extra flags.
>
> Signed-off-by: Max Horn <max@xxxxxxxxx>
> ---
>  configure.ac | 2 +-
>  1 Datei geändert, 1 Zeile hinzugefügt(+), 1 Zeile entfernt(-)
>
> 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?  I'd prefer a
solution that is order independent, or if the change is order
dependent, then a comment to warn others from changing it later.

>       old_CFLAGS="$CFLAGS"
>       CFLAGS="$opt $CFLAGS"
>       AC_MSG_CHECKING([Checking for POSIX Threads with '$opt'])

Perhaps "for linking with POSIX Threads" would make it clearer, as
CFLAGS (rather, PTHREAD_CFLAGS) has been checked earlier separately.

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]