]>
Commit | Line | Data |
---|---|---|
c23de0aa | 1 | # Makefile for support library, used only at build and test time |
688903eb | 2 | # Copyright (C) 2016-2018 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 | |
17 | # <http://www.gnu.org/licenses/>. | |
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 = \ | |
28 | check \ | |
5840c75c FW |
29 | check_addrinfo \ |
30 | check_dns_packet \ | |
31 | check_hostent \ | |
32 | check_netent \ | |
c23de0aa FW |
33 | delayed_exit \ |
34 | ignore_stderr \ | |
cae87e64 | 35 | next_to_fault \ |
c23de0aa | 36 | oom_error \ |
5840c75c | 37 | resolv_test \ |
c23de0aa | 38 | set_fortify_handler \ |
bad7a0c8 | 39 | support-xfstat \ |
2714c5f3 | 40 | support-xstat \ |
5707a64d | 41 | support_become_root \ |
2714c5f3 | 42 | support_can_chroot \ |
91b6eb11 | 43 | support_capture_subprocess \ |
2714c5f3 | 44 | support_capture_subprocess_check \ |
d4165eed | 45 | support_chroot \ |
aa42b3db | 46 | support_descriptor_supports_holes \ |
273a0c49 | 47 | support_enter_mount_namespace \ |
5707a64d | 48 | support_enter_network_namespace \ |
5840c75c FW |
49 | support_format_address_family \ |
50 | support_format_addrinfo \ | |
51 | support_format_dns_packet \ | |
52 | support_format_herrno \ | |
53 | support_format_hostent \ | |
54 | support_format_netent \ | |
2714c5f3 | 55 | support_isolate_in_subprocess \ |
2cc7bad0 | 56 | support_openpty \ |
561b0bec | 57 | support_paths \ |
2afece36 | 58 | support_quote_blob \ |
5f0b8437 | 59 | support_record_failure \ |
5840c75c | 60 | support_run_diff \ |
2714c5f3 | 61 | support_shared_allocate \ |
2afece36 | 62 | support_test_compare_blob \ |
93485524 | 63 | support_test_compare_failure \ |
2714c5f3 | 64 | support_write_file_string \ |
c23de0aa | 65 | support_test_main \ |
5f0b8437 | 66 | support_test_verify_impl \ |
c23de0aa FW |
67 | temp_file \ |
68 | write_message \ | |
5840c75c | 69 | xaccept \ |
e9203023 | 70 | xaccept4 \ |
c23de0aa | 71 | xasprintf \ |
5840c75c | 72 | xbind \ |
c23de0aa | 73 | xcalloc \ |
2714c5f3 | 74 | xchroot \ |
ed3ea040 | 75 | xclose \ |
5840c75c | 76 | xconnect \ |
1cc9e59a | 77 | xdlfcn \ |
91b6eb11 | 78 | xdup2 \ |
5840c75c FW |
79 | xfclose \ |
80 | xfopen \ | |
5f0b8437 | 81 | xfork \ |
bad7a0c8 | 82 | xftruncate \ |
5840c75c FW |
83 | xgetsockname \ |
84 | xlisten \ | |
bad7a0c8 | 85 | xlseek \ |
c23de0aa | 86 | xmalloc \ |
5840c75c | 87 | xmemstream \ |
2714c5f3 | 88 | xmkdir \ |
561b0bec | 89 | xmkdirp \ |
faf0e9c8 | 90 | xmmap \ |
60149b28 | 91 | xmprotect \ |
faf0e9c8 | 92 | xmunmap \ |
2714c5f3 | 93 | xopen \ |
91b6eb11 | 94 | xpipe \ |
5840c75c | 95 | xpoll \ |
f8bf15fe CD |
96 | xpthread_attr_destroy \ |
97 | xpthread_attr_init \ | |
98 | xpthread_attr_setdetachstate \ | |
0edbf123 | 99 | xpthread_attr_setguardsize \ |
446d22e9 | 100 | xpthread_attr_setstacksize \ |
c23de0aa FW |
101 | xpthread_barrier_destroy \ |
102 | xpthread_barrier_init \ | |
103 | xpthread_barrier_wait \ | |
0ce2fa69 FW |
104 | xpthread_barrierattr_destroy \ |
105 | xpthread_barrierattr_init \ | |
106 | xpthread_barrierattr_setpshared \ | |
c23de0aa FW |
107 | xpthread_cancel \ |
108 | xpthread_check_return \ | |
109 | xpthread_cond_wait \ | |
110 | xpthread_create \ | |
111 | xpthread_detach \ | |
112 | xpthread_join \ | |
faf0e9c8 FW |
113 | xpthread_mutex_consistent \ |
114 | xpthread_mutex_destroy \ | |
115 | xpthread_mutex_init \ | |
c23de0aa FW |
116 | xpthread_mutex_lock \ |
117 | xpthread_mutex_unlock \ | |
faf0e9c8 FW |
118 | xpthread_mutexattr_destroy \ |
119 | xpthread_mutexattr_init \ | |
120 | xpthread_mutexattr_setprotocol \ | |
121 | xpthread_mutexattr_setpshared \ | |
122 | xpthread_mutexattr_setrobust \ | |
123 | xpthread_mutexattr_settype \ | |
5840c75c | 124 | xpthread_once \ |
faf8c066 CD |
125 | xpthread_rwlock_init \ |
126 | xpthread_rwlock_rdlock \ | |
faf8c066 | 127 | xpthread_rwlock_unlock \ |
1ffe1ccb | 128 | xpthread_rwlock_wrlock \ |
faf8c066 CD |
129 | xpthread_rwlockattr_init \ |
130 | xpthread_rwlockattr_setkind_np \ | |
c23de0aa FW |
131 | xpthread_sigmask \ |
132 | xpthread_spin_lock \ | |
133 | xpthread_spin_unlock \ | |
446d22e9 | 134 | xraise \ |
1ffe1ccb | 135 | xreadlink \ |
c23de0aa | 136 | xrealloc \ |
5840c75c FW |
137 | xrecvfrom \ |
138 | xsendto \ | |
139 | xsetsockopt \ | |
446d22e9 FW |
140 | xsigaction \ |
141 | xsignal \ | |
5707a64d | 142 | xsocket \ |
5840c75c | 143 | xstrdup \ |
1ffe1ccb | 144 | xstrndup \ |
561b0bec | 145 | xsymlink \ |
446d22e9 | 146 | xsysconf \ |
1ffe1ccb | 147 | xunlink \ |
5f0b8437 | 148 | xwaitpid \ |
5840c75c | 149 | xwrite \ |
c23de0aa FW |
150 | |
151 | libsupport-static-only-routines := $(libsupport-routines) | |
152 | # Only build one variant of the library. | |
153 | libsupport-inhibit-o := .os | |
154 | ifeq ($(build-shared),yes) | |
155 | libsupport-inhibit-o += .o | |
156 | endif | |
157 | ||
561b0bec DD |
158 | CFLAGS-support_paths.c = \ |
159 | -DSRCDIR_PATH=\"`cd .. ; pwd`\" \ | |
160 | -DOBJDIR_PATH=\"`cd $(objpfx)/..; pwd`\" \ | |
161 | -DINSTDIR_PATH=\"$(prefix)\" \ | |
162 | -DLIBDIR_PATH=\"$(libdir)\" | |
163 | ||
164 | ifeq (,$(CXX)) | |
165 | LINKS_DSO_PROGRAM = links-dso-program-c | |
166 | else | |
167 | LINKS_DSO_PROGRAM = links-dso-program | |
acc2842a | 168 | LDLIBS-links-dso-program = -lstdc++ -lgcc -lgcc_s $(libunwind) |
561b0bec DD |
169 | endif |
170 | ||
171 | others: \ | |
172 | $(objpfx)test-container \ | |
173 | $(objpfx)shell-container \ | |
174 | $(objpfx)echo-container \ | |
175 | $(objpfx)true-container \ | |
176 | $(objpfx)$(LINKS_DSO_PROGRAM) | |
177 | ||
178 | ifeq ($(build-programs),yes) | |
179 | endif | |
180 | ||
181 | LDLIBS-test-container = $(libsupport) | |
182 | ||
183 | others += test-container | |
184 | others-noinstall += test-container | |
185 | ||
186 | others += shell-container echo-container true-container | |
187 | others-noinstall += shell-container echo-container true-container | |
188 | ||
189 | others += $(LINKS_DSO_PROGRAM) | |
190 | others-noinstall += $(LINKS_DSO_PROGRAM) | |
191 | ||
192 | $(objpfx)test-container : $(libsupport) | |
193 | $(objpfx)shell-container : $(libsupport) | |
194 | $(objpfx)echo-container : $(libsupport) | |
195 | $(objpfx)true-container : $(libsupport) | |
196 | ||
5f0b8437 FW |
197 | tests = \ |
198 | README-testing \ | |
5707a64d | 199 | tst-support-namespace \ |
91b6eb11 | 200 | tst-support_capture_subprocess \ |
f889e73f | 201 | tst-support_format_dns_packet \ |
2afece36 | 202 | tst-support_quote_blob \ |
5f0b8437 | 203 | tst-support_record_failure \ |
93485524 | 204 | tst-test_compare \ |
2afece36 | 205 | tst-test_compare_blob \ |
1ffe1ccb | 206 | tst-xreadlink \ |
5f0b8437 | 207 | |
ef83c83a | 208 | ifeq ($(run-built-tests),yes) |
5f0b8437 FW |
209 | tests-special = \ |
210 | $(objpfx)tst-support_record_failure-2.out | |
211 | ||
212 | $(objpfx)tst-support_record_failure-2.out: tst-support_record_failure-2.sh \ | |
213 | $(objpfx)tst-support_record_failure | |
214 | $(SHELL) $< $(common-objpfx) '$(test-program-prefix-before-env)' \ | |
215 | '$(run-program-env)' '$(test-program-prefix-after-env)' \ | |
216 | > $@; \ | |
217 | $(evaluate-test) | |
ef83c83a | 218 | endif |
c23de0aa | 219 | |
f889e73f FW |
220 | $(objpfx)tst-support_format_dns_packet: $(common-objpfx)resolv/libresolv.so |
221 | ||
c23de0aa | 222 | include ../Rules |