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

[patches] Implement new EGLIBC_NSCD option group.



This option group is for exclude NSCD code from EGLIBC.  As for now, 
NSCD depends on EGLIBC_INET group, and with the new option group NSCD 
can be excluded while all the remain INET group is stay included.

Please apply this patch.

Index: nscd/Makefile
===================================================================
--- nscd/Makefile	(revision 12959)
+++ nscd/Makefile	(working copy)
@@ -23,10 +23,10 @@
 
 subdir	:= nscd
 
-routines-$(OPTION_EGLIBC_INET) += \
+routines-$(OPTION_EGLIBC_NSCD) += \
 	     nscd_getpw_r nscd_getgr_r nscd_gethst_r nscd_getai \
 	    nscd_initgroups nscd_getserv_r
-aux-$(OPTION_EGLIBC_INET) += nscd_helper
+aux-$(OPTION_EGLIBC_NSCD) += nscd_helper
 
 include ../Makeconfig
 
@@ -46,11 +46,11 @@
 ifeq ($(have-thread-library),yes)
 
 ifneq (yesyes,$(have-fpie)$(build-shared))
-others-$(OPTION_EGLIBC_INET) += nscd
+others-$(OPTION_EGLIBC_NSCD) += nscd
 endif
-install-sbin-$(OPTION_EGLIBC_INET) += nscd
+install-sbin-$(OPTION_EGLIBC_NSCD) += nscd
 
-extra-objs-$(OPTION_EGLIBC_INET) += $(nscd-modules:=.o)
+extra-objs-$(OPTION_EGLIBC_NSCD) += $(nscd-modules:=.o)
 
 endif
 
Index: pwd/Makefile
===================================================================
--- pwd/Makefile	(revision 12959)
+++ pwd/Makefile	(working copy)
@@ -34,10 +34,10 @@
 
 ifeq ($(have-thread-library),yes)
 
-OPTION_EGLIBC_INET-CFLAGS-$(OPTION_EGLIBC_INET) = -DUSE_NSCD=1
+OPTION_EGLIBC_NSCD-CFLAGS-$(OPTION_EGLIBC_NSCD) = -DUSE_NSCD=1
 
-CFLAGS-getpwuid_r.c = $(OPTION_EGLIBC_INET-CFLAGS-y)
-CFLAGS-getpwnam_r.c = $(OPTION_EGLIBC_INET-CFLAGS-y)
+CFLAGS-getpwuid_r.c = $(OPTION_EGLIBC_NSCD-CFLAGS-y)
+CFLAGS-getpwnam_r.c = $(OPTION_EGLIBC_NSCD-CFLAGS-y)
 CFLAGS-getpwent_r.c = -fexceptions
 CFLAGS-getpwent.c = -fexceptions
 CFLAGS-getpw.c = -fexceptions
Index: sysdeps/posix/getaddrinfo.c
===================================================================
--- sysdeps/posix/getaddrinfo.c	(revision 12959)
+++ sysdeps/posix/getaddrinfo.c	(working copy)
@@ -59,8 +59,10 @@
 #include <nsswitch.h>
 #include <bits/libc-lock.h>
 #include <not-cancel.h>
+#if __OPTION_EGLIBC_NSCD
 #include <nscd/nscd-client.h>
 #include <nscd/nscd_proto.h>
+#endif /* __OPTION_EGLIBC_NSCD */
 #include <resolv/res_hconf.h>
 
 #ifdef HAVE_LIBIDN
Index: inet/Makefile
===================================================================
--- inet/Makefile	(revision 12959)
+++ inet/Makefile	(working copy)
@@ -67,11 +67,13 @@
 
 ifeq ($(have-thread-library),yes)
 
-CFLAGS-gethstbyad_r.c = -DUSE_NSCD=1 -fexceptions
+OPTION_EGLIBC_NSCD-CFLAGS-$(OPTION_EGLIBC_NSCD) = -DUSE_NSCD=1
+
+CFLAGS-gethstbyad_r.c = $(OPTION_EGLIBC_NSCD-CFLAGS-y) -fexceptions
 CFLAGS-gethstbyad.c = -fexceptions
-CFLAGS-gethstbynm_r.c = -DUSE_NSCD=1 -fexceptions
+CFLAGS-gethstbynm_r.c = $(OPTION_EGLIBC_NSCD-CFLAGS-y) -fexceptions
 CFLAGS-gethstbynm.c = -fexceptions
-CFLAGS-gethstbynm2_r.c = -DUSE_NSCD=1 -fexceptions
+CFLAGS-gethstbynm2_r.c = $(OPTION_EGLIBC_NSCD-CFLAGS-y) -fexceptions
 CFLAGS-gethstbynm2.c = -fexceptions
 CFLAGS-gethstent_r.c = -fexceptions
 CFLAGS-gethstent.c = -fexceptions
@@ -88,8 +90,8 @@
 CFLAGS-getrpcent.c = -fexceptions
 CFLAGS-getservent_r.c = -fexceptions
 CFLAGS-getservent.c = -fexceptions
-CFLAGS-getsrvbynm_r.c = -DUSE_NSCD=1
-CFLAGS-getsrvbypt_r.c = -DUSE_NSCD=1
+CFLAGS-getsrvbynm_r.c = $(OPTION_EGLIBC_NSCD-CFLAGS-y)
+CFLAGS-getsrvbypt_r.c = $(OPTION_EGLIBC_NSCD-CFLAGS-y)
 CFLAGS-getprtent_r.c = -fexceptions
 CFLAGS-getprtent.c = -fexceptions
 CFLAGS-either_ntoh.c = -fexceptions
Index: nss/nsswitch.c
===================================================================
--- nss/nsswitch.c	(revision 12959)
+++ nss/nsswitch.c	(working copy)
@@ -40,7 +40,9 @@
 #endif
 
 #include "nsswitch.h"
+#if __OPTION_EGLIBC_NSCD
 #include "../nscd/nscd_proto.h"
+#endif /* __OPTION_EGLIBC_NSCD */
 
 /* When OPTION_EGLIBC_NSSWITCH is disabled, we use fixed tables of
    databases and services, generated at library build time.  Thus:
@@ -799,7 +801,7 @@
 #endif /* __OPTION_EGLIBC_NSSWITCH */
 
 
-#if __OPTION_EGLIBC_INET
+#if __OPTION_EGLIBC_NSCD
 /* Called by nscd and nscd alone.  */
 void
 __nss_disable_nscd (void)
@@ -810,7 +812,7 @@
   __nss_not_use_nscd_hosts = -1;
   __nss_not_use_nscd_services = -1;
 }
-#endif /* __OPTION_EGLIBC_INET */
+#endif /* __OPTION_EGLIBC_NSCD */
 
 
 #if __OPTION_EGLIBC_NSSWITCH
Index: nss/nsswitch.h
===================================================================
--- nss/nsswitch.h	(revision 12959)
+++ nss/nsswitch.h	(working copy)
@@ -163,8 +163,10 @@
 libc_hidden_proto (__nss_lookup_function)
 
 
+#if __OPTION_EGLIBC_NSCD
 /* Called by NSCD to disable recursive calls.  */
 extern void __nss_disable_nscd (void);
+#endif /* __OPTION_EGLIBC_NSCD */
 
 
 typedef int (*db_lookup_function) (service_user **, const char *, const char *,
Index: nss/Versions
===================================================================
--- nss/Versions	(revision 12959)
+++ nss/Versions	(working copy)
@@ -9,7 +9,10 @@
   }
   GLIBC_PRIVATE {
     _nss_files_parse_grent; _nss_files_parse_pwent; _nss_files_parse_spent;
-    __nss_disable_nscd; __nss_lookup_function; _nss_files_parse_sgent;
+%if __OPTION_EGLIBC_NSCD
+    __nss_disable_nscd;
+%endif
+    __nss_lookup_function; _nss_files_parse_sgent;
 
     __nss_passwd_lookup2; __nss_group_lookup2; __nss_hosts_lookup2;
     __nss_services_lookup2; __nss_next2;
Index: grp/initgroups.c
===================================================================
--- grp/initgroups.c	(revision 12959)
+++ grp/initgroups.c	(working copy)
@@ -27,11 +27,11 @@
 #include <sys/param.h>
 #include <sys/types.h>
 #include <nsswitch.h>
-
+#if __OPTION_EGLIBC_NSCD
 #include "../nscd/nscd-client.h"
 #include "../nscd/nscd_proto.h"
+#endif /* __OPTION_EGLIBC_NSCD */
 
-
 /* Type of the lookup function.  */
 typedef enum nss_status (*initgroups_dyn_function) (const char *, gid_t,
 						    long int *, long int *,
Index: grp/Makefile
===================================================================
--- grp/Makefile	(revision 12959)
+++ grp/Makefile	(working copy)
@@ -52,16 +52,16 @@
 
 ifeq ($(have-thread-library),yes)
 
-OPTION_EGLIBC_INET-CFLAGS-$(OPTION_EGLIBC_INET) = -DUSE_NSCD=1
+OPTION_EGLIBC_NSCD-CFLAGS-$(OPTION_EGLIBC_NSCD) = -DUSE_NSCD=1
 
-CFLAGS-getgrgid_r.c = $(OPTION_EGLIBC_INET-CFLAGS-y) -fexceptions
-CFLAGS-getgrnam_r.c = $(OPTION_EGLIBC_INET-CFLAGS-y) -fexceptions
+CFLAGS-getgrgid_r.c = $(OPTION_EGLIBC_NSCD-CFLAGS-y) -fexceptions
+CFLAGS-getgrnam_r.c = $(OPTION_EGLIBC_NSCD-CFLAGS-y) -fexceptions
 CFLAGS-getgrent_r.c = -fexceptions
 CFLAGS-getgrent.c = -fexceptions
 CFLAGS-fgetgrent.c = -fexceptions
 CFLAGS-fgetgrent_r.c = -fexceptions -D_IO_MTSAFE_IO
 CFLAGS-putgrent.c = -fexceptions -D_IO_MTSAFE_IO
-CFLAGS-initgroups.c = $(OPTION_EGLIBC_INET-CFLAGS-y) -fexceptions
+CFLAGS-initgroups.c = $(OPTION_EGLIBC_NSCD-CFLAGS-y) -fexceptions
 CFLAGS-getgrgid.c = -fexceptions
 
 endif
Index: option-groups.defaults
===================================================================
--- option-groups.defaults	(revision 12959)
+++ option-groups.defaults	(working copy)
@@ -33,6 +33,7 @@
 OPTION_EGLIBC_LOCALE_CODE = y
 OPTION_EGLIBC_MEMUSAGE = y
 OPTION_EGLIBC_NIS = y
+OPTION_EGLIBC_NSCD = y
 OPTION_EGLIBC_NSSWITCH = y
 OPTION_EGLIBC_RCMD = y
 OPTION_EGLIBC_RTLD_DEBUG = y
Index: option-groups.def
===================================================================
--- option-groups.def	(revision 12959)
+++ option-groups.def	(working copy)
@@ -540,6 +540,13 @@
        This option group depends on the OPTION_EGLIBC_INET option
        group; you must enable that to enable this option group.
 
+config OPTION_EGLIBC_NSCD
+    bool "Name Service Cache Daemon"
+    depends OPTION_EGLIBC_INET
+    help
+        This option group includes the 'nscd' daemon and its use from
+        EGLIBC.
+
 config OPTION_EGLIBC_NSSWITCH
    bool "Name service switch (nsswitch) support"
    help
Index: posix/Makefile
===================================================================
--- posix/Makefile	(revision 12959)
+++ posix/Makefile	(working copy)
@@ -171,7 +171,7 @@
 endif
 # eglibc: endif
 
-OPTION_EGLIBC_INET-CFLAGS-$(OPTION_EGLIBC_INET) = -DUSE_NSCD=1
+OPTION_EGLIBC_NSCD-CFLAGS-$(OPTION_EGLIBC_NSCD) = -DUSE_NSCD=1
 
 # If we will use the generic uname implementation, we must figure out what
 # it will say by examining the system, and write the results in config-name.h.
@@ -182,7 +182,7 @@
 	mv -f $@.new $@
 
 CFLAGS-regex.c = -Wno-strict-prototypes
-CFLAGS-getaddrinfo.c = -DRESOLVER -fexceptions $(OPTION_EGLIBC_INET-CFLAGS-y)
+CFLAGS-getaddrinfo.c = -DRESOLVER -fexceptions $(OPTION_EGLIBC_NSCD-CFLAGS-y)
 CFLAGS-pread.c = -fexceptions -fasynchronous-unwind-tables
 CFLAGS-pread64.c = -fexceptions -fasynchronous-unwind-tables
 CFLAGS-pwrite.c = -fexceptions -fasynchronous-unwind-tables
Index: ChangeLog.eglibc
===================================================================
--- ChangeLog.eglibc    (revision 12959)
+++ ChangeLog.eglibc    (working copy)
@@ -1,3 +1,24 @@
+2011-02-27  Denis Zaitceff  <zaitceff@xxxxxxxxx>
+
+       Implement the EGLIBC_NSCD option group.
+       * option-groups.def (OPTION_EGLIBC_NSCD): New entry.
+       * option-groups.defaults (OPTION_EGLIBC_NSCD): Initialize.
+       * nscd/Makefile (routines,aux,others,install-sbin,extra-objs): Use
+       new group instead of OPTION_EGLIBC_INET.
+       * grp/Makefile (CFLAGS-...): Ditto.
+       * pwd/Makefile (CFLAGS-...): Ditto.
+       * posix/Makefile (CFLAGS-getaddrinfo.c): Ditto.
+       * inet/Makefile (OPTION_EGLIBC_NSCD-CFLAGS-y): Define and use.
+       * sysdeps/posix/getaddrinfo.c (__OPTION_EGLIBC_NSCD): Use for
+       #include NSCD-related headers conditionally.
+       * grp/initgroups.c (__OPTION_EGLIBC_NSCD): Ditto.
+       * nss/nsswitch.c (__OPTION_EGLIBC_NSCD): Ditto.
+       * nss/nsswitch.c (__nss_disable_nscd): Use __OPTION_EGLIBC_NSCD
+       instead __OPTION_EGLIBC_INET as the condition for compile.
+       * nss/nsswitch.h (__nss_disable_nscd): Use __OPTION_EGLIBC_NSCD
+       for conditionalize the declaration.
+       * nss/Versions (__nss_disable_nscd): Ditto.
+
 2010-12-19  Gordon Schumacher  <whiplash@xxxxxxxxx>
 
        * locale/xlocale.x (DEFINE_CATEGORY): Fix merge issue.