1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
|
# Makefile for uClibc
#
# Copyright (C) 2003 Paul Mundt <lethal@linux-sh.org>
# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
#
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
CFLAGS-linuxthreads.old := -DNOT_IN_libc $(SSP_ALL_CFLAGS)
CFLAGS-libpthread/linuxthreads.old/sysdeps/$(TARGET_ARCH)/ := $(CFLAGS-linuxthreads.old)
# This stuff will not compile without at least -O1
# psm: can't handle this here, could maybe search for -O0 in CFLAGS
# and append -O1 if found
#CFLAGS:=$(CFLAGS:-O0=-O1)
ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
LDFLAGS-libpthread.so := $(LDFLAGS_NOSTRIP) -z defs
else
LDFLAGS-libpthread.so := $(LDFLAGS)
endif
LIBS-libpthread.so := $(LIBS)
START_FILE-libpthread.so := $(SHARED_START_FILES)
END_FILE-libpthread.so := $(SHARED_END_FILES)
libpthread_FULL_NAME := libpthread-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so
libpthread_DIR := $(top_srcdir)libpthread/linuxthreads.old
libpthread_OUT := $(top_builddir)libpthread/linuxthreads.old
-include $(libpthread_DIR)/sysdeps/$(TARGET_ARCH)/Makefile.arch
libpthread_SRC := \
attr.c cancel.c condvar.c errno.c events.c join.c lockfile.c manager.c \
mutex.c oldsemaphore.c pt-machine.c ptfork.c pthread.c ptlongjmp.c \
rwlock.c semaphore.c signals.c specific.c spinlock.c wrapsyscall.c
ifeq ($(UCLIBC_HAS_XLOCALE),y)
libpthread_SRC += locale.c
endif
ifneq ($(DOMULTI),n)
libpthread_NO_MULTI := manager.c pt-machine.c
libpthread_SRC := $(filter-out $(libpthread_NO_MULTI),$(libpthread_SRC))
endif
# remove generic sources, if arch specific version is present
ifneq ($(strip $(libpthread_ARCH_SRC)),)
libpthread_SRC := $(filter-out $(patsubst %.c,$(libpthread_DIR)/%.c,$(notdir $(libpthread_ARCH_SRC))),$(libpthread_SRC))
endif
libpthread_SRC := $(patsubst %,$(libpthread_DIR)/%,$(libpthread_SRC))
libpthread_OBJ := $(patsubst $(libpthread_DIR)/%.c,$(libpthread_OUT)/%.o,$(libpthread_SRC))
ifeq ($(DOPIC),y)
libpthread-a-y += $(libpthread_OBJ:.o=.os)
else
libpthread-a-y += $(libpthread_OBJ)
endif
libpthread-so-y += $(libpthread_OBJ:.o=.os)
libpthread-multi-y += $(libpthread_SRC)
libpthread-nomulti-y += $(patsubst %.c,$(libpthread_OUT)/%.o,$(libpthread_NO_MULTI))
lib-a-$(UCLIBC_HAS_THREADS) += $(top_builddir)lib/libpthread.a
lib-so-$(UCLIBC_HAS_THREADS) += $(top_builddir)lib/libpthread.so
objclean-y += libpthread_clean
headers-$(UCLIBC_HAS_THREADS) += linuxthreads_headers
headers_clean-y += linuxthreads_headers_clean
$(top_builddir)lib/libpthread.so: $(libpthread_OUT)/libpthread_so.a $(libc)
$(call link.so,$(libpthread_FULL_NAME),$(MAJOR_VERSION))
$(libpthread_OUT)/libpthread_so.a: $(libpthread-so-y)
$(Q)$(RM) $@
ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
$(do_strip:-x=-X --strip-debug)
else
$(do_strip)
endif
$(do_ar)
$(top_builddir)lib/libpthread.a: $(libpthread-a-y)
$(Q)$(INSTALL) -d $(dir $@)
$(Q)$(RM) $@
ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
$(do_strip:-x=-X --strip-debug)
else
$(do_strip)
endif
$(do_ar)
linuxthreads_headers:
$(LN) -sf ../$(PTDIR)/sysdeps/pthread/pthread.h $(top_builddir)include/
$(LN) -sf ../$(PTDIR)/semaphore.h $(top_builddir)include/
$(INSTALL) -d $(top_builddir)include/bits
$(LN) -sf ../../$(PTDIR)/sysdeps/pthread/bits/pthreadtypes.h $(top_builddir)include/bits/
linuxthreads_headers_clean:
$(RM) $(top_builddir)include/pthread.h $(top_builddir)include/semaphore.h \
$(top_builddir)include/bits/pthreadtypes.h
libpthread_clean:
$(RM) $(libpthread_OUT)/*.{o,os,a}
|