Search non-locally-defined dependent symbols

We only generate ctypes bindings for symbols defined in source files
provided by users, that is, we do not generate ctypes bindings for
symbols defined in included headers.  This is useful because the
included headers tend to have lots of symbols that are not used by the
source files.  However, some of those non-locally defined symbols are
depended by the source files and in this case we should search and
generate ctypes bindings for them.