Re: Re: Help getting linking to work and ...

Bram Moolenaar <[email protected]>
Newsgroups gmane.comp.tools.aap.user
Message-ID <[email protected]>
Adriaan de Groot wrote:

> > Of course after that the next problem is the program needs to be compiled &
> > linked with the multi-threaded is there a "portable" variable like for
> > enabling multi-threading?
> 
> Not that I know of right now. I'd suggest using "PTHREAD" as the
> variable name, or PTHREAD_LIBS, which you would set to the
> multi-threading library (if any). The name may be a bit exotic for
> non-BSD users, but it means everything there :) [it could be set to
> -pthread [fbsd 4-stable], -lpthread [solaris], -lkse [fbsd 5-current],
> ... ]

I think there is more to it than adding something to the build command.
On many platforms you also need to add something to the compilation
command, such as "-D_THREAD_SAFE".

Perhaps we can tell the user to do:

	THREADING = yes

And then have the tool take the necessary steps to compile and link with
appropriate arguments?  For FreeBSD it would be something like:

	if os.name == "freebsd" and _no.THREADING == "yes":
		extra_link_arg = "-pthread"
		extra_cc_arg = "-D_THREAD_SAFE"

[_no.THREADING could be misinterpreted, but we can't change "_no" now
without being completely incompatible]

-- 
My girlfriend told me I should be more affectionate.
So I got TWO girlfriends.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///          Creator of Vim - Vi IMproved -- http://www.Vim.org          \\\
\\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
 \\\  Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html  ///


-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?   SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.