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