libsuffix with cmake

William A. Hoffman billlist at nycap.rr.com
Tue Apr 11 22:16:59 CEST 2006


At 02:56 PM 4/11/2006, Andras Mantia wrote:

>No, it is not that easy, as some 64 bit systems use lib64, others use 
>lib and suffix the 32 bit libraries... I have the check written in bash 
>to detect the correct suffix, it just needs to be integrated with the 
>cmake files from KDE. The check itself in automake version is:
>
>cat > conftest.c << EOF
>#include <stdio.h>
>int main() {
> return 0;
>}
>EOF
>        kdelibsuff=`$CC conftest.c -o conftest.out; ldd conftest.out |
>sed -ne '/libc.so/{
>    s,.*/lib\([[^\/]]*\)/.*,\1,
>    p
>}'`

That does not look like a very portable check.  What if the compiler being
used does not link to a libc.so?  Also, not all unix systems support ldd.
This looks like it will work for gcc on linux.

See this table:
http://www.cmake.org/Wiki/CMake_Platform_Dependent_Issues#The_Platforms_.2F_Compilers_Table

So, I guess it is even harder... :) 

I wonder if there is some other way to figure this out?

-Bill



More information about the Kde-buildsystem mailing list