[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[patches] OPTION_EGLIBC_NIS option group



This patch implements the OPTION_EGLIBC_NIS option group.

This could be cleaned up a bit if nscd could simply use the copy of
__nis_hash from libc.so; are there ramifications I don't see of
changing that from hidden to globally visible?  Isn't libc permitted
to extend its interface under the '__' prefix?

ChangeLog.eglibc:
2007-07-26  Jim Blandy  <jimb@xxxxxxxxxxxxxxxx>

	Implement the OPTION_EGLIBC_NIS option group.
	* option-groups.def (OPTION_EGLIBC_NIS): New entry.
	* option-groups.defaults (OPTION_EGLIBC_NIS): Initialize.
	* nis/Makefile (services-y, extra-libs-y): Use OPTION_EGLIBC_NIS
	as the condition.
	* nscd/Makefile: If OPTION_EGLIBC_NIS is not enabled, don't try to
	link against libnsl.so; link our own copy of nis_hash.c directly
	into nscd.
	* nscd/nis_hash.c: New file.

Index: option-groups.def
===================================================================
--- option-groups.def	(revision 2946)
+++ option-groups.def	(working copy)
@@ -288,6 +288,18 @@
        group; if you disable OPTION_EGLIBC_LOCALE_CODE, you must also
        disable OPTION_EGLIBC_CATGETS.
 
+config OPTION_EGLIBC_NIS
+   bool "Support for NIS, NIS+, and the special 'compat' services."
+   depends OPTION_EGLIBC_INET
+   help
+       This option group includes the NIS, NIS+, and 'compat' Name
+       Service Switch service libraries.  When it is disabled, those
+       services libraries are not installed; you should remove any
+       references to them from your 'nsswitch.conf' file.
+
+       This option group depends on the OPTION_EGLIBC_INET option
+       group; you must enable that to enable this option group.
+
 config OPTION_EGLIBC_NSSWITCH
    bool "Name service switch (nsswitch) support"
    help
Index: nscd/nis_hash.c
===================================================================
--- nscd/nis_hash.c	(revision 0)
+++ nscd/nis_hash.c	(revision 0)
@@ -0,0 +1,3 @@
+/* If OPTION_EGLIBC_NIS is disabled, nscd can't get this from libnsl.so;
+   we need our own copy.  */
+#include "../nis/nis_hash.c"
Index: nscd/Makefile
===================================================================
--- nscd/Makefile	(revision 2946)
+++ nscd/Makefile	(working copy)
@@ -39,7 +39,11 @@
 		getsrvbynm_r getsrvbypt_r servicescache \
 		dbg_log nscd_conf nscd_stat cache mem nscd_setup_thread \
 		xmalloc xstrdup aicache initgrcache gai
-
+ifneq (y,$(OPTION_EGLIBC_NIS))
+# If we haven't build libnsl.so, then we'll need to include our
+# own copy of nis_hash.
+nscd-modules += nis_hash
+endif
 ifeq ($(have-thread-library),yes)
 
 ifneq (yesyes,$(have-fpie)$(build-shared))
@@ -81,7 +85,8 @@
 
 distribute := nscd.h nscd-client.h dbg_log.h \
 	      $(addsuffix .c, $(filter-out xmalloc,$(all-nscd-modules))) \
-	      nscd.conf nscd.init nscd_proto.h nscd-types.h
+	      nscd.conf nscd.init nscd_proto.h nscd-types.h \
+	      nis_hash.c
 
 include ../Rules
 
@@ -147,9 +152,15 @@
 $(objpfx)nscd: $(nscd-modules:%=$(objpfx)%.o)
 
 ifeq ($(build-shared),yes)
-$(objpfx)nscd: $(common-objpfx)rt/librt.so $(shared-thread-library) \
-	       $(common-objpfx)nis/libnsl.so
+$(objpfx)nscd: $(common-objpfx)rt/librt.so $(shared-thread-library)
 else
-$(objpfx)nscd: $(common-objpfx)rt/librt.a $(static-thread-library) \
-	       $(common-objpfx)nis/libnsl.a
+$(objpfx)nscd: $(common-objpfx)rt/librt.a $(static-thread-library)
 endif
+
+ifeq (y,$(OPTION_EGLIBC_NIS))
+ifeq ($(build-shared),yes)
+$(objpfx)nscd: $(common-objpfx)nis/libnsl.so
+else
+$(objpfx)nscd: $(common-objpfx)nis/libnsl.a
+endif
+endif
Index: option-groups.defaults
===================================================================
--- option-groups.defaults	(revision 2946)
+++ option-groups.defaults	(working copy)
@@ -14,5 +14,6 @@
 OPTION_EGLIBC_LIBM = y
 OPTION_EGLIBC_LOCALES = y
 OPTION_EGLIBC_LOCALE_CODE = y
+OPTION_EGLIBC_NIS = y
 OPTION_EGLIBC_NSSWITCH = y
 OPTION_POSIX_REGEXP = y
Index: nis/Makefile
===================================================================
--- nis/Makefile	(revision 2946)
+++ nis/Makefile	(working copy)
@@ -37,11 +37,11 @@
 # Specify rules for the nss_* modules.
 # The 'compat' module includes nis support, and the 'nss' directory
 # includes a bare-bones "files" library, so we'll include 'compat' in
-# OPTION_EGLIBC_INET.
+# OPTION_EGLIBC_NIS.
 services-y		:=
-services-$(OPTION_EGLIBC_INET) += nis nisplus compat
+services-$(OPTION_EGLIBC_NIS) += nis nisplus compat
 
-extra-libs-$(OPTION_EGLIBC_INET) += libnsl
+extra-libs-$(OPTION_EGLIBC_NIS) += libnsl
 extra-libs-y		+= $(services-y:%=libnss_%)
 
 # These libraries will be built in the `others' pass rather than