summaryrefslogtreecommitdiff
path: root/libpthread
diff options
context:
space:
mode:
Diffstat (limited to 'libpthread')
-rw-r--r--libpthread/Makefile.in57
-rw-r--r--libpthread/linuxthreads/Makefile.in59
-rw-r--r--libpthread/linuxthreads/sysdeps/sh64/Makefile.in33
-rw-r--r--libpthread/linuxthreads_db/Makefile.in33
4 files changed, 131 insertions, 51 deletions
diff --git a/libpthread/Makefile.in b/libpthread/Makefile.in
new file mode 100644
index 000000000..17a5adca9
--- /dev/null
+++ b/libpthread/Makefile.in
@@ -0,0 +1,57 @@
+# Makefile for uClibc
+#
+# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
+#
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+#
+
+ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
+DIRS:= $(PTNAME) $(PTNAME)_db
+libs: subdirs
+else
+# both do not work at once
+include $(PTDIR)/Makefile.in
+#include $(PTDIR)_db/Makefile.in
+endif
+
+headers-y+=threads_headers
+
+# NPTL does not have a generic pthreadtypes.h
+# and each arch has to have both semaphore.h/pthreadtypes.h ?
+threads_headers:
+ $(LN) -sf $(PTDIR)/sysdeps/pthread/pthread.h $(top_builddir)include/
+ $(LN) -sf $(PTDIR)/semaphore.h $(top_builddir)include/
+ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
+ $(LN) -sf $(PTDIR)_db/thread_db.h $(top_builddir)include/
+endif
+ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y)
+ $(LN) -sf ../$(PTDIR)/sysdeps/unix/sysv/linux/$(TARGET_ARCH)/bits/semaphore.h $(top_builddir)include/bits/
+ $(LN) -sf ../$(PTDIR)/sysdeps/unix/sysv/linux/$(TARGET_ARCH)/bits/pthreadtypes.h $(top_builddir)include/bits/
+ $(LN) -sf ../$(PTDIR)/sysdeps/pthread/bits/libc-lock.h $(top_builddir)include/bits/
+ $(LN) -sf ../$(PTDIR)/sysdeps/pthread/bits/stdio-lock.h $(top_builddir)include/bits/
+else
+ $(LN) -sf ../$(PTDIR)/sysdeps/pthread/bits/pthreadtypes.h $(top_builddir)include/bits/
+endif
+
+headers_clean-y+=threads_headers_clean
+
+threads_headers_clean:
+ $(RM) $(top_builddir)include/pthread.h $(top_builddir)include/semaphore.h \
+ $(top_builddir)include/thread_db.h \
+ $(top_builddir)include/bits/pthreadtypes.h $(top_builddir)include/bits/semaphore.h \
+ $(top_builddir)include/bits/libc-lock.h $(top_builddir)include/bits/stdio-lock
+ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y)
+ $(RM) $(PTNAME)/version.h $(PTDIR)/banner.h \
+ $(PTDIR)/sysdeps/unix/sysv/linux/rtld-libc-lowlevellock.c
+endif
+
+objclean-y+=libpthread_gen_clean
+
+libpthread_gen_clean:
+ $(RM) $(top_builddir)libpthread/*/*.{o,os,a}
+
+ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
+subdirs: $(patsubst %, _dir_%, $(DIRS))
+$(patsubst %, _dir_%, $(DIRS)):
+ $(MAKE) -C $(patsubst _dir_%, %, $@)
+endif
diff --git a/libpthread/linuxthreads/Makefile.in b/libpthread/linuxthreads/Makefile.in
index ed24d3f5c..026fd1452 100644
--- a/libpthread/linuxthreads/Makefile.in
+++ b/libpthread/linuxthreads/Makefile.in
@@ -1,55 +1,56 @@
-# Makefile.in for uClibc
+# Makefile for uClibc's pthread library
#
-# Licensed under LGPL v2.1, see the file COPYING.LIB in this tarball for details.
+# 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+=$(SSP_ALL_CFLAGS)
-# Get the thread include dependencies
-CFLAGS+=$(PTINC)
-
# This stuff will not compile without at least -O1
CFLAGS:=$(CFLAGS:-O0=-O1)
-ARCH_CFLAGS:=$(CFLAGS)
-
LDFLAGS:=$(LDFLAGS_NOSTRIP)
ifeq ($(UCLIBC_CTOR_DTOR),y)
-SHARED_START_FILES=$(top_builddir)lib/crti.o $(LIBGCC_DIR)crtbeginS.o
-SHARED_END_FILES = $(LIBGCC_DIR)crtendS.o $(top_builddir)lib/crtn.o
+SHARED_START_FILES:=$(top_builddir)lib/crti.o $(LIBGCC_DIR)crtbeginS.o
+SHARED_END_FILES:=$(LIBGCC_DIR)crtendS.o $(top_builddir)lib/crtn.o
endif
ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
STRIP_FLAGS:=-X --strip-debug -R .note -R .comment
endif
+DOMULTI=n
+
LIB_NAME:=libpthread
-srcdir=$(top_srcdir)$(LIB_NAME)/linuxthreads
-$(LIB_NAME)_DIR:=$(top_builddir)$(LIB_NAME)/linuxthreads
-$(LIB_NAME)_SRC:=$(wildcard $(srcdir)/*.c)
-ifneq ($(UCLIBC_HAS_XLOCALE),y)
-$(LIB_NAME)_SRC:=$(filter-out $(srcdir)/locale.c,$($(LIB_NAME)_SRC))
-endif
+libpthread_DIR:=$(top_srcdir)libpthread/linuxthreads
+libpthread_OUT:=$(top_builddir)libpthread/linuxthreads
-ARCH_DIR:=sysdeps/$(TARGET_ARCH)
--include $(srcdir)/$(ARCH_DIR)/Makefile.in
+ARCH_CFLAGS:=$(CFLAGS)
+-include $(libpthread_DIR)/sysdeps/$(TARGET_ARCH)/Makefile.in
+CFLAGS:=$(ARCH_CFLAGS)
-$(LIB_NAME)_ARCH_SRC:=$(wildcard $(srcdir)/$(ARCH_DIR)/*.c)
-$(LIB_NAME)_ARCH_OBJ:=$(patsubst $(srcdir)/$(ARCH_DIR)/%.c,$($(LIB_NAME)_DIR)/$(ARCH_DIR)/%.o,$($(LIB_NAME)_ARCH_SRC))
+libpthread_SRC:=$(wildcard $(libpthread_DIR)/*.c)
+ifneq ($(UCLIBC_HAS_XLOCALE),y)
+libpthread_SRC:=$(filter-out $(libpthread_DIR)/locale.c,$(libpthread_SRC))
+endif
# remove generic sources, if arch specific version is present
-$(LIB_NAME)_NO_SRC:=$(patsubst $(srcdir)/$(ARCH_DIR)/%.c,$(srcdir)/%.c,$($(LIB_NAME)_ARCH_SRC))
-$(LIB_NAME)_SRC:=$(filter-out $($(LIB_NAME)_NO_SRC),$($(LIB_NAME)_SRC))
-# add arch specific sources (assumed that these are not multi-sources)
-$(LIB_NAME)_SRC+=$($(LIB_NAME)_ARCH_SRC)
+ifneq ($(strip $(libpthread_ARCH_SRC)),)
+libpthread_SRC:=$(filter-out $(patsubst %.c,$(libpthread_DIR)/%.c,$(notdir $(libpthread_ARCH_SRC))),$(libpthread_SRC))
+endif
+
+libpthread_OBJ:=$(patsubst $(libpthread_DIR)/%.c,$(libpthread_OUT)/%.o,$(libpthread_SRC))
-$(LIB_NAME)_arch_clean:
- $(RM) $($(LIB_NAME)_DIR)/sysdeps/*/*.{o,os}
+libpthread-a-$(UCLIBC_HAS_THREADS)+=$(libpthread_OBJ)
+libpthread-a-pic-$(UCLIBC_HAS_THREADS)+=$(libpthread_OBJ:.o=.os)
+libpthread-so-$(UCLIBC_HAS_THREADS)+=$(libpthread_OBJ:.o=.os)
-libso-$(UCLIBC_HAS_THREADS)+=$(top_builddir)lib/$(LIB_NAME).so
-liba-$(UCLIBC_HAS_THREADS)+=$(top_builddir)lib/$(LIB_NAME).a
-libclean-y+=$(LIB_NAME)_clean $(LIB_NAME)_arch_clean
+libpthread-multi-$(UCLIBC_HAS_THREADS)+=$(libpthread_SRC)
-include $(top_srcdir)Makefile.libs
+lib-a-$(UCLIBC_HAS_THREADS)+=$(top_builddir)lib/libpthread.a
+lib-a-pic-$(UCLIBC_HAS_THREADS)+=$(top_builddir)lib/libpthread.a
+lib-so-$(UCLIBC_HAS_THREADS)+=$(top_builddir)lib/libpthread.so
diff --git a/libpthread/linuxthreads/sysdeps/sh64/Makefile.in b/libpthread/linuxthreads/sysdeps/sh64/Makefile.in
index fed7a83b7..5aa54a64f 100644
--- a/libpthread/linuxthreads/sysdeps/sh64/Makefile.in
+++ b/libpthread/linuxthreads/sysdeps/sh64/Makefile.in
@@ -1,20 +1,27 @@
# Makefile for uClibc's sh64 pthread backend
#
# Copyright (C) 2003 Paul Mundt <lethal@linux-sh.org>
+# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
#
-# This program is free software; you can redistribute it and/or modify it under
-# the terms of the GNU Library General Public License as published by the Free
-# Software Foundation; either version 2 of the License, or (at your option) any
-# later version.
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more
-# details.
-#
-# You should have received a copy of the GNU Library General Public License
-# along with this program; if not, write to the Free Software Foundation, Inc.,
-# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# We need to build as SHcompact for tas..
-ARCH_CFLAGS := $(subst 32media,compact,$(ARCH_CFLAGS))
+ARCH_CFLAGS:=$(subst 32media,compact,$(ARCH_CFLAGS))
+
+libpthread_ARCH_DIR:=$(top_srcdir)libpthread/linuxthreads/sysdeps/sh64
+libpthread_ARCH_OUT:=$(top_builddir)libpthread/linuxthreads/sysdeps/sh64
+
+libpthread_ARCH_SRC:=$(wildcard $(libpthread_ARCH_DIR)/*.c)
+libpthread_ARCH_OBJ:=$(patsubst $(libpthread_ARCH_DIR)/%.c,$(libpthread_ARCH_OUT)/%.o,$(libpthread_ARCH_SRC))
+
+libpthread-a-$(UCLIBC_HAS_THREADS)+=$(libpthread_ARCH_OBJ)
+libpthread-a-pic-$(UCLIBC_HAS_THREADS)+=$(libpthread_ARCH_OBJ:.o=.os)
+libpthread-so-$(UCLIBC_HAS_THREADS)+=$(libpthread_ARCH_OBJ:.o=.os)
+
+libpthread-multi-$(UCLIBC_HAS_THREADS)+=$(libpthread_ARCH_SRC)
+
+objclean-y+=libpthread_arch_objclean
+
+libpthread_arch_objclean:
+ $(RM) $(libpthread_ARCH_OUT)/*.{o,os}
diff --git a/libpthread/linuxthreads_db/Makefile.in b/libpthread/linuxthreads_db/Makefile.in
index 8a95e402a..18558089f 100644
--- a/libpthread/linuxthreads_db/Makefile.in
+++ b/libpthread/linuxthreads_db/Makefile.in
@@ -1,13 +1,15 @@
-# Makefile for uClibc's pthread library
+# Makefile for uClibc
#
-# Licensed under LGPL v2.1, see the file COPYING.LIB in this tarball for details.
+# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
+#
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
#CFLAGS+=$(SSP_ALL_CFLAGS)
PT_MAJOR_VERSION:=$(MAJOR_VERSION)
# Get the thread include dependencies and shared object name
-CFLAGS+=$(PTINC) -DLIBPTHREAD_SO="\"libpthread.so.$(PT_MAJOR_VERSION)\""
+CFLAGS+=-DLIBPTHREAD_SO="\"libpthread.so.$(PT_MAJOR_VERSION)\""
# Remove any -z defs since this lib will have undefined symbols
LDFLAGS:=$(subst -z defs,,$(LDFLAGS)) --warn-unresolved-symbols
@@ -16,13 +18,26 @@ ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
STRIP_FLAGS:=-X --strip-debug -R .note -R .comment
endif
+#DOMULTI=y
+
LIB_NAME:=libthread_db
-srcdir=$(top_srcdir)libpthread/linuxthreads_db
-$(LIB_NAME)_DIR:=$(top_builddir)libpthread/linuxthreads_db
+libthread_db_FULL_NAME:=$(LIB_NAME)-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so
+
MAJOR_VERSION:=1
-libso-$(PTHREADS_DEBUG_SUPPORT)+=$(top_builddir)lib/$(LIB_NAME).so
-liba-$(PTHREADS_DEBUG_SUPPORT)+=$(top_builddir)lib/$(LIB_NAME).a
-libclean-y+=$(LIB_NAME)_clean
+libthread_db_DIR:=$(top_srcdir)libpthread/linuxthreads_db
+libthread_db_OUT:=$(top_builddir)libpthread/linuxthreads_db
+
+libthread_db_SRC:=$(wildcard $(libthread_db_DIR)/*.c)
+
+libthread_db_OBJ:=$(patsubst $(libthread_db_DIR)/%.c,$(libthread_db_OUT)/%.o,$(libthread_db_SRC))
+
+libthread_db-a-$(PTHREADS_DEBUG_SUPPORT)+=$(libthread_db_OBJ)
+libthread_db-a-pic-$(PTHREADS_DEBUG_SUPPORT)+=$(libthread_db_OBJ:.o=.os)
+libthread_db-so-$(PTHREADS_DEBUG_SUPPORT)+=$(libthread_db_OBJ:.o=.os)
+
+libthread_db-multi-$(PTHREADS_DEBUG_SUPPORT)+=$(libthread_db_SRC)
-include $(top_srcdir)Makefile.libs
+lib-a-$(PTHREADS_DEBUG_SUPPORT)+=$(top_builddir)lib/libthread_db.a
+lib-a-pic-$(PTHREADS_DEBUG_SUPPORT)+=$(top_builddir)lib/libthread_db.a
+lib-so-$(PTHREADS_DEBUG_SUPPORT)+=$(top_builddir)lib/libthread_db.so