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