about summary refs log tree commit diff
path: root/nss/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'nss/Makefile')
-rw-r--r--nss/Makefile17
1 files changed, 15 insertions, 2 deletions
diff --git a/nss/Makefile b/nss/Makefile
index 86de2e9d57..904d3ec423 100644
--- a/nss/Makefile
+++ b/nss/Makefile
@@ -36,8 +36,10 @@ routines		= nsswitch $(addsuffix -lookup,$(databases))
 databases		= proto service hosts network grp pwd rpc ethers \
 			  spwd netgrp key alias
 
+include ../Makeconfig
+
 # Specify rules for the nss_* modules.  We have some services.
-services		:= files db
+services		:= files db $(LDAP)
 
 extra-libs		= $(services:%=libnss_%)
 # These libraries will be built in the `others' pass rather than
@@ -60,17 +62,25 @@ generated		+= $(filter-out db-alias.c db-netgrp.c, \
 					$(addsuffix .c,$(libnss_db-routines)))
 distribute		+= db-XXX.c
 
+libnss_ldap-routines	:= $(addprefix ldap-,proto) util ldap-nss
+libnss_ldap-map		:= libnss_ldap.map
+
 
 ifneq ($(build-static-nss),yes)
 libnss_files-inhibit-o	= $(filter-out .os,$(object-suffixes))
 libnss_db-inhibit-o	= $(filter-out .os,$(object-suffixes))
+libnss_ldap-inhibit-o	= $(filter-out .os,$(object-suffixes))
 endif
 
+# If we compile the LDAP module we need the headers from the LDAP library.
+ifneq ($(LDAP),)
+CPPFLAGS += -I../ldap
+endif
 
 include ../Rules
 
 
-$(objpfx)libnss_db.so: $(common-objpfx)db2/libdb.so $(objpfx)libnss_files.so
+$(objpfx)libnss_db.so: $(dbobjdir)/libdb.so $(objpfx)libnss_files.so
 
 $(libnss_db-routines:%=$(objpfx)%.c): $(objpfx)db-%.c: nss_files/files-%.c
 	@rm -f $@.new
@@ -79,6 +89,9 @@ $(libnss_db-routines:%=$(objpfx)%.c): $(objpfx)db-%.c: nss_files/files-%.c
 	 echo '#include <$<>') > $@.new
 	mv -f $@.new $@
 
+# To complete the LDAP NSS module we need functions from the LDAP library.
+$(objpfx)libnss_ldap.so: $(common-objpfx)ldap/libldap.so
+
 # Depend on libc.so so a DT_NEEDED is generated in the shared objects.
 # This ensures they will load libc.so for needed symbols if loaded by
 # a statically-linked program that hasn't already loaded it.