This should work automatically.
The configure script is not supposed to set these variables directly,
however it should detect the existence of <dlfcn.h> and dlopen().
There's code in import.c that uses this:
#if !defined(DYNAMIC_LINK) && defined(HAVE_DLFCN_H) && defined(HAVE_DLOPEN)
#define DYNAMIC_LINK
#define USE_SHLIB
#endif
(it may actually look a little different since this is quoting from a
modified version but I'm pretty sure this is in essence what it does).
Check the generated config.h for HAVE_DLFCN_H and HAVE_DLOPEN, to see
whether the configure script thinks these exist (I presume that at
least one of them is undefined). Then have a look at the configure
script and see why it doesn't find them -- it does on our Solaris 2.2
system.
--Guido van Rossum, CWI, Amsterdam <mailto:Guido.van.Rossum@cwi.nl>
<http://www.cwi.nl/cwi/people/Guido.van.Rossum.html>