1 # Copyright (C) 1994-2021 Free Software Foundation, Inc.
2 # This file is part of the GNU C Library.
4 # The GNU C Library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
9 # The GNU C Library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with the GNU C Library; if not, see
16 # <https://www.gnu.org/licenses/>.
19 # Sub-makefile for sunrpc portion of the library.
27 # The code in this subdirectory is taken from Sun's RPCSRC-4.0
28 # distribution with some additional changes from the TI-RPC package
29 # which is also available from Sun. The files are heavily changed to
30 # compile cleanly and to fit in the GNU environment. All the code
31 # from Sun's rpc and etc subdirectories is in this directory;
32 # the rpc subdirectory contains only the header files. Other than
33 # that, several files were renamed so as not to exceed 14-character
36 # authunix_prot.c -> authuxprot.c
37 # clnt_generic.c -> clnt_gen.c
38 # clnt_perror.c -> clnt_perr.c
39 # clnt_simple.c -> clnt_simp.c
40 # get_myaddress.c -> get_myaddr.c
41 # pmap_getmaps.c -> pm_getmaps.c
42 # pmap_getport.c -> pm_getport.c
43 # rpc_callmsg.c -> rpc_cmsg.c
44 # rpc_commondata.c -> rpc_common.c
45 # rpc_dtablesize.c -> rpc_dtable.c
46 # svc_auth_unix.c -> svc_authux.c
47 # xdr_reference.c -> xdr_ref.c
49 ifeq ($(build-shared
),yes
)
50 need-export-routines
:= auth_des auth_unix clnt_gen clnt_perr clnt_tcp \
51 clnt_udp get_myaddr key_call netname pm_getport \
52 rpc_thread svc svc_tcp svc_udp xcrypt xdr_array xdr \
53 xdr_intXX_t xdr_mem xdr_ref xdr_sizeof xdr_stdio \
56 routines
:= auth_none authuxprot clnt_raw clnt_simp \
57 rpc_dtable getrpcport pmap_clnt pm_getmaps pmap_prot pmap_prot2 \
58 pmap_rmt rpc_prot rpc_common rpc_cmsg svc_auth svc_authux svc_raw \
59 svc_simple xdr_float xdr_rec publickey authdes_prot \
60 des_crypt des_impl des_soft key_prot openchild rtime svcauth_des \
61 clnt_unix svc_unix create_xid
$(need-export-routines
) \
63 # We only add the RPC for compatibility to libc.so.
64 shared-only-routines
= $(routines
)
67 tests
= tst-xdrmem tst-xdrmem2 test-rpcent tst-udp-error tst-udp-timeout \
69 xtests
:= tst-getmyaddr
71 ifeq ($(have-thread-library
),yes
)
73 tests
+= tst-udp-garbage tst-svc_register
76 ifeq (yes
,$(build-shared
))
77 rpc-compat-routines
= $(addprefix compat-
,$(need-export-routines
))
78 rpc-compat-routines.os
= $(addprefix $(objpfx
), \
79 $(addsuffix .os
,$(rpc-compat-routines
)))
80 extra-objs
+= $(addsuffix .os
,$(rpc-compat-routines
))
85 ifeq (yes
,$(build-shared
))
86 subdir_lib
: $(objpfx
)librpc_compat_pic.a
87 $(objpfx
)librpc_compat_pic.a
: $(rpc-compat-routines.os
)
88 $(AR
) cr
$(verbose
) $@
$^
89 $(rpc-compat-routines.os
): $(objpfx
)compat-
%.os
: %.c
$(before-compile
)
90 $(compile-command.c
) -DEXPORT_RPC_SYMBOLS
93 CFLAGS-auth_unix.c
+= -fexceptions
94 CFLAGS-key_call.c
+= -fexceptions
95 CFLAGS-pmap_rmt.c
+= -fexceptions
96 CFLAGS-clnt_perr.c
+= -fexceptions
97 CFLAGS-openchild.c
+= -fexceptions
99 $(objpfx
)tst-getmyaddr
: $(common-objpfx
)linkobj
/libc.so
100 $(objpfx
)tst-xdrmem
: $(common-objpfx
)linkobj
/libc.so
101 $(objpfx
)tst-xdrmem2
: $(common-objpfx
)linkobj
/libc.so
102 $(objpfx
)tst-udp-error
: $(common-objpfx
)linkobj
/libc.so
103 $(objpfx
)tst-svc_register
: \
104 $(common-objpfx
)linkobj
/libc.so
$(shared-thread-library
)
106 $(objpfx
)thrsvc
: $(common-objpfx
)linkobj
/libc.so
$(shared-thread-library
)
108 $(objpfx
)tst-udp-timeout
: $(common-objpfx
)linkobj
/libc.so
109 $(objpfx
)tst-udp-nonblocking
: $(common-objpfx
)linkobj
/libc.so
110 $(objpfx
)tst-udp-garbage
: \
111 $(common-objpfx
)linkobj
/libc.so
$(shared-thread-library
)
113 else # !have-GLIBC_2.31
115 routines
= $(routines-for-nss
)
119 ifeq (yes
,$(build-shared
))
120 # Create an empty archive, so that Makerules can reference it.
121 subdir_lib
: $(objpfx
)librpc_compat_pic.a
122 $(objpfx
)librpc_compat_pic.a
: Makefile
123 $(make-target-directory
)
128 endif # !have-GLIBC_2.31