libtool
[Top][All Lists]
Advanced

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

Re: Defines dependent on static/dynamic build


From: Gary V. Vaughan
Subject: Re: Defines dependent on static/dynamic build
Date: Tue, 25 Nov 2003 13:50:32 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20030925 Thunderbird/0.3

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Bob Friesenhahn wrote:
| I am faced with building some existing code that wants to have
| __STATIC__ defined while building a static library, and __DYNAMIC__
| defined while building a shared library.  Since only libtool knows
| what it is doing and libtool will make its own decisions, this seems
| difficult to accomplish using libtool.  Perhaps this could be
| accomplished by modifying libtool's 'pic_flag' variable.
|
| I seem to recall that libtool used to define something when compiling
| a shared library, but that this support was removed.  Presumably this
| was because there was some other way to accomplish the same thing.

I think you are thinking about the Windows lt_prog_compiler_pic=-DDLL_EXPORT 
hack?

| Does anyone know of a way to get libtool to behave the way I need?

To do it right would involve adding new code to libtool that passes an extra
CPPFLAG when compiling objects for shared libs... this is subtly different to
the pic_flag, because some hosts build static libs from pic objects, and some
compilers always produce pic code.  The logic might happen to be the same
though...

The quick hack would be to add something like this near the end of your
configure.ac:

AC_CONFIG_COMMANDS([hack-libtool], [
~  $SED 's,^pic_flag=,pic_flag=-D__DYNAMIC__,' $ofile > ${ofile}T \
~    && mv -f ${ofile}T $ofile && chmod 755 ${ofile}
])

Cheers,
        Gary.
- --
Gary V. Vaughan      ())_.  address@hidden,gnu.org}
Research Scientist   ( '/   http://www.oranda.demon.co.uk
GNU Hacker           / )=   http://www.gnu.org/software/libtool
Technical Author   `(_~)_   http://sources.redhat.com/autobook
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQE/w14oFRMICSmD1gYRAlSlAJ9t4ziMjUL3FN2XsndXHvnpe1PfNACgqlW+
d+bXJn0nSZ8ufNuQ/OOPO4A=
=KZXf
-----END PGP SIGNATURE-----





reply via email to

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