From a46766a37068d7f0454c201dffa50166ac059916 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Sat, 28 Feb 2009 13:24:57 +0100 Subject: thread flags for linux/gcc --- makefiles/gmake/compiler.mk | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'makefiles') diff --git a/makefiles/gmake/compiler.mk b/makefiles/gmake/compiler.mk index a84e74d..c0f6799 100644 --- a/makefiles/gmake/compiler.mk +++ b/makefiles/gmake/compiler.mk @@ -38,7 +38,7 @@ GCC_MINOR_VERSION = $(shell $(TOPDIR)/makefiles/gmake/guess_env --gcc-minor-vers # compilation flags and compilers COMMON_COMPILE_FLAGS = \ - -g -D_REENTRANT -pthread \ + -g \ -fstrict-aliasing \ -pedantic -Wall -Werror \ -Wunused -Wno-import \ @@ -192,11 +192,25 @@ endif # end of spro section -CFLAGS = $(COMPILE_FLAGS) $(PLATFORM_COMPILE_FLAGS) $(INCLUDE_DIRS) -CCPPFLAGS = $(CCPP_COMPILE_FLAGS) $(PLATFORM_COMPILE_FLAGS) $(INCLUDE_DIRS) +# set flags for threading support using POSIX threads. This is completly different +# between compiler/platforms +ifeq "$(COMPILER)" "gcc" +ifeq "$(PLATFORM)" "LINUX" +PTHREADS_CFLAGS = -D_REENTRANT -pthread +PTHREADS_LDFLAGS = +PTHREADS_LIBS = +else +PTHREADS_CFLAGS = +PTHREADS_LDFLAGS = +PTHREADS_LIBS = +endif +endif + +CFLAGS = $(COMPILE_FLAGS) $(PLATFORM_COMPILE_FLAGS) $(INCLUDE_DIRS) $(PTHREADS_CFLAGS) +CCPPFLAGS = $(CCPP_COMPILE_FLAGS) $(PLATFORM_COMPILE_FLAGS) $(INCLUDE_DIRS) ($PTHREADS_CFLAGS) -LDFLAGS = -pthread $(INCLUDE_LDFLAGS) -LIBS = $(INCLUDE_LIBS) +LDFLAGS = $(INCLUDE_LDFLAGS) $(PTHREADS_LDFLAGS) +LIBS = $(INCLUDE_LIBS) $(PTHREADS_LIBS) LINK = $(CC) CCPP_LINK = $(CCPP) -- cgit v1.2.3-54-g00ecf