[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gpsd-dev
Subject:    [gpsd-dev] [PATCH] Conditionalise -pthread option
From:       Matt <ukyg9e5r6k7gubiekd6 () yahoo ! com>
Date:       2014-08-30 17:53:28
Message-ID: 54020F98.20201 () yahoo ! com
[Download RAW message or body]

The version of gcc 4.9 in Cygwin doesn't understand '-pthread'.
So the attached patch conditionalises supplying that flag to the 
compiler using CheckCompilerOption.
No new compile/test/check problems seen under Linux, and it gets the 
compile a little further under cygwin.

["conditionalise-pthread.patch" (text/x-patch)]

diff --git a/SConstruct b/SConstruct
index 7c5b89f..0a23503 100644
--- a/SConstruct
+++ b/SConstruct
@@ -289,7 +289,6 @@ env.Append(CFLAGS='-D_GNU_SOURCE')
 
 # And we need some libraries
 env.MergeFlags("-lm")
-env.MergeFlags("-pthread")
 
 # DESTDIR environment variable means user wants to prefix the installation root.
 DESTDIR = os.environ.get('DESTDIR', '')
@@ -498,6 +497,9 @@ else:
                    '-Wstrict-prototypes', '-Wpointer-arith', '-Wreturn-type'):
         config.CheckCompilerOption(option)
 
+    if config.CheckCompilerOption("-pthread"):
+        env.MergeFlags("-pthread")
+
     env.Prepend(LIBPATH=[os.path.realpath(os.curdir)])
     if env["shared"] and env["chrpath"]:
         if WhereIs('chrpath'):


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic