aboutsummaryrefslogtreecommitdiff
path: root/lib/libpam/libpam
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2011-10-22 14:08:21 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2011-10-22 14:08:21 +0000
commit907c13d85fde3b940bb81ba3306b642a57f297bf (patch)
tree4c8db2989a188eef0c78ef569e63f642526ebf7b /lib/libpam/libpam
parent5acce7d734254f720bf426829c7d744bb0b31e4b (diff)
downloadsrc-907c13d85fde3b940bb81ba3306b642a57f297bf.tar.gz
src-907c13d85fde3b940bb81ba3306b642a57f297bf.zip
Revert the previous commit and add a comment explaining why it was wrong.
Notes
Notes: svn path=/head/; revision=226632
Diffstat (limited to 'lib/libpam/libpam')
-rw-r--r--lib/libpam/libpam/Makefile16
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/libpam/libpam/Makefile b/lib/libpam/libpam/Makefile
index 4af9c1f450da..12cd96a28cc3 100644
--- a/lib/libpam/libpam/Makefile
+++ b/lib/libpam/libpam/Makefile
@@ -55,7 +55,6 @@ SRCS= openpam_borrow_cred.c \
openpam_readline.c \
openpam_restore_cred.c \
openpam_set_option.c \
- openpam_static.c \
openpam_ttyconv.c \
pam_acct_mgmt.c \
pam_authenticate.c \
@@ -149,16 +148,29 @@ HEADERS= security/openpam.h \
ADD_HEADERS= security/pam_mod_misc.h
+#
# Static modules
+#
+# We build static versions of all modules and of openpam_static.o,
+# then link them all together into openpam_static_modules.o. None of
+# the modules export any symbols, but they store structures with
+# pointers to their service functions in a linker set which the code
+# in openpam_static.c traverses to locate the individual modules.
+#
MODULE_DIR= ../modules
.include "${.CURDIR}/${MODULE_DIR}/modules.inc"
STATIC_MODULES= ${MODULES:C/.*/${MODULE_DIR}\/&\/lib&.a/}
STATICOBJS+= openpam_static_modules.o
-CLEANFILES+= openpam_static_modules.o
+CLEANFILES+= openpam_static.o \
+ openpam_static_modules.o
openpam_static_modules.o: openpam_static.o ${STATIC_MODULES}
${LD} -o ${.TARGET} -r --whole-archive ${.ALLSRC}
+# We can't put openpam_static.c in SRCS, but we still want to scan it
+# for dependencies.
+DPSRCS= openpam_static.c
+
# Headers
INCS= ${HEADERS} ${ADD_HEADERS}
INCSDIR= ${INCLUDEDIR}/security