From: Ian Jackson Subject: Re: [PATCH 06/20] tools: Correct PTHREAD options in config/StdGNU.mk Date: Mon, 19 Mar 2012 16:34:26 +0000 Message-ID: <20327.24594.567554.42651@mariner.uk.xensource.com> References: <1331915215-10477-1-git-send-email-ian.jackson@eu.citrix.com> <1331915215-10477-7-git-send-email-ian.jackson@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Roger Pau =?iso-8859-1?Q?Monn=E9?= Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org Roger Pau Monn=E9 writes ("Re: [PATCH 06/20] tools: Correct PTHREAD options= in config/StdGNU.mk"): > 2012/3/16 Ian Jackson : > > It is not correct to say -lpthread. =A0The correct option is -pthread, > > which may have sundry other effects on code generation etc. =A0It needs > > to be passed both to compilation and linking. ... > Acked-by: Roger Pau Monne Thanks. > > + =A0 =A0 =A0 =A0AC_LINK_IFELSE([ > > +#include > > +int main(void) { > > + =A0pthread_atfork(0,0,0); > > + =A0pthread_create(0,0,0,0); > > +} > = > You can also use something like this here, which is more autoconf style: > = > AC_LANG_PROGRAM([#include ],[ > pthread_atfork(0,0,0); > pthread_create(0,0,0,0);]) > = > But as is looks correct to me, I'm not a big fan of autoconf macros. Thanks for the comment. I think I agree with your sentiment so I'll leave this as it is. > > +],[],[ax_cv_pthread_flags=3Dfailed]) > > +AC_DEFUN([AX_SAVEVAR_SAVE],[ > > + =A0 =A0saved_$1=3D"$$1" > > +]) > > +AC_DEFUN([AX_SAVEVAR_RESTORE],[ > > + =A0 =A0$1=3D"$saved_$1" > > +]) > = > This little macros will prove useful on other places, such as > python_devel.m4, that actually uses ac_previous_* to temporary store > variables. Right, that was the idea. Ian.