diff options
author | Greg Hudson <ghudson@mit.edu> | 2009-06-08 10:01:57 +0000 |
---|---|---|
committer | Greg Hudson <ghudson@mit.edu> | 2009-06-08 10:01:57 +0000 |
commit | af44e8dee9b5bfffb05eb5a9b89c79c02ab7c2ff (patch) | |
tree | 80783e20aa0a982df33d64b6fbba75f63c03ab18 /src/include | |
parent | 2bb6a5e140cb3d53ff454e624b5fe8aa1d53409f (diff) | |
download | krb5-af44e8dee9b5bfffb05eb5a9b89c79c02ab7c2ff.tar.gz krb5-af44e8dee9b5bfffb05eb5a9b89c79c02ab7c2ff.tar.xz krb5-af44e8dee9b5bfffb05eb5a9b89c79c02ab7c2ff.zip |
Restore limited support for static linking
Add enough static linking support to run the test suite without shared
libraries, to facilitate gcov and other kinds of instrumentation. The
necessary changes include:
* Undo some of the changes which removed static linking support,
and cannibalize the defunct krb5_force_static conditional block
in aclocal.m4.
* Add --enable-static-only configure option.
* For plugins, use a different symbol name for static and dynamic
builds, via a macro in k5plugin.h.
* Add build machinery for building static libraries for plugins
(somewhat grotty due to the difference in names).
* Move plugin subdirs earlier in SUBDIRS in src/Makefile.in.
* Make the in-tree KDB5 plugins dependencies of libkdb5 in a static
build (aclocal.m4 has to know what they are).
* In kdb5.c, cannibalize the broken _KDB5_STATIC_LINK support to
allow "loading" of statically linked plugin libraries.
Preauth, authdata, locate, and GSSAPI plugins are not handled by this
change, as they are not currently necessary to the test suite.
Supporting GSSAPI plugins may be a bit tricky but the others should be
straightforward if they become needed.
$(STLIBEXT) changes from .a-nobuild to .a in a normal shared build as
a result of these changes (except on AIX where aclocal.m4 changes it).
This does not seem to be important as we avoid selecting the static
library for building via other means.
ticket: 6510
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22406 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/k5-plugin.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/include/k5-plugin.h b/src/include/k5-plugin.h index f5f4f43c21..2190c03496 100644 --- a/src/include/k5-plugin.h +++ b/src/include/k5-plugin.h @@ -65,6 +65,23 @@ #include "k5-err.h" +/* + * Plugins normally export fixed symbol names, but when statically + * linking plugins, we need a different symbol name for each plugin. + * The first argument to PLUGIN_SYMBOL_NAME acts as the + * differentiator, and is only used for static plugin linking. + * + * Although this macro (and thus this header file) are used in plugins + * whose code lies inside the krb5 tree, plugins maintained separately + * from the krb5 tree do not need it; they can just use the fixed + * symbol name unconditionally. + */ +#ifdef STATIC_PLUGINS +#define PLUGIN_SYMBOL_NAME(prefix, symbol) prefix ## _ ## symbol +#else +#define PLUGIN_SYMBOL_NAME(prefix, symbol) symbol +#endif + struct plugin_file_handle; /* opaque */ struct plugin_dir_handle { |