summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile1
-rw-r--r--Rules.mak7
-rw-r--r--libc/inet/Makefile4
-rw-r--r--libc/inet/rpc/Makefile3
-rw-r--r--libc/misc/internals/Makefile4
-rw-r--r--libc/misc/pthread/Makefile12
-rw-r--r--libc/misc/syslog/Makefile4
-rw-r--r--libc/stdio/Makefile4
-rw-r--r--libc/stdlib/malloc-standard/Makefile6
-rw-r--r--libpthread/linuxthreads/Makefile12
-rw-r--r--libpthread/linuxthreads_db/Makefile9
11 files changed, 37 insertions, 29 deletions
diff --git a/Makefile b/Makefile
index 945c59558..b46518d0a 100644
--- a/Makefile
+++ b/Makefile
@@ -353,6 +353,7 @@ clean:
$(RM) include/fpu_control.h
$(MAKE) -C extra/locale clean
$(MAKE) -C ldso clean
+ $(MAKE) -C libc clean
$(MAKE) -C libpthread clean
$(MAKE) -C test clean
$(MAKE) -C utils clean
diff --git a/Rules.mak b/Rules.mak
index 7d864e392..d3399b296 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -303,6 +303,13 @@ else
LDFLAGS := $(LDFLAGS_NOSTRIP) -s
endif
+ifeq ($(UCLIBC_HAS_THREADS),y)
+# set up system dependencies include dirs (NOTE: order matters!)
+PTDIR := $(TOPDIR)libpthread/linuxthreads/
+PTINC := -I$(PTDIR)sysdeps/pthread \
+ -I$(PTDIR)sysdeps/$(TARGET_ARCH)
+endif
+
ifeq ($(UCLIBC_BUILD_RELRO),y)
LDFLAGS+=-z relro
endif
diff --git a/libc/inet/Makefile b/libc/inet/Makefile
index e7018db7c..6d59e1856 100644
--- a/libc/inet/Makefile
+++ b/libc/inet/Makefile
@@ -56,6 +56,10 @@ CSRC =getservice.c getproto.c hostid.c getnetent.c getnetbynm.c getnetbyad.c \
COBJS=$(patsubst %.c,%.o, $(CSRC))
+ifeq ($(UCLIBC_HAS_THREADS),y)
+CFLAGS += $(PTINC)
+endif
+
OBJS=$(MOBJ) $(MOBJ2) $(MOBJ3) $(COBJS)
OBJ_LIST=../obj.inet
diff --git a/libc/inet/rpc/Makefile b/libc/inet/rpc/Makefile
index 352e9a28b..a08cf89ea 100644
--- a/libc/inet/rpc/Makefile
+++ b/libc/inet/rpc/Makefile
@@ -23,7 +23,6 @@
TOPDIR=../../../
include $(TOPDIR)Rules.mak
-CFLAGS+=-I$(TOPDIR)libpthread/linuxthreads/sysdeps/pthread
ifeq ($(strip $(UCLIBC_HAS_FULL_RPC)),y)
CSRC :=auth_none.c auth_unix.c authunix_prot.c bindresvport.c \
@@ -58,7 +57,7 @@ $(OBJ_LIST): $(OBJS)
echo $(patsubst %, inet/rpc/%, $(OBJS)) > $(OBJ_LIST)
$(COBJS): %.o : %.c
- $(CC) $(CFLAGS) -c $< -o $@
+ $(CC) $(CFLAGS) $(PTINC) -c $< -o $@
$(STRIPTOOL) -x -R .note -R .comment $*.o
clean:
diff --git a/libc/misc/internals/Makefile b/libc/misc/internals/Makefile
index fee3eca70..1df05a934 100644
--- a/libc/misc/internals/Makefile
+++ b/libc/misc/internals/Makefile
@@ -31,6 +31,10 @@ __uClibc_main.o: CFLAGS += $(SSP_DISABLE_FLAGS)
OBJS=$(COBJS)
+ifeq ($(UCLIBC_HAS_THREADS),y)
+CFLAGS += $(PTINC)
+endif
+
OBJ_LIST=../../obj.misc.internals
all: $(OBJ_LIST) interp.o static.o
diff --git a/libc/misc/pthread/Makefile b/libc/misc/pthread/Makefile
index 0e432d308..e222e1442 100644
--- a/libc/misc/pthread/Makefile
+++ b/libc/misc/pthread/Makefile
@@ -19,16 +19,6 @@
TOPDIR=../../../
include $(TOPDIR)Rules.mak
-PTDIR = $(TOPDIR)libpthread/linuxthreads/
-SYSDEPINC = -I$(PTDIR)sysdeps/unix/sysv/linux \
- -I$(PTDIR)sysdeps/pthread \
- -I$(PTDIR)sysdeps/unix/sysv \
- -I$(PTDIR)sysdeps/unix/unix \
- -I$(PTDIR)sysdeps/$(TARGET_ARCH) \
- -I$(PTDIR)sysdeps \
- -I$(TOPDIR)libc/sysdeps/linux/$(TARGET_ARCH)
-CFLAGS += $(SYSDEPINC) -D_GNU_SOURCE
-
CSRC=no-tsd.c weaks.c
COBJS=$(patsubst %.c,%.o, $(CSRC))
OBJS=$(COBJS)
@@ -41,7 +31,7 @@ $(OBJ_LIST): $(OBJS)
echo $(patsubst %, misc/pthread/%, $(OBJS)) > $(OBJ_LIST)
$(COBJS): %.o : %.c
- $(CC) $(CFLAGS) -c $< -o $@
+ $(CC) $(CFLAGS) $(PTINC) -c $< -o $@
$(STRIPTOOL) -x -R .note -R .comment $*.o
clean:
diff --git a/libc/misc/syslog/Makefile b/libc/misc/syslog/Makefile
index 35e755e40..26239ab7b 100644
--- a/libc/misc/syslog/Makefile
+++ b/libc/misc/syslog/Makefile
@@ -28,6 +28,10 @@ CSRC=syslog.c
COBJS=$(patsubst %.c,%.o, $(CSRC))
OBJS=$(COBJS)
+ifeq ($(UCLIBC_HAS_THREADS),y)
+CFLAGS += $(PTINC)
+endif
+
OBJ_LIST=../../obj.misc.syslog
all: $(OBJ_LIST)
diff --git a/libc/stdio/Makefile b/libc/stdio/Makefile
index b737410d9..91a011eed 100644
--- a/libc/stdio/Makefile
+++ b/libc/stdio/Makefile
@@ -116,6 +116,10 @@ ifeq ($(strip $(UCLIBC_HAS_LFS)),y)
OBJS += $(CLOBJS)
endif
+ifeq ($(UCLIBC_HAS_THREADS),y)
+CFLAGS += $(PTINC)
+endif
+
OBJ_LIST=../obj.stdio
all: $(OBJ_LIST)
diff --git a/libc/stdlib/malloc-standard/Makefile b/libc/stdlib/malloc-standard/Makefile
index 0af06b3ff..331feae20 100644
--- a/libc/stdlib/malloc-standard/Makefile
+++ b/libc/stdlib/malloc-standard/Makefile
@@ -32,9 +32,15 @@ endif
# calloc.c can be found at uClibc/libc/stdlib/calloc.c
# valloc.c can be found at uClibc/libc/stdlib/valloc.c
CSRC=malloc.c calloc.c realloc.c free.c memalign.c mallopt.c mallinfo.c
+
COBJS=$(patsubst %.c,%.o, $(CSRC))
+
OBJS=$(COBJS)
+ifeq ($(UCLIBC_HAS_THREADS),y)
+CFLAGS += $(PTINC)
+endif
+
OBJ_LIST=../../obj.stdlib.malloc-standard
all: $(OBJ_LIST)
diff --git a/libpthread/linuxthreads/Makefile b/libpthread/linuxthreads/Makefile
index 4072d660f..d5637eccf 100644
--- a/libpthread/linuxthreads/Makefile
+++ b/libpthread/linuxthreads/Makefile
@@ -22,17 +22,11 @@ include $(TOPDIR)Rules.mak
CFLAGS+=$(SSP_ALL_CFLAGS)
-#This stuff will not compile without at least -O1
+# This stuff will not compile without at least -O1
CFLAGS :=$(CFLAGS:-O0=-O1)
-# set up system dependencies include dirs (NOTE: order matters!)
-# psm: don't think that the last include makes sense
-# they all should be already linked to $(TOPDIR)include
-PTDIR = $(TOPDIR)libpthread/linuxthreads/
-SYSDEPINC = -I$(PTDIR)sysdeps/pthread \
- -I$(PTDIR)sysdeps/$(TARGET_ARCH) \
- -I$(TOPDIR)libc/sysdeps/linux/$(TARGET_ARCH)
-CFLAGS += $(SYSDEPINC)
+# Get the thread include dependencies
+CFLAGS += $(PTINC)
ARCH_CFLAGS = $(CFLAGS)
diff --git a/libpthread/linuxthreads_db/Makefile b/libpthread/linuxthreads_db/Makefile
index 2c27cdccc..3c7ee91a7 100644
--- a/libpthread/linuxthreads_db/Makefile
+++ b/libpthread/linuxthreads_db/Makefile
@@ -26,13 +26,8 @@ AR_LIB_NAME=$(TOPDIR)lib/$(LIB_NAME).a
SO_LIB_NAME=$(TOPDIR)lib/$(LIB_NAME).so
SO_FULL_NAME=$(LIB_NAME)-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so
-# set up system dependencies include dirs (NOTE: order matters!)
-PTDIR = $(TOPDIR)libpthread/linuxthreads/
-SYSDEPINC = -I$(PTDIR)sysdeps/pthread \
- -I$(PTDIR)sysdeps/$(TARGET_ARCH) \
- -I$(TOPDIR)libc/sysdeps/linux/$(TARGET_ARCH)
-
-CFLAGS += $(SYSDEPINC) -DLIBPTHREAD_SO="\"libpthread.so.$(MAJOR_VERSION)\""
+# Get the thread include dependencies and shared object name
+CFLAGS += $(PTINC) -DLIBPTHREAD_SO="\"libpthread.so.$(MAJOR_VERSION)\""
# Remove any -z defs since this lib will have undefined symbols
LDFLAGS := $(subst -z defs,,$(LDFLAGS)) --warn-unresolved-symbols