OSDN Git Service

Clean up pthread include mess. Some of these will be needed to support NPTL, but...
author"Steven J. Hill" <sjhill@realitydiluted.com>
Tue, 4 Oct 2005 00:29:14 +0000 (00:29 -0000)
committer"Steven J. Hill" <sjhill@realitydiluted.com>
Tue, 4 Oct 2005 00:29:14 +0000 (00:29 -0000)
Makefile
Rules.mak
libc/inet/Makefile
libc/inet/rpc/Makefile
libc/misc/internals/Makefile
libc/misc/pthread/Makefile
libc/misc/syslog/Makefile
libc/stdio/Makefile
libc/stdlib/malloc-standard/Makefile
libpthread/linuxthreads/Makefile
libpthread/linuxthreads_db/Makefile

index 945c595..b46518d 100644 (file)
--- 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
index 7d864e3..d3399b2 100644 (file)
--- 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
index e7018db..6d59e18 100644 (file)
@@ -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
index 352e9a2..a08cf89 100644 (file)
@@ -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:
index fee3eca..1df05a9 100644 (file)
@@ -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
index 0e432d3..e222e14 100644 (file)
 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:
index 35e755e..26239ab 100644 (file)
@@ -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)
index b737410..91a011e 100644 (file)
@@ -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)
index 0af06b3..331feae 100644 (file)
@@ -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)
index 4072d66..d5637ec 100644 (file)
@@ -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)
 
index 2c27cdc..3c7ee91 100644 (file)
@@ -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