[CMake] Mirroring libtool shared library creation for AIX in cmake

Albert Chin cmake at mlists.thewrittenword.com
Wed Sep 19 17:55:19 EDT 2007


When using -brtl, libtool creates shared libraries on AIX with:
  $ nm -BCpg [object files] | awk '{
if ((($2 == "T") || ($2 == "D") ||
   ($2 == "B")) && (substr($3,1,1) != ".")) {
  print $3
} }' | sort -u > lib.exp
  $ xlc -o [shared library] [object files] ... \
  -Wl,-brtl -Wl,-blibpath:/usr/lib -Wl,-bexport:lib.exp -G

How can I do this in cmake? Unless you do this, you get a minimum list
of exported symbols in the shared library, if any. For GCC-created
shared libraries, variables prefixed with `_' are not exported. The
above catches them. I suppose -bexpall could also be used but I'm
trying to avoid that catchall.

-- 
albert chin (china at thewrittenword.com)


More information about the CMake mailing list