diff options
author | bdrewery <bdrewery@FreeBSD.org> | 2016-04-14 01:17:03 +0000 |
---|---|---|
committer | bdrewery <bdrewery@FreeBSD.org> | 2016-04-14 01:17:03 +0000 |
commit | 5fca9ae8c1d4e5632ade9a2b66038200c6a9b163 (patch) | |
tree | 71e89abc8204df2fa8e108073d7c39eecd2f59ca /lib/libpam | |
parent | 27e4615bdfeaf0cf31dc7d3a8131a304ff54aeef (diff) | |
download | FreeBSD-src-5fca9ae8c1d4e5632ade9a2b66038200c6a9b163.zip FreeBSD-src-5fca9ae8c1d4e5632ade9a2b66038200c6a9b163.tar.gz |
Simplify building libpam and fix libpam.a not containing the modules since r284345.
The change in r284345 moved the creation of openpam_static_modules.o to
lib/libpam/static_modules but never managed to get them into libpam.a.
Move this logic to lib/libpam/static_libpam and have it create a static
library for libpam.a The main lib/libpam/libpam will only create a
shared library. No redundancy in compilation or installation exists
in this solution.
This avoids requiring a pass with -D_NO_LIBPAM_SO_YET.
Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'lib/libpam')
-rw-r--r-- | lib/libpam/Makefile | 9 | ||||
-rw-r--r-- | lib/libpam/libpam/Makefile | 14 | ||||
-rw-r--r-- | lib/libpam/modules/Makefile.inc | 7 | ||||
-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 5c3a2ae..fa73b95 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 1dc977f..f428a7f 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 2da5a7b..899c3cb 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 429e660..f7180e9 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 373bac4..373bac4 100644 --- a/lib/libpam/static_modules/Makefile.depend +++ b/lib/libpam/static_libpam/Makefile.depend |