automake
[Top][All Lists]
Advanced

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

Re: How to make a 'pthread' program ?


From: steven woody
Subject: Re: How to make a 'pthread' program ?
Date: Tue, 3 Jan 2006 19:17:15 +0800

On 1/3/06, Bob Friesenhahn <address@hidden> wrote:
> On Tue, 3 Jan 2006, Steven Woody wrote:
>
> > on linux, simplly adding a '-pthread' option to the command line gcc, i can
> > make a multi-thread c program. but if using automake, i only got many
> > undefined reference to pthread_xxx errors. i've already add the '-pthread'
> > to the myprogram_CFLAGS variable.
>
> The '-pthread' option is a non-standard compiler extension which
> causes different pre-processor definitions to be applied, and
> different/additional libraries to be applied.  You should not assume
> that other compilers/platforms work with '-pthread'.  So if you insert
> it into myprogram_CFLAGS then your package will only work if the
> compiler supports the '-pthread' option.
>
> Note that CFLAGS is only applied when compiling.  The LDFLAGS value is
> used while linking so if you want to use '-pthread' then you should
> supply it for both CFLAGS and LDFLAGS.
>
> The Autoconf macro archive includes a macro for determining the
> correct options to use in a platform-independent way.


thanks, the LDFLAGS works.  and i also interest in what the
determining macro you mentioned is and how i should use it.

>
> Bob
> ======================================
> Bob Friesenhahn
> address@hidden, http://www.simplesystems.org/users/bfriesen/
> GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/
>


--
woody




reply via email to

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