PERFORCE change 99762 for review
Michael Bushkov
bushman at FreeBSD.org
Wed Jun 21 16:31:56 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=99762
Change 99762 by bushman at bushman_nss_ldap_cached on 2006/06/21 16:30:35
libc.a is now properly linked with statically built nss-modules. libc.so uses dynamically linked nss-modules. Nss-modules sources are no longer used in libc. Still some cleanup in nss-modules' source has to be made - to remove now redundant namespace.h and un-namespace.h.
Affected files ...
.. //depot/projects/soc2006/nss_ldap_cached/src/lib/Makefile#5 edit
.. //depot/projects/soc2006/nss_ldap_cached/src/lib/libc/Makefile#4 edit
.. //depot/projects/soc2006/nss_ldap_cached/src/lib/libc/net/Makefile.inc#5 edit
.. //depot/projects/soc2006/nss_ldap_cached/src/lib/libc/net/gethostnamadr.c#5 edit
.. //depot/projects/soc2006/nss_ldap_cached/src/lib/libc/net/getnetnamadr.c#3 edit
.. //depot/projects/soc2006/nss_ldap_cached/src/lib/libc/net/getservent.c#3 edit
.. //depot/projects/soc2006/nss_ldap_cached/src/lib/libc/net/nsdispatch.c#4 edit
.. //depot/projects/soc2006/nss_ldap_cached/src/lib/libc/net/nss_backends.h#3 edit
.. //depot/projects/soc2006/nss_ldap_cached/src/lib/libnssutil/Makefile#5 edit
.. //depot/projects/soc2006/nss_ldap_cached/src/lib/nss_compat/Makefile#3 edit
.. //depot/projects/soc2006/nss_ldap_cached/src/lib/nss_dns/Makefile#6 edit
.. //depot/projects/soc2006/nss_ldap_cached/src/lib/nss_icmp/Makefile#5 edit
.. //depot/projects/soc2006/nss_ldap_cached/src/lib/nss_nis/Makefile#6 edit
Differences ...
==== //depot/projects/soc2006/nss_ldap_cached/src/lib/Makefile#5 (text+ko) ====
@@ -16,6 +16,7 @@
# libnetgraph must be built before libbsnmp/modules/snmp_netgraph.
# libnssutil must be built before nss_files/nss_dns/nss_nis/nss_compat
# libnss_files must be built before libnss_compat
+# nssfiles/nss_dns/nss_nis/nss_compat/nss_icmp must be built before libc
# libopie must be built before libpam.
# libradius must be built before libpam.
# librpcsvc must be built before libpam.
==== //depot/projects/soc2006/nss_ldap_cached/src/lib/libc/Makefile#4 (text+ko) ====
@@ -113,24 +113,43 @@
# Include nss-modules's sources so that statically linked apps can work
# normally
-CFLAGS+= -I${.CURDIR}/../libnssutil -I${.CURDIR}/net
+NSS_STATIC+= ${.OBJDIR}/../nss_files/libnss_files.a
+NSS_STATIC+= ${.OBJDIR}/../nss_dns/libnss_dns.a
+NSS_STATIC+= ${.OBJDIR}/../nss_compat/libnss_compat.a
+.if ${MK_NIS} != "no"
+NSS_STATIC+= ${.OBJDIR}/../nss_nis/libnss_nis.a
+.endif
+NSS_STATIC+= ${.OBJDIR}/../libnssutil/libnssutil.a
+
+nss_static_modules.o:
+ ${LD} -o ${.TARGET} -r --whole-archive ${NSS_STATIC}
+
+.if ${MK_PROFILE} != "no"
+nss_static_modules.po:
+ ${LD} -o ${.TARGET} -r --whole-archive ${NSS_STATIC}
+.endif
+
+DPSRC= nss_static_modules.c
+STATICOBJS+= nss_static_modules.o
+CLEANFILES+= nss_static_modules.o
+#CFLAGS+= -I${.CURDIR}/../libnssutil -I${.CURDIR}/net
-.PATH: ${.CURDIR}/../libnssutil
-.include "${.CURDIR}/../libnssutil/Makefile.inc"
+#.PATH: ${.CURDIR}/../libnssutil
+#.include "${.CURDIR}/../libnssutil/Makefile.inc"
-.PATH: ${.CURDIR}/../nss_files
-.include "${.CURDIR}/../nss_files/Makefile.inc"
+#.PATH: ${.CURDIR}/../nss_files
+#.include "${.CURDIR}/../nss_files/Makefile.inc"
-.PATH: ${.CURDIR}/../nss_dns
-.include "${.CURDIR}/../nss_dns/Makefile.inc"
+#.PATH: ${.CURDIR}/../nss_dns
+#.include "${.CURDIR}/../nss_dns/Makefile.inc"
-.if ${MK_NIS} != "no"
-.PATH: ${.CURDIR}/../nss_nis
-.include "${.CURDIR}/../nss_nis/Makefile.inc"
-.endif
+#.if ${MK_NIS} != "no"
+#.PATH: ${.CURDIR}/../nss_nis
+#.include "${.CURDIR}/../nss_nis/Makefile.inc"
+#.endif
-.PATH: ${.CURDIR}/../nss_compat
-.include "${.CURDIR}/../nss_compat/Makefile.inc"
+#.PATH: ${.CURDIR}/../nss_compat
+#.include "${.CURDIR}/../nss_compat/Makefile.inc"
.include <bsd.lib.mk>
==== //depot/projects/soc2006/nss_ldap_cached/src/lib/libc/net/Makefile.inc#5 (text+ko) ====
@@ -19,7 +19,7 @@
SYM_MAPS+=${.CURDIR}/net/Symbol.map
-CFLAGS+=-DINET6 -I${.OBJDIR}
+CFLAGS+=-DINET6 -I${.OBJDIR} -I${.CURDIR}/net
# name6.c refers res_private.h
CFLAGS+=-I${.CURDIR}/resolv
==== //depot/projects/soc2006/nss_ldap_cached/src/lib/libc/net/gethostnamadr.c#5 (text+ko) ====
==== //depot/projects/soc2006/nss_ldap_cached/src/lib/libc/net/getnetnamadr.c#3 (text+ko) ====
@@ -276,52 +276,6 @@
}
int
-__copy_netent(struct netent *ne, struct netent *nptr, char *buf, size_t buflen)
-{
- char *cp;
- int i, n;
- int numptr, len;
-
- /* Find out the amount of space required to store the answer. */
- numptr = 1; /* NULL ptr */
- len = (char *)ALIGN(buf) - buf;
- for (i = 0; ne->n_aliases[i]; i++, numptr++) {
- len += strlen(ne->n_aliases[i]) + 1;
- }
- len += strlen(ne->n_name) + 1;
- len += numptr * sizeof(char*);
-
- if (len > (int)buflen) {
- errno = ERANGE;
- return (-1);
- }
-
- /* copy net value and type */
- nptr->n_addrtype = ne->n_addrtype;
- nptr->n_net = ne->n_net;
-
- cp = (char *)ALIGN(buf) + numptr * sizeof(char *);
-
- /* copy official name */
- n = strlen(ne->n_name) + 1;
- strcpy(cp, ne->n_name);
- nptr->n_name = cp;
- cp += n;
-
- /* copy aliases */
- nptr->n_aliases = (char **)ALIGN(buf);
- for (i = 0 ; ne->n_aliases[i]; i++) {
- n = strlen(ne->n_aliases[i]) + 1;
- strcpy(cp, ne->n_aliases[i]);
- nptr->n_aliases[i] = cp;
- cp += n;
- }
- nptr->n_aliases[i] = NULL;
-
- return (0);
-}
-
-int
getnetbyname_r(const char *name, struct netent *ne, char *buffer,
size_t buflen, struct netent **result, int *h_errorp)
{
==== //depot/projects/soc2006/nss_ldap_cached/src/lib/libc/net/getservent.c#3 (text+ko) ====
@@ -183,7 +183,7 @@
return (res);
}
-int
+static int
serv_marshal_func(char *buffer, size_t *buffer_size, void *retval, va_list ap,
void *cache_mdata)
{
@@ -284,7 +284,7 @@
return (NS_SUCCESS);
}
-int
+static int
serv_unmarshal_func(char *buffer, size_t buffer_size, void *retval, va_list ap,
void *cache_mdata)
{
==== //depot/projects/soc2006/nss_ldap_cached/src/lib/libc/net/nsdispatch.c#4 (text+ko) ====
@@ -430,13 +430,20 @@
*src = NULL;
}
+/* ARGSUSED */
+ns_mtab *
+__dummy_reg(const char *name, unsigned int *mtab_size,
+ nss_module_unregister_fn *fn)
+{
+ return (NULL);
+}
-
/*
* NSS module management.
*/
/* The built-in NSS modules are all loaded at once. */
#define NSS_BACKEND(name, reg) \
+__weak_reference(__dummy_reg, reg);\
ns_mtab *reg(const char *, unsigned int *, nss_module_unregister_fn *);
#include "nss_backends.h"
#undef NSS_BACKEND
==== //depot/projects/soc2006/nss_ldap_cached/src/lib/libc/net/nss_backends.h#3 (text+ko) ====
@@ -42,5 +42,5 @@
NSS_BACKEND( nis, _nis_nss_module_register )
#endif
NSS_BACKEND( compat, _compat_nss_module_register )
-//NSS_BACKEND( icmp, _icmp_nss_module_register )
+NSS_BACKEND( icmp, _icmp_nss_module_register )
#endif
==== //depot/projects/soc2006/nss_ldap_cached/src/lib/libnssutil/Makefile#5 (text+ko) ====
==== //depot/projects/soc2006/nss_ldap_cached/src/lib/nss_compat/Makefile#3 (text+ko) ====
@@ -2,6 +2,7 @@
.include <bsd.own.mk>
+LIB= nss_compat
SHLIB_MAJOR= 1
SHLIB_NAME= nss_compat.so.${SHLIB_MAJOR}
SHLIBDIR?= /lib
==== //depot/projects/soc2006/nss_ldap_cached/src/lib/nss_dns/Makefile#6 (text+ko) ====
==== //depot/projects/soc2006/nss_ldap_cached/src/lib/nss_icmp/Makefile#5 (text+ko) ====
@@ -2,6 +2,7 @@
.include <bsd.own.mk>
+LIB= nss_icmp
SHLIB_MAJOR= 1
SHLIB_NAME= nss_icmp.so.${SHLIB_MAJOR}
SHLIBDIR?= /lib
==== //depot/projects/soc2006/nss_ldap_cached/src/lib/nss_nis/Makefile#6 (text+ko) ====
@@ -2,6 +2,7 @@
.include <bsd.own.mk>
+LIB= nss_nis
SHLIB_MAJOR= 1
SHLIB_NAME= nss_nis.so.${SHLIB_MAJOR}
SHLIBDIR?= /lib
More information about the p4-projects
mailing list