I am building a shared library for the Debian GNU/Linux distribution and I am worried about the number of symbols from internal functions that it exports without any need. Since the library is built using autoconf/automake/libtool, the answer is easy: I can just add -export-symbols libfoo.sym
to libfoo_la_LDFLAGS
and specify only the symbols I want exported in that file.
But since this involves error-prone manual work, I figured that there has to be a better way. Is it possible to automate reading the (in this case) dozens of .h
files that accompany the library and generate a first version of the libfoo.syms
file.
Could I just use the C (or C++) compiler to do the busy work for me?