diff --git a/common.gypi b/common.gypi index 3e4e0a5ac..31d6b6428 100644 --- a/common.gypi +++ b/common.gypi @@ -117,9 +117,8 @@ 'variables': { 'gcc_version%': ')', }, - 'cflags': [ '-Wall', '-pthread', ], + 'cflags': [ '-Wall' ], 'cflags_cc': [ '-fno-rtti', '-fno-exceptions' ], - 'ldflags': [ '-pthread', ], 'conditions': [ [ 'host_arch != target_arch and target_arch=="ia32"', { 'cflags': [ '-m32' ], @@ -128,6 +127,13 @@ [ 'OS=="linux"', { 'cflags': [ '-ansi' ], }], + [ 'OS=="solaris"', { + 'cflags': [ '-pthreads' ], + 'ldflags': [ '-pthreads' ], + }, { + 'cflags': [ '-pthread' ], + 'ldflags': [ '-pthread' ], + }], [ 'visibility=="hidden" and gcc_version >= "4.0.0"', { 'cflags': [ '-fvisibility=hidden' ], }], diff --git a/uv.gyp b/uv.gyp index b4ef01440..99a087a30 100644 --- a/uv.gyp +++ b/uv.gyp @@ -8,6 +8,15 @@ '_GNU_SOURCE', 'EIO_STACKSIZE=262144' ], + 'conditions': [ + ['OS=="solaris"', { + 'cflags': ['-pthreads'], + 'ldlags': ['-pthreads'], + }, { + 'cflags': ['-pthread'], + 'ldlags': ['-pthread'], + }], + ], }], ], }, @@ -313,11 +322,10 @@ 'libraries': [ 'ws2_32.lib' ] }, { # POSIX 'defines': [ '_GNU_SOURCE' ], - 'ldflags': [ '-pthread' ], 'sources': [ 'test/runner-unix.c', 'test/runner-unix.h', - ] + ], }], [ 'OS=="solaris"', { # make test-fs.c compile, needs _POSIX_C_SOURCE 'defines': [ @@ -365,7 +373,6 @@ 'libraries': [ 'ws2_32.lib' ] }, { # POSIX 'defines': [ '_GNU_SOURCE' ], - 'ldflags': [ '-pthread' ], 'sources': [ 'test/runner-unix.c', 'test/runner-unix.h',