summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2015-12-02 15:07:33 +0100
committerRobin Gareus <robin@gareus.org>2015-12-02 15:07:33 +0100
commit4245f2a02b15ea787f3713fb5065fc5527788c44 (patch)
tree2b247e351114a7f93afdcf26e01d3523969a3de2
parent14d6470ad36a1682966ff93e774849901055a916 (diff)
fix pthread-windows semaphore detection
-rw-r--r--wscript16
1 files changed, 14 insertions, 2 deletions
diff --git a/wscript b/wscript
index 041b12ecba..d28739a134 100644
--- a/wscript
+++ b/wscript
@@ -963,8 +963,20 @@ int main () { int x = SFC_RF64_AUTO_DOWNGRADE; return 0; }
conf.env.append_value('CXXFLAGS', '-DUSE_CAIRO_IMAGE_SURFACE')
conf.define ('WINDOWS', 1)
- if os.path.isfile (user_gtk_root + 'include/semaphore.h'):
- conf.define ('USE_PTW32_SEMAPHORE', 1)
+ have_ptw_semaphore = conf.check_cc(fragment = '''
+#include <pthread.h>
+#include <semaphore.h>
+int main () { return 0; }
+''',
+ features = 'c',
+ mandatory = False,
+ execute = False,
+ msg = 'Checking for pthread posix semaphore',
+ okmsg = 'Found',
+ errmsg = 'Not found, falling back to Windows Semaphore.')
+
+ if have_ptw_semaphore:
+ conf.define('USE_PTW32_SEMAPHORE', 1)
conf.env.append_value('CFLAGS', '-DUSE_PTW32_SEMAPHORE')
conf.env.append_value('CXXFLAGS', '-DUSE_PTW32_SEMAPHORE')