On 25.01.2012 21:19, Dmitry V. Levin wrote:
[...]
While the patch is certainly correct, --enable-static-modules still
fails
to build even with this change applied.
The straightforward command
$ ./autogen.sh&& ./configure --enable-static-modules --disable-pie&&
make
fails with the following complaint:
make[3]: *** No rule to make target `../../libpam/libpam.la', needed by
`pam_access.la'. Stop.
In the usual way to build pam, i.e. not in --enable-static-modules mode,
libpam is actually required to link pam modules, so "libpam" is placed
before "modules" in the SUBDIRS list.
When STATIC_MODULES is enabled, however, "modules" target goes first,
due to that notorious static_modules structure.
While pam_access.la (and other pam modules) doesn't actually need
libpam.la in STATIC_MODULES mode, several modules (e.g. pam_mkhomedir,
pam_selinux, pam_tally2, pam_timestamp) also build executables which link
with libpam.la.
I wonder how do you deal with this dependency loop.
Yes, there was a problem, but I can't reproduce it now. IIRC changing
SUBDIRS to 'libpam modules libpam...' helps.
BTW, --enable-static-modules mode seems to be broken for a long time
already. For example, pam_rhosts_auth was removed in 0.99.10.0 (which
was released about four years ago) thus leaving static_modules with
the undefined reference to _pam_rhosts_auth_modstruct. Since that time,
some other changes broke STATIC_MODULES even more. There are quite a few
pam modules maintained as separate projects nowadays, and this
static_modules concept does not provide a convenient method to use them.
That is, I'm not quite sure --enable-static-modules worths fixing at all.
Nevertheless, I've succeeded with static build and it seems that it works.