This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Make sunrpc code available for building again


As discussed with Roland, here's a patch to add - on top of my previous 
patch - a configure option --enable-obsolete-rpc. I'm sending this
to get a review of this part - especially on naming of the new variables.

I've pushed the complete change set to git again and will now test
with both --enable-obsolete-rpc=yes and no,

Andreas

diff --git a/config.h.in b/config.h.in
index 787873b..6fdeff9 100644
--- a/config.h.in
+++ b/config.h.in
@@ -178,6 +178,9 @@
 /* Define if `.ctors' and `.dtors' sections shouldn't be used.  */
 #undef	NO_CTORS_DTORS_SECTIONS
 
+/* Define if obsolete rpc code should be made for user level code to link 
+   against.  */
+#undef LINK_OBSOLETE_RPC
 /*
  */
 
diff --git a/config.make.in b/config.make.in
index 5f6f9e2..6c4d04e 100644
--- a/config.make.in
+++ b/config.make.in
@@ -96,6 +96,7 @@ add-on-subdirs = @add_on_subdirs@
 sysdeps-add-ons = @sysdeps_add_ons@
 cross-compiling = @cross_compiling@
 force-install = @force_install@
+link-obsolete-rpc = @link_obsolete_rpc@
 
 # Build tools.
 CC = @CC@
diff --git a/configure.in b/configure.in
index 19a2c1a..4eb9277 100644
--- a/configure.in
+++ b/configure.in
@@ -252,6 +252,17 @@ else
 fi
 AC_SUBST(libc_cv_nss_crypt)
 
+AC_ARG_ENABLE([obsolete-rpc],
+              AC_HELP_STRING([--enable-obsolete-rpc],
+                             [build and install the obsolete RPC code for link-time usage]),
+              [link_obsolete_rpc=$enableval],
+              [link_obsolete_rpc=no])
+AC_SUBST(link_obsolete_rpc)
+
+if test "$link_obsolete_rpc" = yes; then
+  AC_DEFINE(LINK_OBSOLETE_RPC)
+fi
+
 # The way shlib-versions is used to generate soversions.mk uses a
 # fairly simplistic model for name recognition that can't distinguish
 # i486-pc-linux-gnu fully from i486-pc-gnu.  So we mutate a $host_os
diff --git a/include/libc-symbols.h b/include/libc-symbols.h
index 20c2a34..045fd4b 100644
--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -556,9 +556,12 @@ for linking")
 # define libc_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
 # define libc_hidden_def(name) hidden_def (name)
 # define libc_hidden_weak(name) hidden_weak (name)
-/* libc_hidden_nolink_sunrpc should only get used in sunrpc code, for
-   now export the symbols.  */
-# define libc_hidden_nolink_sunrpc(name, version) hidden_def (name)
+# ifdef LINK_OBSOLETE_RPC
+   /* libc_hidden_nolink_sunrpc should only get used in sunrpc code  .*/
+#  define libc_hidden_nolink_sunrpc(name, version) hidden_def (name)
+# else
+#  define libc_hidden_nolink_sunrpc(name, version) hidden_nolink (name, libc, version)
+# endif
 # define libc_hidden_ver(local, name) hidden_ver (local, name)
 # define libc_hidden_data_def(name) hidden_data_def (name)
 # define libc_hidden_data_weak(name) hidden_data_weak (name)
diff --git a/nis/Makefile b/nis/Makefile
index f27c3e0..b412cee 100644
--- a/nis/Makefile
+++ b/nis/Makefile
@@ -23,7 +23,11 @@ subdir	:= nis
 
 aux			:= nis_hash
 
+include ../Makeconfig
+
+ifeq ($(link-obsolete-rpc),yes)
 headers			:= $(wildcard rpcsvc/*.[hx])
+endif
 
 # These are the databases available for the nis (and perhaps later nisplus)
 # service.  This must be a superset of the services in nss.
diff --git a/sunrpc/Makefile b/sunrpc/Makefile
index 71f4f77..3847daf 100644
--- a/sunrpc/Makefile
+++ b/sunrpc/Makefile
@@ -52,7 +52,7 @@ headers-in-tirpc = $(addprefix rpc/,auth.h auth_unix.h clnt.h pmap_clnt.h \
 				    des_crypt.h)
 headers-not-in-tirpc = $(addprefix rpc/,key_prot.h rpc_des.h) \
 		       $(rpcsvc:%=rpcsvc/%) rpcsvc/bootparam.h
-headers = rpc/netdb.h $(headers-in-tirpc) $(headers-not-in-tirpc)
+headers = rpc/netdb.h
 install-others = $(inst_sysconfdir)/rpc
 generated = $(rpcsvc:%.x=rpcsvc/%.h) $(rpcsvc:%.x=x%.c) $(rpcsvc:%.x=x%.stmp) \
 	    $(rpcsvc:%.x=rpcsvc/%.stmp) rpcgen
@@ -60,6 +60,10 @@ generated-dirs := rpcsvc
 
 include ../Makeconfig
 
+ifeq ($(link-obsolete-rpc),yes)
+headers += $(headers-in-tirpc) $(headers-not-in-tirpc)
+endif
+
 ifeq ($(versioning),yes)
 need-export-routines := auth_des auth_unix clnt_gen clnt_perr clnt_tcp \
 			clnt_udp get_myaddr key_call netname pm_getport \
@@ -73,6 +77,10 @@ routines := auth_none authuxprot bindrsvprt clnt_raw clnt_simp \
 	    svc_simple xdr_float xdr_rec publickey authdes_prot \
 	    des_crypt des_impl des_soft key_prot openchild rtime svcauth_des \
 	    clnt_unix svc_unix create_xid $(need-export-routines)
+ifneq ($(link-obsolete-rpc),yes)
+# We only add the RPC for compatibility to libc.so.
+shared-only-routines = $(routines)
+endif
 endif
 
 # We do not build rpcinfo anymore.  It is not needed for a bootstrap


-- 
 Andreas Jaeger aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi
  SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 NÃrnberg, Germany
   GF: Jeff Hawn,Jennifer Guild,Felix ImendÃrffer,HRB16746 (AG NÃrnberg)
    GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]