Skip to Content.
Sympa Menu

freetds - Re: [freetds] ct-lib unit tests link statically

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT freetds.org>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] ct-lib unit tests link statically
  • Date: Mon, 7 Jul 2008 08:25:18 -0400

ZIGLIO, Frediano, VF-IT wrote:
> > I noticed the ct-lib unit tests were linking to the installed shared
> > object. That's not optimal behavior; it's nice to run the unit tests
> > before installing. Now they link statically to the
> > uninstalled libct.a.

>
> I thought libtool would take care of linking with proper libraries
> either linking with static, using some additional linking parameter or
> using a script to add some environment.

Hi Freddy,

libtool only does what it's told. We were specifying -L options for the
installed directories. ldd(1) told the story.

For many people, including me, the RPATH is contolled by the build
environment. It's not easy to give one RPATH for most applications
(including e.g. fisql) and another for unit tests. If you can think of a
way to do that, I'd be interested.

Meanwhile, by linking statically, the unit tests test the built version,
not the installed one. :-)

> On Linux ctlib unitests now don't compile:
>
> ../.libs/libct.a(util.o): In function `tds_gettime_ms':
> /home/freddy/cpp/freetds/freetds83/src/tds/util.c:216: undefined
> reference to `clock_gettime'

http://linux.die.net/man/3/clock_gettime

"Most systems require the program be linked with the librt library to
use
these functions."

I think libtool will handle for us. I'm not sure how to do that. Maybe
-static in AM_LDFLAGS but I don't have time just now to try it.

Regards,

--jkl




Archive powered by MHonArc 2.6.24.

Top of Page