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.
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.
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.
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/>.
23 extra-libs
:= libsupport
24 extra-libs-others
= $(extra-libs
)
25 extra-libs-noinstall
:= $(extra-libs
)
27 libsupport-routines
= \
44 support_capture_subprocess \
45 support_capture_subprocess_check \
47 support_copy_file_range \
48 support_descriptor_supports_holes \
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 \
62 support_quote_string \
63 support_record_failure \
65 support_shared_allocate \
67 support_test_compare_blob \
68 support_test_compare_failure \
69 support_test_compare_string \
70 support_write_file_string \
72 support_test_verify_impl \
104 xpthread_attr_destroy \
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 \
117 xpthread_check_return \
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 \
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 \
143 xpthread_spin_unlock \
156 xposix_spawn_file_actions_addclose \
157 xposix_spawn_file_actions_adddup2 \
166 libsupport-static-only-routines
:= $(libsupport-routines
)
167 # Only build one variant of the library.
168 libsupport-inhibit-o
:= .os
169 ifeq ($(build-shared
),yes
)
170 libsupport-inhibit-o
+= .o
173 CFLAGS-support_paths.c
= \
174 -DSRCDIR_PATH
=\"`cd .. ; pwd`\" \
175 -DOBJDIR_PATH
=\"`cd $(objpfx)/..; pwd`\" \
176 -DOBJDIR_ELF_LDSO_PATH
=\"`cd $(objpfx)/..; pwd`/elf
/$(rtld-installed-name
)\" \
177 -DINSTDIR_PATH
=\"$(prefix)\" \
178 -DLIBDIR_PATH
=\"$(libdir)\" \
179 -DBINDIR_PATH
=\"$(bindir)\"
182 LINKS_DSO_PROGRAM
= links-dso-program-c
184 LINKS_DSO_PROGRAM
= links-dso-program
185 LDLIBS-links-dso-program
= -lstdc
++ -lgcc
-lgcc_s
$(libunwind
)
188 ifeq (yes
,$(have-selinux
))
189 LDLIBS-
$(LINKS_DSO_PROGRAM
) += -lselinux
193 LDLIBS-test-container
= $(libsupport
)
195 others
+= test-container
196 others-noinstall
+= test-container
198 others
+= shell-container echo-container true-container
199 others-noinstall
+= shell-container echo-container true-container
201 others
+= $(LINKS_DSO_PROGRAM
)
202 others-noinstall
+= $(LINKS_DSO_PROGRAM
)
204 $(objpfx
)test-container
: $(libsupport
)
205 $(objpfx
)shell-container
: $(libsupport
)
206 $(objpfx
)echo-container
: $(libsupport
)
207 $(objpfx
)true-container
: $(libsupport
)
211 tst-support-namespace \
212 tst-support_blob_repeat \
213 tst-support_capture_subprocess \
214 tst-support_descriptors \
215 tst-support_format_dns_packet \
216 tst-support_quote_blob \
217 tst-support_quote_string \
218 tst-support_record_failure \
220 tst-test_compare_blob \
221 tst-test_compare_string \
225 ifeq ($(run-built-tests
),yes
)
227 $(objpfx
)tst-support_record_failure-2.out
229 $(objpfx
)tst-support_record_failure-2.out
: tst-support_record_failure-2.sh \
230 $(objpfx
)tst-support_record_failure
231 $(SHELL
) $< $(common-objpfx
) '$(test-program-prefix-before-env)' \
232 '$(run-program-env)' '$(test-program-prefix-after-env)' \
237 $(objpfx
)tst-support_format_dns_packet
: $(common-objpfx
)resolv
/libresolv.so
239 tst-support_capture_subprocess-ARGS
= -- $(host-test-program-cmd
)