libtool
[Top][All Lists]
Advanced

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

Re: Building all static


From: Gary V. Vaughan
Subject: Re: Building all static
Date: Tue, 02 Nov 2004 15:44:20 +0000
User-agent: Mozilla Thunderbird 0.8 (X11/20040913)

Hi Bill,

Bill Moseley wrote:
>     $ grep -- -static src/Makefile.am
>     libtest_LDFLAGS = -static
> 
> (which maybe answers your question if anyone is using -static)

Not really.  See my other post to this thread.

> I'm not using AC_DISABLE_STATIC in configure -- and using
> --enable-static (without listing packages) seems to have no effect.
> So do I have something setup incorrectly?

Nope.  --enable-static is the default unless AC_DISABLE_STATIC is used
in configure.ac.  You could stop building static libraries by passing
--disable-static, or adding AC_DISABLE_STATIC to configure.ac.

--{en,dis}able-static vs AC_{DIS,EN}ABLE_STATIC apply to what kind of
libtool libraries to build, and have no effect on how programs are
linked.

> $ ./configure --prefix=$HOME/static LD_FLAGS='-all-static' >/dev/null && make 
> install >/dev/null

just LDFLAGS                           ^^^

> 
> $ ldd $HOME/static/bin/swish-e
>         libxml2.so.2 => /usr/lib/libxml2.so.2 (0x40027000)
>         libpthread.so.0 => /lib/tls/libpthread.so.0 (0x40122000)
>         libz.so.1 => /usr/lib/libz.so.1 (0x40132000)
>         libswish-e.so.2 => /home/moseley/static/lib/libswish-e.so.2 
> (0x40144000)
>         libm.so.6 => /lib/tls/libm.so.6 (0x4017a000)
>         libc.so.6 => /lib/tls/libc.so.6 (0x4019d000)
>         /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
> 
> So, does that mean I'm not passing in a variable to my Makefile.am?
> 
>   
> http://cvs.sourceforge.net/viewcvs.py/swishe/swish-e/src/Makefile.am?rev=1.12&view=auto

If you leave libtest_LDFLAGS = -static and pass LDFLAGS=-all-static, you'll
end up running

   libtool --mode=link -static -all-static ...

In that case, behaviour is undefined, you should pick just one of those options.

>>Does anyone use libtool's -static flag to deliberately link statically
>>against libtool libraries only?  I would have thought that it is far
>>more common to want all-static behaviour.
> 
> 
> I'm not really clear on what you are asking, but I use -static in my
> Makefile.am to always link a little test program with our library
> statically to help with debugging.
> 
> $ ldd libtest
>         libz.so.1 => /usr/lib/libz.so.1 (0x40027000)
>         libm.so.6 => /lib/tls/libm.so.6 (0x40039000)
>         libc.so.6 => /lib/tls/libc.so.6 (0x4005d000)
>         /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
> 
> So libswish-e is linked statically there.

But would you be unhappy if libtool took -static to be the same as calling
cc -static and/or ld -static to link?

Cheers,
        Gary.
-- 
Gary V. Vaughan      ())_.  address@hidden,gnu.org}
Research Scientist   ( '/   http://tkd.kicks-ass.net
GNU Hacker           / )=   http://www.gnu.org/software/libtool
Technical Author   `(_~)_   http://sources.redhat.com/autobook

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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