[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
link statically with one library and dynamically with another?
From: |
Jack Bates |
Subject: |
link statically with one library and dynamically with another? |
Date: |
Sun, 04 May 2008 19:13:33 -0700 |
How can I link statically with one library and dynamically with another?
I am building an Apache module which uses libtidy:
http://tidy.sourceforge.net/
Because I frequently want to install this module on Mac OS X, which does
not by default ship with a libtidy shared library, I include the libtidy
source when I distribute my module. When I build my module, I also build
libtidy, and statically link my module with it.
However I do not want to statically link my module with Apache or libapr
(Apache Portable Runtime) and I cannot figure out how to link statically
with libtidy and dynamically with everything else.
When I build my module, I call (Automake calls):
libtool --mode=link ... -module /usr/lib/libapr-1.la
$(top_srcdir)/tidy/src/libtidy.la ...
- which links dynamically with libapr and libtidy.
I tried calling instead:
libtool --mode=link ... -module /usr/lib/libapr-1.la
$(top_srcdir)/tidy/src/.libs/libtidy.a ...
- which did successfully link dynamically with libapr and statically
with libtidy, but libtool warned me that referencing .libs/libtidy.a was
not portable.
How can I link statically with libtidy and dynamically with libapr?
Thanks and best wishes, Jack
signature.asc
Description: This is a digitally signed message part
- link statically with one library and dynamically with another?,
Jack Bates <=