Revert r227841 and part of r227798. We still build libpam in two passes,

but we use STATIC_CFLAGS instead of our own private .c.o rule.

MFC after:	3 weeks
This commit is contained in:
Dag-Erling Smørgrav 2011-11-24 13:18:58 +00:00
parent 66f96aa5d4
commit dcf83bf794
2 changed files with 23 additions and 3 deletions

View File

@ -1230,7 +1230,7 @@ _prebuild_libs= ${_kerberos5_lib_libasn1} ${_kerberos5_lib_libhdb} \
${_lib_libgssapi} ${_lib_libipx} \
lib/libkiconv lib/libkvm lib/liblzma lib/libmd \
lib/ncurses/ncurses lib/ncurses/ncursesw \
lib/libopie ${_lib_libthr} \
lib/libopie lib/libpam ${_lib_libthr} \
lib/libradius lib/libsbuf lib/libtacplus \
${_cddl_lib_libumem} \
lib/libutil ${_lib_libypclnt} lib/libz lib/msun \
@ -1323,7 +1323,7 @@ ${_lib}__PL: .PHONY
.endif
.endfor
.for _lib in ${_startup_libs} ${_prebuild_libs} ${_generic_libs}
.for _lib in ${_startup_libs} ${_prebuild_libs:Nlib/libpam} ${_generic_libs}
${_lib}__L: .PHONY
.if exists(${.CURDIR}/${_lib})
${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \
@ -1335,6 +1335,17 @@ ${_lib}__L: .PHONY
.endif
.endfor
# libpam is special: we need to build static PAM modules before
# static PAM library, and dynamic PAM library before dynamic PAM
# modules.
lib/libpam__L: .PHONY
${_+_}@${ECHODIR} "===> lib/libpam (obj,depend,all,install)"; \
cd ${.CURDIR}/lib/libpam; \
${MAKE} DIRPRFX=lib/libpam/ obj; \
${MAKE} DIRPRFX=lib/libpam/ depend; \
${MAKE} DIRPRFX=lib/libpam/ -D_NO_LIBPAM_SO_YET all; \
${MAKE} DIRPRFX=lib/libpam/ -D_NO_LIBPAM_SO_YET install
_prereq_libs: ${_prereq_libs:S/$/__PL/}
_startup_libs: ${_startup_libs:S/$/__L/}
_prebuild_libs: ${_prebuild_libs:S/$/__L/}

View File

@ -5,8 +5,17 @@ PAMDIR= ${.CURDIR}/../../../../contrib/openpam
NO_INSTALLLIB=
NO_PROFILE=
CFLAGS+= -I${PAMDIR}/include -I${.CURDIR}/../../libpam
CFLAGS+= -I${PAMDIR}/include -I${.CURDIR}/../../libpam
# This is nasty.
# For the static case, libpam.a depends on the modules.
# For the dynamic case, the modules depend on libpam.so.N
.if defined(_NO_LIBPAM_SO_YET)
NO_PIC=
.else
SHLIB_NAME?= ${LIB}.so.${SHLIB_MAJOR}
DPADD+= ${LIBPAM}
LDADD+= -lpam
.endif
.include "../Makefile.inc"