wscript: check for pthread.h libpthread
authorPaul Brossier <piem@piem.org>
Mon, 28 Nov 2016 15:27:34 +0000 (16:27 +0100)
committerPaul Brossier <piem@piem.org>
Mon, 28 Nov 2016 15:27:34 +0000 (16:27 +0100)
src/wscript_build
wscript

index f159cf3..aab5449 100644 (file)
@@ -11,6 +11,7 @@ uselib += ['AVFORMAT']
 uselib += ['AVRESAMPLE']
 uselib += ['AVUTIL']
 uselib += ['BLAS']
+uselib += ['PTHREAD']
 
 source = ctx.path.ant_glob('*.c **/*.c')
 
diff --git a/wscript b/wscript
index 6b0e40a..f10f09a 100644 (file)
--- a/wscript
+++ b/wscript
@@ -123,6 +123,11 @@ def configure(ctx):
     ctx.check(header_name='getopt.h', mandatory = False)
     ctx.check(header_name='unistd.h', mandatory = False)
 
+    ctx.check(header_name='pthread.h', mandatory = False)
+    needs_pthread = ctx.get_define("HAVE_PTHREAD_H") is not None
+    if needs_pthread:
+        ctx.check_cc(lib="pthread", uselib_store="PTHREAD", mandatory=needs_pthread)
+
     target_platform = sys.platform
     if ctx.options.target_platform:
         target_platform = ctx.options.target_platform