aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/libpam/Makefile9
-rw-r--r--lib/libpam/libpam/Makefile14
-rw-r--r--lib/libpam/modules/Makefile.inc7
-rw-r--r--lib/libpam/static_libpam/Makefile (renamed from lib/libpam/static_modules/Makefile)20
-rw-r--r--lib/libpam/static_libpam/Makefile.depend (renamed from lib/libpam/static_modules/Makefile.depend)0
5 files changed, 24 insertions, 26 deletions
diff --git a/lib/libpam/Makefile b/lib/libpam/Makefile
index 5c3a2ae60cc5..fa73b95b140d 100644
--- a/lib/libpam/Makefile
+++ b/lib/libpam/Makefile
@@ -24,8 +24,11 @@
#
# $FreeBSD$
-# The modules must be built first, because they are built into the
-# static version of libpam.
-SUBDIR+= modules libpam static_modules
+# The modules link in libpam. They build the static modules as well.
+SUBDIR+= libpam modules
+SUBDIR_DEPEND_modules= libpam
+SUBDIR+= static_libpam
+SUBDIR_DEPEND_static_libpam= modules
+SUBDIR_PARALLEL=
.include <bsd.subdir.mk>
diff --git a/lib/libpam/libpam/Makefile b/lib/libpam/libpam/Makefile
index 1dc977f610d3..f428a7fc26cf 100644
--- a/lib/libpam/libpam/Makefile
+++ b/lib/libpam/libpam/Makefile
@@ -38,7 +38,11 @@
OPENPAM= ${.CURDIR}/../../../contrib/openpam
.PATH: ${OPENPAM}/include ${OPENPAM}/lib/libpam ${OPENPAM}/doc/man
-LIB= pam
+# static_libpam will build libpam.a
+.if !defined(LIB)
+SHLIB= pam
+.endif
+
MK_PROFILE=no
SRCS= openpam_asprintf.c \
@@ -98,7 +102,7 @@ SRCS= openpam_asprintf.c \
# Local additions
SRCS+= pam_debug_log.c
-MAN= openpam.3 \
+MAN?= openpam.3 \
openpam_borrow_cred.3 \
openpam_free_data.3 \
openpam_free_envlist.3 \
@@ -150,10 +154,10 @@ MAN= openpam.3 \
pam_vprompt.3 \
pam.conf.5
-MLINKS= pam.conf.5 pam.d.5
+MLINKS?= pam.conf.5 pam.d.5
CSTD?= c99
-CFLAGS+= -I${.CURDIR} -I${OPENPAM}/include
+CFLAGS+= -I${OPENPAM}/include
CFLAGS+= -DLIB_MAJ=${SHLIB_MAJOR}
CFLAGS+= -DHAVE_DLFUNC=1
CFLAGS+= -DHAVE_FDLOPEN=1
@@ -172,7 +176,7 @@ HEADERS= security/openpam.h \
ADD_HEADERS= security/pam_mod_misc.h
# Headers
-INCS= ${HEADERS} ${ADD_HEADERS}
+INCS?= ${HEADERS} ${ADD_HEADERS}
INCSDIR= ${INCLUDEDIR}/security
.include <src.opts.mk>
diff --git a/lib/libpam/modules/Makefile.inc b/lib/libpam/modules/Makefile.inc
index 2da5a7b524ad..899c3cbbc8f6 100644
--- a/lib/libpam/modules/Makefile.inc
+++ b/lib/libpam/modules/Makefile.inc
@@ -7,14 +7,7 @@ MK_PROFILE= no
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}
LIBADD+= pam
-.endif
.include "../Makefile.inc"
diff --git a/lib/libpam/static_modules/Makefile b/lib/libpam/static_libpam/Makefile
index 429e6601e620..f7180e93ef05 100644
--- a/lib/libpam/static_modules/Makefile
+++ b/lib/libpam/static_libpam/Makefile
@@ -35,15 +35,17 @@
#
# $FreeBSD$
-OPENPAM= ${.CURDIR:H:H:H}/contrib/openpam
-.PATH: ${OPENPAM}/lib
-.PATH: ${OPENPAM}/lib/libpam
+.PATH: ${.CURDIR}/../libpam
-all:
-
-SRCS = openpam_static.c
+# Only build the static library.
+LIB= pam
+NO_PIC=
+# Avoid redundancy with the master Makefile.
MAN=
+INCS=
+MLINKS=
+MK_TESTS= no
#
# Static modules
@@ -61,11 +63,7 @@ STATICOBJS+= openpam_static_modules.o
CLEANFILES+= openpam_static.o \
openpam_static_modules.o
-.include <bsd.prog.mk>
-
-.if empty(_SKIP_BUILD)
openpam_static_modules.o: openpam_static.o ${STATIC_MODULES}
${LD} -o ${.TARGET} -r --whole-archive ${.ALLSRC}
-all: ${STATICOBJS}
-.endif
+.include "${.CURDIR}/../libpam/Makefile"
diff --git a/lib/libpam/static_modules/Makefile.depend b/lib/libpam/static_libpam/Makefile.depend
index 373bac45e6da..373bac45e6da 100644
--- a/lib/libpam/static_modules/Makefile.depend
+++ b/lib/libpam/static_libpam/Makefile.depend