socket: Use offsetof in SUN_LEN (bug 29578)
[glibc.git] / sunrpc / Makefile
bloba79a7195fce631d2588225f28dbd1cf0f5a81ec7
1 # Copyright (C) 1994-2022 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.
21 subdir := sunrpc
23 include ../Makeconfig
25 ifdef have-GLIBC_2.31
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
34 # file name limits:
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 \
54 svc_run
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) \
62 rpc_gethostbyname
63 # We only add the RPC for compatibility to libc.so.
64 shared-only-routines = $(routines)
65 endif
67 tests = tst-xdrmem tst-xdrmem2 test-rpcent tst-udp-error tst-udp-timeout \
68 tst-udp-nonblocking tst-bug22542 tst-bug28768
70 xtests := tst-getmyaddr
72 ifeq ($(have-thread-library),yes)
73 xtests += thrsvc
74 tests += tst-udp-garbage tst-svc_register
75 endif
77 ifeq (yes,$(build-shared))
78 rpc-compat-routines = $(addprefix compat-,$(need-export-routines))
79 rpc-compat-routines.os = $(addprefix $(objpfx), \
80 $(addsuffix .os,$(rpc-compat-routines)))
81 extra-objs += $(addsuffix .os,$(rpc-compat-routines))
82 endif
84 include ../Rules
86 ifeq (yes,$(build-shared))
87 subdir_lib: $(objpfx)librpc_compat_pic.a
88 $(objpfx)librpc_compat_pic.a: $(rpc-compat-routines.os)
89 $(AR) cr$(verbose) $@ $^
90 $(rpc-compat-routines.os): $(objpfx)compat-%.os: %.c $(before-compile)
91 $(compile-command.c) -DEXPORT_RPC_SYMBOLS
92 endif
94 CFLAGS-auth_unix.c += -fexceptions
95 CFLAGS-key_call.c += -fexceptions
96 CFLAGS-pmap_rmt.c += -fexceptions
97 CFLAGS-clnt_perr.c += -fexceptions
98 CFLAGS-openchild.c += -fexceptions
100 $(objpfx)tst-getmyaddr: $(common-objpfx)linkobj/libc.so
101 $(objpfx)tst-xdrmem: $(common-objpfx)linkobj/libc.so
102 $(objpfx)tst-xdrmem2: $(common-objpfx)linkobj/libc.so
103 $(objpfx)tst-udp-error: $(common-objpfx)linkobj/libc.so
104 $(objpfx)tst-svc_register: \
105 $(common-objpfx)linkobj/libc.so $(shared-thread-library)
107 $(objpfx)thrsvc: $(common-objpfx)linkobj/libc.so $(shared-thread-library)
109 $(objpfx)tst-udp-timeout: $(common-objpfx)linkobj/libc.so
110 $(objpfx)tst-udp-nonblocking: $(common-objpfx)linkobj/libc.so
111 $(objpfx)tst-udp-garbage: \
112 $(common-objpfx)linkobj/libc.so $(shared-thread-library)
114 $(objpfx)tst-bug22542: $(common-objpfx)linkobj/libc.so
116 else # !have-GLIBC_2.31
118 routines = $(routines-for-nss)
120 include ../Rules
122 ifeq (yes,$(build-shared))
123 # Create an empty archive, so that Makerules can reference it.
124 subdir_lib: $(objpfx)librpc_compat_pic.a
125 $(objpfx)librpc_compat_pic.a: Makefile
126 $(make-target-directory)
127 $(AR) cr $@
128 endif
131 endif # !have-GLIBC_2.31