]>
Commit | Line | Data |
---|---|---|
c23de0aa | 1 | # Makefile for support library, used only at build and test time |
04277e02 | 2 | # Copyright (C) 2016-2019 Free Software Foundation, Inc. |
c23de0aa FW |
3 | # This file is part of the GNU C Library. |
4 | ||
5 | # The GNU C Library is free software; you can redistribute it and/or | |
6 | # modify it under the terms of the GNU Lesser General Public | |
7 | # License as published by the Free Software Foundation; either | |
8 | # version 2.1 of the License, or (at your option) any later version. | |
9 | ||
10 | # The GNU C Library is distributed in the hope that it will be useful, | |
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 | # Lesser General Public License for more details. | |
14 | ||
15 | # You should have received a copy of the GNU Lesser General Public | |
16 | # License along with the GNU C Library; if not, see | |
5a82c748 | 17 | # <https://www.gnu.org/licenses/>. |
c23de0aa FW |
18 | |
19 | subdir := support | |
20 | ||
21 | include ../Makeconfig | |
22 | ||
23 | extra-libs := libsupport | |
24 | extra-libs-others = $(extra-libs) | |
25 | extra-libs-noinstall := $(extra-libs) | |
26 | ||
27 | libsupport-routines = \ | |
f5e7e959 | 28 | blob_repeat \ |
c23de0aa | 29 | check \ |
5840c75c FW |
30 | check_addrinfo \ |
31 | check_dns_packet \ | |
32 | check_hostent \ | |
33 | check_netent \ | |
c23de0aa FW |
34 | delayed_exit \ |
35 | ignore_stderr \ | |
cae87e64 | 36 | next_to_fault \ |
c23de0aa | 37 | oom_error \ |
5840c75c | 38 | resolv_test \ |
c23de0aa | 39 | set_fortify_handler \ |
bad7a0c8 | 40 | support-xfstat \ |
2714c5f3 | 41 | support-xstat \ |
5707a64d | 42 | support_become_root \ |
2714c5f3 | 43 | support_can_chroot \ |
91b6eb11 | 44 | support_capture_subprocess \ |
2714c5f3 | 45 | support_capture_subprocess_check \ |
d4165eed | 46 | support_chroot \ |
81b9d87b | 47 | support_copy_file_range \ |
aa42b3db | 48 | support_descriptor_supports_holes \ |
f255336a | 49 | support_descriptors \ |
273a0c49 | 50 | support_enter_mount_namespace \ |
5707a64d | 51 | support_enter_network_namespace \ |
5840c75c FW |
52 | support_format_address_family \ |
53 | support_format_addrinfo \ | |
54 | support_format_dns_packet \ | |
55 | support_format_herrno \ | |
56 | support_format_hostent \ | |
57 | support_format_netent \ | |
2714c5f3 | 58 | support_isolate_in_subprocess \ |
2f9046fb | 59 | support_ptrace \ |
2cc7bad0 | 60 | support_openpty \ |
561b0bec | 61 | support_paths \ |
2afece36 | 62 | support_quote_blob \ |
c74a91de | 63 | support_quote_string \ |
5f0b8437 | 64 | support_record_failure \ |
5840c75c | 65 | support_run_diff \ |
36ada9ee | 66 | support_set_small_thread_stack_size \ |
2714c5f3 | 67 | support_shared_allocate \ |
36ada9ee | 68 | support_small_stack_thread_attribute \ |
0e169691 | 69 | support_subprocess \ |
2afece36 | 70 | support_test_compare_blob \ |
93485524 | 71 | support_test_compare_failure \ |
1df872fd | 72 | support_test_compare_string \ |
2714c5f3 | 73 | support_write_file_string \ |
c23de0aa | 74 | support_test_main \ |
5f0b8437 | 75 | support_test_verify_impl \ |
c23de0aa | 76 | temp_file \ |
51983996 MC |
77 | timespec \ |
78 | timespec-add \ | |
79 | timespec-sub \ | |
c23de0aa | 80 | write_message \ |
5840c75c | 81 | xaccept \ |
e9203023 | 82 | xaccept4 \ |
c23de0aa | 83 | xasprintf \ |
5840c75c | 84 | xbind \ |
c23de0aa | 85 | xcalloc \ |
2714c5f3 | 86 | xchroot \ |
33647a72 | 87 | xclock_gettime \ |
ed3ea040 | 88 | xclose \ |
5840c75c | 89 | xconnect \ |
81b9d87b | 90 | xcopy_file_range \ |
1cc9e59a | 91 | xdlfcn \ |
94b63e66 | 92 | xdlmopen \ |
91b6eb11 | 93 | xdup2 \ |
5840c75c FW |
94 | xfclose \ |
95 | xfopen \ | |
5f0b8437 | 96 | xfork \ |
bad7a0c8 | 97 | xftruncate \ |
5840c75c FW |
98 | xgetsockname \ |
99 | xlisten \ | |
bad7a0c8 | 100 | xlseek \ |
c23de0aa | 101 | xmalloc \ |
5840c75c | 102 | xmemstream \ |
2714c5f3 | 103 | xmkdir \ |
561b0bec | 104 | xmkdirp \ |
faf0e9c8 | 105 | xmmap \ |
60149b28 | 106 | xmprotect \ |
faf0e9c8 | 107 | xmunmap \ |
2714c5f3 | 108 | xopen \ |
91b6eb11 | 109 | xpipe \ |
5840c75c | 110 | xpoll \ |
bc79db3f | 111 | xposix_memalign \ |
f8bf15fe CD |
112 | xpthread_attr_destroy \ |
113 | xpthread_attr_init \ | |
114 | xpthread_attr_setdetachstate \ | |
0edbf123 | 115 | xpthread_attr_setguardsize \ |
bc79db3f | 116 | xpthread_attr_setstack \ |
446d22e9 | 117 | xpthread_attr_setstacksize \ |
c23de0aa FW |
118 | xpthread_barrier_destroy \ |
119 | xpthread_barrier_init \ | |
120 | xpthread_barrier_wait \ | |
0ce2fa69 FW |
121 | xpthread_barrierattr_destroy \ |
122 | xpthread_barrierattr_init \ | |
123 | xpthread_barrierattr_setpshared \ | |
c23de0aa FW |
124 | xpthread_cancel \ |
125 | xpthread_check_return \ | |
126 | xpthread_cond_wait \ | |
127 | xpthread_create \ | |
128 | xpthread_detach \ | |
129 | xpthread_join \ | |
faf0e9c8 FW |
130 | xpthread_mutex_consistent \ |
131 | xpthread_mutex_destroy \ | |
132 | xpthread_mutex_init \ | |
c23de0aa FW |
133 | xpthread_mutex_lock \ |
134 | xpthread_mutex_unlock \ | |
faf0e9c8 FW |
135 | xpthread_mutexattr_destroy \ |
136 | xpthread_mutexattr_init \ | |
137 | xpthread_mutexattr_setprotocol \ | |
138 | xpthread_mutexattr_setpshared \ | |
139 | xpthread_mutexattr_setrobust \ | |
140 | xpthread_mutexattr_settype \ | |
5840c75c | 141 | xpthread_once \ |
faf8c066 | 142 | xpthread_rwlock_init \ |
5fc9ed4c | 143 | xpthread_rwlock_destroy \ |
faf8c066 | 144 | xpthread_rwlock_rdlock \ |
faf8c066 | 145 | xpthread_rwlock_unlock \ |
1ffe1ccb | 146 | xpthread_rwlock_wrlock \ |
faf8c066 CD |
147 | xpthread_rwlockattr_init \ |
148 | xpthread_rwlockattr_setkind_np \ | |
c23de0aa FW |
149 | xpthread_sigmask \ |
150 | xpthread_spin_lock \ | |
151 | xpthread_spin_unlock \ | |
446d22e9 | 152 | xraise \ |
1ffe1ccb | 153 | xreadlink \ |
c23de0aa | 154 | xrealloc \ |
5840c75c FW |
155 | xrecvfrom \ |
156 | xsendto \ | |
cce35a50 | 157 | xsetlocale \ |
5840c75c | 158 | xsetsockopt \ |
446d22e9 FW |
159 | xsigaction \ |
160 | xsignal \ | |
fbbc9a4e | 161 | xsigstack \ |
5707a64d | 162 | xsocket \ |
0e169691 AZ |
163 | xposix_spawn \ |
164 | xposix_spawn_file_actions_addclose \ | |
165 | xposix_spawn_file_actions_adddup2 \ | |
5840c75c | 166 | xstrdup \ |
1ffe1ccb | 167 | xstrndup \ |
561b0bec | 168 | xsymlink \ |
446d22e9 | 169 | xsysconf \ |
1ffe1ccb | 170 | xunlink \ |
5f0b8437 | 171 | xwaitpid \ |
5840c75c | 172 | xwrite \ |
c23de0aa FW |
173 | |
174 | libsupport-static-only-routines := $(libsupport-routines) | |
175 | # Only build one variant of the library. | |
176 | libsupport-inhibit-o := .os | |
177 | ifeq ($(build-shared),yes) | |
178 | libsupport-inhibit-o += .o | |
179 | endif | |
180 | ||
561b0bec DD |
181 | CFLAGS-support_paths.c = \ |
182 | -DSRCDIR_PATH=\"`cd .. ; pwd`\" \ | |
183 | -DOBJDIR_PATH=\"`cd $(objpfx)/..; pwd`\" \ | |
e7624d70 | 184 | -DOBJDIR_ELF_LDSO_PATH=\"`cd $(objpfx)/..; pwd`/elf/$(rtld-installed-name)\" \ |
561b0bec | 185 | -DINSTDIR_PATH=\"$(prefix)\" \ |
c7ac9caa | 186 | -DLIBDIR_PATH=\"$(libdir)\" \ |
d50f0918 | 187 | -DBINDIR_PATH=\"$(bindir)\" \ |
75c51570 | 188 | -DSBINDIR_PATH=\"$(sbindir)\" \ |
d50f0918 | 189 | -DROOTSBINDIR_PATH=\"$(rootsbindir)\" |
561b0bec DD |
190 | |
191 | ifeq (,$(CXX)) | |
192 | LINKS_DSO_PROGRAM = links-dso-program-c | |
193 | else | |
194 | LINKS_DSO_PROGRAM = links-dso-program | |
acc2842a | 195 | LDLIBS-links-dso-program = -lstdc++ -lgcc -lgcc_s $(libunwind) |
561b0bec DD |
196 | endif |
197 | ||
99135114 DD |
198 | ifeq (yes,$(have-selinux)) |
199 | LDLIBS-$(LINKS_DSO_PROGRAM) += -lselinux | |
200 | endif | |
201 | ||
202 | ||
561b0bec DD |
203 | LDLIBS-test-container = $(libsupport) |
204 | ||
205 | others += test-container | |
206 | others-noinstall += test-container | |
207 | ||
208 | others += shell-container echo-container true-container | |
209 | others-noinstall += shell-container echo-container true-container | |
210 | ||
211 | others += $(LINKS_DSO_PROGRAM) | |
212 | others-noinstall += $(LINKS_DSO_PROGRAM) | |
213 | ||
214 | $(objpfx)test-container : $(libsupport) | |
215 | $(objpfx)shell-container : $(libsupport) | |
216 | $(objpfx)echo-container : $(libsupport) | |
217 | $(objpfx)true-container : $(libsupport) | |
218 | ||
5f0b8437 FW |
219 | tests = \ |
220 | README-testing \ | |
5707a64d | 221 | tst-support-namespace \ |
f5e7e959 | 222 | tst-support_blob_repeat \ |
91b6eb11 | 223 | tst-support_capture_subprocess \ |
f255336a | 224 | tst-support_descriptors \ |
f889e73f | 225 | tst-support_format_dns_packet \ |
2afece36 | 226 | tst-support_quote_blob \ |
c74a91de | 227 | tst-support_quote_string \ |
5f0b8437 | 228 | tst-support_record_failure \ |
93485524 | 229 | tst-test_compare \ |
2afece36 | 230 | tst-test_compare_blob \ |
1df872fd | 231 | tst-test_compare_string \ |
1ffe1ccb | 232 | tst-xreadlink \ |
fbbc9a4e | 233 | tst-xsigstack \ |
5f0b8437 | 234 | |
ef83c83a | 235 | ifeq ($(run-built-tests),yes) |
5f0b8437 FW |
236 | tests-special = \ |
237 | $(objpfx)tst-support_record_failure-2.out | |
238 | ||
239 | $(objpfx)tst-support_record_failure-2.out: tst-support_record_failure-2.sh \ | |
240 | $(objpfx)tst-support_record_failure | |
241 | $(SHELL) $< $(common-objpfx) '$(test-program-prefix-before-env)' \ | |
242 | '$(run-program-env)' '$(test-program-prefix-after-env)' \ | |
243 | > $@; \ | |
244 | $(evaluate-test) | |
ef83c83a | 245 | endif |
c23de0aa | 246 | |
f889e73f FW |
247 | $(objpfx)tst-support_format_dns_packet: $(common-objpfx)resolv/libresolv.so |
248 | ||
0e169691 AZ |
249 | tst-support_capture_subprocess-ARGS = -- $(host-test-program-cmd) |
250 | ||
c23de0aa | 251 | include ../Rules |