From d7cf4f24628f01a8eb6b355d661d48a6f4e77f59 Mon Sep 17 00:00:00 2001 From: "Gustavo J. A. M. Carneiro" Date: Sun, 25 Jan 2009 15:39:36 +0000 Subject: [PATCH] Don't use the flag -pthread on darwin to avoid warning message --- src/core/wscript | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/core/wscript b/src/core/wscript index 0ddc32a2e..990101824 100644 --- a/src/core/wscript +++ b/src/core/wscript @@ -1,6 +1,6 @@ ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- import sys - +import Options def configure(conf): if conf.check(header_name='stdlib.h'): @@ -11,9 +11,10 @@ def configure(conf): # Check for POSIX threads test_env = conf.env.copy() - test_env.append_value('LINKFLAGS', '-pthread') - test_env.append_value('CXXFLAGS', '-pthread') - test_env.append_value('CCFLAGS', '-pthread') + if Options.platform != 'darwin': + test_env.append_value('LINKFLAGS', '-pthread') + test_env.append_value('CXXFLAGS', '-pthread') + test_env.append_value('CCFLAGS', '-pthread') fragment = r""" #include int main () @@ -28,9 +29,11 @@ int main () errmsg='Could not find pthread support (build/config.log for details)', mandatory=False) if have_pthread: - conf.env['CXXFLAGS_PTHREAD'] = '-pthread' - conf.env['CCFLAGS_PTHREAD'] = '-pthread' - conf.env['LINKFLAGS_PTHREAD'] = '-pthread' + # darwin accepts -pthread but prints a warning saying it is ignored + if Options.platform != 'darwin': + conf.env['CXXFLAGS_PTHREAD'] = '-pthread' + conf.env['CCFLAGS_PTHREAD'] = '-pthread' + conf.env['LINKFLAGS_PTHREAD'] = '-pthread' conf.env['ENABLE_THREADING'] = have_pthread