]>
Commit | Line | Data |
---|---|---|
33574c17 | 1 | # |
04277e02 | 2 | # Copyright (C) 1994-2019 Free Software Foundation, Inc. |
33574c17 | 3 | # |
ad2b41bf ST |
4 | # The GNU C Library is free software; you can redistribute it and/or |
5 | # modify it under the terms of the GNU Lesser General Public | |
6 | # License as published by the Free Software Foundation; either | |
7 | # version 2.1 of the License, or (at your option) any later version. | |
8 | ||
9 | # The GNU C Library is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
33574c17 | 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
ad2b41bf ST |
12 | # Lesser General Public License for more details. |
13 | ||
14 | # You should have received a copy of the GNU Lesser General Public | |
15 | # License along with the GNU C Library; if not, see | |
16 | # <http://www.gnu.org/licenses/>. | |
33574c17 ST |
17 | |
18 | subdir := htl | |
19 | ||
20 | srcdir = . | |
21 | ||
22 | MICROKERNEL := mach | |
23 | SYSDEPS := lockfile | |
24 | ||
25 | LCLHDRS := | |
26 | ||
27 | libpthread-routines := pt-attr pt-attr-destroy pt-attr-getdetachstate \ | |
28 | pt-attr-getguardsize pt-attr-getinheritsched \ | |
29 | pt-attr-getschedparam pt-attr-getschedpolicy pt-attr-getscope \ | |
30 | pt-attr-getstack pt-attr-getstackaddr pt-attr-getstacksize \ | |
31 | pt-attr-init pt-attr-setdetachstate pt-attr-setguardsize \ | |
32 | pt-attr-setinheritsched pt-attr-setschedparam \ | |
33 | pt-attr-setschedpolicy pt-attr-setscope pt-attr-setstack \ | |
34 | pt-attr-setstackaddr pt-attr-setstacksize \ | |
35 | \ | |
36 | pt-barrier-destroy pt-barrier-init pt-barrier-wait \ | |
37 | pt-barrier pt-barrierattr-destroy pt-barrierattr-init \ | |
38 | pt-barrierattr-getpshared pt-barrierattr-setpshared \ | |
39 | \ | |
40 | pt-destroy-specific pt-init-specific \ | |
41 | pt-key-create pt-key-delete \ | |
42 | pt-getspecific pt-setspecific \ | |
43 | \ | |
44 | pt-once \ | |
45 | \ | |
46 | pt-alloc \ | |
47 | pt-create \ | |
48 | pt-getattr \ | |
49 | pt-equal \ | |
50 | pt-dealloc \ | |
51 | pt-detach \ | |
52 | pt-exit \ | |
53 | pt-initialize \ | |
54 | pt-join \ | |
55 | pt-self \ | |
56 | pt-sigmask \ | |
57 | pt-spin-inlines \ | |
58 | pt-cleanup \ | |
59 | pt-setcancelstate \ | |
60 | pt-setcanceltype \ | |
61 | pt-testcancel \ | |
62 | pt-cancel \ | |
63 | \ | |
64 | pt-mutexattr \ | |
65 | pt-mutexattr-destroy pt-mutexattr-init \ | |
66 | pt-mutexattr-getprioceiling pt-mutexattr-getprotocol \ | |
67 | pt-mutexattr-getpshared pt-mutexattr-gettype \ | |
68 | pt-mutexattr-setprioceiling pt-mutexattr-setprotocol \ | |
69 | pt-mutexattr-setpshared pt-mutexattr-settype \ | |
70 | pt-mutexattr-getrobust pt-mutexattr-setrobust \ | |
71 | \ | |
72 | pt-mutex-init pt-mutex-destroy \ | |
73 | pt-mutex-lock pt-mutex-trylock pt-mutex-timedlock \ | |
74 | pt-mutex-unlock \ | |
75 | pt-mutex-transfer-np \ | |
76 | pt-mutex-getprioceiling pt-mutex-setprioceiling \ | |
77 | pt-mutex-consistent \ | |
78 | \ | |
79 | pt-rwlock-attr \ | |
80 | pt-rwlockattr-init pt-rwlockattr-destroy \ | |
81 | pt-rwlockattr-getpshared pt-rwlockattr-setpshared \ | |
82 | \ | |
83 | pt-rwlock-init pt-rwlock-destroy \ | |
84 | pt-rwlock-rdlock pt-rwlock-tryrdlock \ | |
85 | pt-rwlock-trywrlock pt-rwlock-wrlock \ | |
86 | pt-rwlock-timedrdlock pt-rwlock-timedwrlock \ | |
87 | pt-rwlock-unlock \ | |
88 | \ | |
89 | pt-cond \ | |
90 | pt-condattr-init pt-condattr-destroy \ | |
91 | pt-condattr-getclock pt-condattr-getpshared \ | |
92 | pt-condattr-setclock pt-condattr-setpshared \ | |
93 | \ | |
94 | pt-cond-destroy pt-cond-init \ | |
95 | pt-cond-brdcast \ | |
96 | pt-cond-signal \ | |
97 | pt-cond-wait \ | |
98 | pt-cond-timedwait \ | |
99 | pt-hurd-cond-wait \ | |
100 | pt-hurd-cond-timedwait \ | |
101 | \ | |
102 | pt-stack-alloc \ | |
103 | pt-thread-alloc \ | |
104 | pt-thread-start \ | |
105 | pt-thread-terminate \ | |
106 | pt-startup \ | |
107 | \ | |
108 | pt-getconcurrency pt-setconcurrency \ | |
109 | \ | |
110 | pt-block \ | |
111 | pt-timedblock \ | |
112 | pt-wakeup \ | |
113 | pt-docancel \ | |
114 | pt-sysdep \ | |
115 | pt-setup \ | |
116 | pt-machdep \ | |
117 | pt-spin \ | |
118 | \ | |
119 | pt-sigstate-init \ | |
120 | pt-sigstate-destroy \ | |
121 | pt-sigstate \ | |
122 | \ | |
123 | pt-atfork \ | |
124 | old_pt-atfork \ | |
125 | pt-kill \ | |
126 | pt-getcpuclockid \ | |
127 | \ | |
128 | pt-getschedparam pt-setschedparam pt-setschedprio \ | |
129 | pt-yield \ | |
130 | \ | |
131 | sem-close sem-destroy sem-getvalue sem-init sem-open \ | |
132 | sem-post sem-timedwait sem-trywait sem-unlink \ | |
133 | sem-wait \ | |
134 | \ | |
135 | shm-directory \ | |
136 | \ | |
137 | cthreads-compat \ | |
138 | $(SYSDEPS) | |
139 | ||
140 | libpthread-static-only-routines = pt-atfork | |
141 | ||
142 | headers := \ | |
143 | pthread.h \ | |
144 | semaphore.h \ | |
145 | \ | |
146 | bits/pthread.h \ | |
147 | bits/pthread-np.h \ | |
148 | bits/pthreadtypes.h \ | |
149 | bits/pthreadtypes-arch.h \ | |
150 | bits/thread-shared-types.h \ | |
151 | bits/types/struct___pthread_mutex.h \ | |
152 | bits/types/struct___pthread_cond.h \ | |
153 | bits/types/struct___pthread_condattr.h \ | |
154 | bits/types/__pthread_spinlock_t.h \ | |
155 | bits/spin-lock-inline.h \ | |
156 | bits/cancelation.h \ | |
157 | bits/types/struct___pthread_attr.h \ | |
158 | bits/types/struct___pthread_barrierattr.h \ | |
159 | bits/types/struct___pthread_barrier.h \ | |
160 | bits/types/__pthread_key.h \ | |
161 | bits/types/struct___pthread_once.h \ | |
162 | bits/types/struct___pthread_mutexattr.h \ | |
163 | bits/types/struct___pthread_rwlock.h \ | |
164 | bits/types/struct___pthread_rwlockattr.h \ | |
165 | bits/semaphore.h | |
166 | ||
167 | distribute := | |
168 | ||
169 | routines := forward libc_pthread_init alloca_cutoff | |
170 | shared-only-routines = forward | |
171 | ||
172 | extra-libs := libpthread | |
173 | extra-libs-others := $(extra-libs) | |
174 | install-lib := libpthread.so | |
175 | ||
176 | include ../Makeconfig | |
177 | ||
178 | CFLAGS-lockfile.c = -D_IO_MTSAFE_IO | |
179 | ||
180 | all: # Make this the default target; it will be defined in Rules. | |
181 | ||
182 | subdir_install: $(inst_libdir)/libpthread2.a | |
183 | ||
184 | # XXX: If $(inst_libdir)/libpthread2.a is installed and | |
185 | # $(inst_libdir)/libpthread is not, we can have some issues. | |
186 | .PHONY: $(inst_libdir)/libpthread.a $(inst_libdir)/libpthread_pic.a | |
187 | ||
188 | # XXX: These rules are a hack. But it is better than messing with | |
189 | # ../Makeconf at the moment. Note that the linker scripts | |
190 | # $(srcdir)/libpthread.a and $(srcdir)/libpthread_pic.a get overwritten | |
191 | # when building in $(srcdir) and not a seperate build directory. | |
192 | $(inst_libdir)/libpthread2.a: $(inst_libdir)/libpthread.a | |
193 | mv $< $@ | |
194 | $(INSTALL_DATA) $(srcdir)/libpthread.a $< | |
195 | ||
196 | $(inst_libdir)/libpthread2_pic.a: $(inst_libdir)/libpthread_pic.a | |
197 | mv $< $@ | |
198 | $(INSTALL_DATA) $(srcdir)/libpthread_pic.a $< | |
199 | ||
200 | libc-link.so = $(common-objpfx)libc.so | |
201 | ||
202 | extra-B-pthread.so = -B$(common-objpfx)htl/ | |
203 | ||
204 | include ../Rules | |
205 | ||
206 | ifeq (yes,$(build-shared)) | |
207 | # What we install as libpthread.so for programs to link against is in fact a | |
208 | # link script. It contains references for the various libraries we need. | |
209 | # The libpthread.so object is not complete since some functions are only | |
210 | # defined in libpthread_nonshared.a. | |
211 | # We need to use absolute paths since otherwise local copies (if they exist) | |
212 | # of the files are taken by the linker. | |
213 | install: $(inst_libdir)/libpthread.so | |
214 | ||
215 | $(inst_libdir)/libpthread.so: $(common-objpfx)format.lds \ | |
216 | $(objpfx)libpthread.so$(libpthread.so-version) \ | |
217 | $(inst_libdir)/$(patsubst %,$(libtype.oS),\ | |
218 | $(libprefix)pthread) \ | |
219 | $(+force) | |
220 | (echo '/* GNU ld script';\ | |
221 | echo ' Use the shared library, but some functions are only in';\ | |
222 | echo ' the static library, so try that secondarily. */';\ | |
223 | cat $<; \ | |
224 | echo 'GROUP ( $(slibdir)/libpthread.so$(libpthread.so-version)' \ | |
225 | '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)pthread)'\ | |
226 | ')' \ | |
227 | ) > $@.new | |
228 | mv -f $@.new $@ | |
229 | ||
230 | $(addprefix $(objpfx), \ | |
231 | $(filter-out $(tests-static) $(xtests-static) $(tests-reverse) \ | |
232 | $(tests-nolibpthread), \ | |
233 | $(tests) $(xtests) $(test-srcs))): $(objpfx)libpthread.so \ | |
234 | $(objpfx)libpthread_nonshared.a | |
235 | endif | |
236 | ||
237 | generated += libpthread_nonshared.a |