autoconf-archive-maintainers
[Top][All Lists]
Advanced

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

Re: [patch #8081] AX_PTHREAD.m4 not setting PTHREAD_LIBS to -pthread for


From: Daniel Richard G.
Subject: Re: [patch #8081] AX_PTHREAD.m4 not setting PTHREAD_LIBS to -pthread for gcc 4.7.2
Date: Fri, 21 Jun 2013 01:05:30 -0400

On Wed, 2013 Jun 19 23:03-0700, Al Pacifico wrote:
> 
> My configure.ac now contains
> 
> AX_PTHREAD(
>   [AC_DEFINE([HAVE_PTHREAD], [1],
>     [Define if you have POSIX threads libraries and header files.])
>     LDFLAGS="$CFLAGS $PTHREAD_CFLAGS $LDFLAGS $PTHREAD_LIBS $LIBS"])
> 
> and seems to work as I had expected.

That's a bit more than you need, presuming that you are using Automake-
generated makefiles. For example, CFLAGS and LIBS are already included
at link time, and thus it would be more appropriate to add
PTHREAD_CFLAGS to CFLAGS.

I would suggest having a look at the actual linker invocation in the
makefile, what variables are being passed in, and what the values of
those variables are. You'll see the redundancies pretty quickly.

> Obviously I am not the only one who failed to understand this despite
> reading the macro's documentation. Might I suggest inclusion of an
> example in the macro's documentation?

Line twenty-three.


--Daniel


-- 
Daniel Richard G. || address@hidden
My ASCII-art .sig got a bad case of Times New Roman.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]