[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: pthread linking issue
From: |
Bob Friesenhahn |
Subject: |
Re: pthread linking issue |
Date: |
Tue, 19 Oct 2004 17:54:43 -0500 (CDT) |
On Tue, 19 Oct 2004, Chris Coleman wrote:
I have a question about the libtool package and automake...
In my configure.in I have AC_PROG_LIBTOOL to set up the necessary bits n
bobs. I also have the macro ACX_PTHREAD to determine which threading
libraries are needed in order to link my app.
However on the final stage of make (and only since I added libtool to the
project) it now fails with the errors below. Now I guess its not linking with
the pthread library for some reason. -pthread is what the ACX_PTHREAD macro
chooses both on solaris and linux, however if I copy and past the libtool
link line at the bottom and change -pthread to -lpthread the final
excecutable compiles with no problem. Any clues as to why this is, whats the
difference and how to solve it?
Released libtool provides no special handling for -pthread so it is
not passed to the compiler. Libtool 2.0 (in the throes of final
bug-fixing and testing) will pass -pthread to the compiler.
As a work-around you can avoid using -pthread and pass the necessary
pre-processor option (e.g. -D_REENTRANT) and library (e.g. -lpthread)
via CPPFLAGS and LIBS.
For the package I support, I was not happy with ACX_PTHREAD so I use a
modified version which provides the CPPFLAGS and LIBS info I need.
The ACX_PTHREAD macro actually knows all of this internally, but
requires some modifications to extract it.
Bob
======================================
Bob Friesenhahn
address@hidden
http://www.simplesystems.org/users/bfriesen