static vs. dynamic

Enrico Weigelt weigelt at
Sun Apr 6 10:06:08 PDT 2008

* Tollef Fog Heen <tfheen at> schrieb:
> * "Troy A. Griffitts" 
> | Everything seems to work great for any one of the scenarios, but I don't 
> | understand how to build a .pc file to work correctly for clients 
> | regardless of what is installed (static, dynamic, or both).
> The .pc file would look different, with the dynamic one putting most
> items in the Requires.private section, while the static one would put
> it all in Requires.

You probably want to provide two .pc files, one for static and one for shared lib.

> Static builds are one of the cases pkg-config doesn't handle well, as
> it does not record whether a static library is present or not. 

For a _clean_ handling we would need an major redesign.
Diffenciation between static and dynamic adds another dimension, and we 
still have to talk about situations when not ALL of the deps should be
linked in statically.

For those cases we need to build an complete depedency tree - beginning
directly from the application and decide which of the deps are static
and which are dynamic.

Actually, even in embedded systems, I rarely see the _need_ for static

> I think the build process for sword should write out different .pc
> files depending on whether it's doing a static-only build or not.

Right. We (pkg-config folks) should probably just define an standard
naming scheme. I suggest "*-SHARED.pc" for shared libs, and "*-STATIC.pc"
for static ones - those w/o that suffix are undefined.

 Enrico Weigelt    ==   metux IT service -
 Please visit the OpenSource QM Taskforce:
 Patches / Fixes for a lot dozens of packages in dozens of versions:

More information about the pkg-config mailing list