Fix colour range in XYZ -> RGBA.
[libdcp.git] / wscript
diff --git a/wscript b/wscript
index 229efa7bf37609fc7d573ce98252a5c220295698..5026eeec690c56516613de157608d4f7f6e505ec 100644 (file)
--- a/wscript
+++ b/wscript
@@ -1,3 +1,21 @@
+#
+#    Copyright (C) 2012-2016 Carl Hetherington <cth@carlh.net>
+#
+#    This program is free software; you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or
+#    (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU General Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License
+#    along with this program; if not, write to the Free Software
+#    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+
 import subprocess
 import os
 import sys
@@ -36,8 +54,8 @@ def configure(conf):
     else:
         conf.env.append_value('CXXFLAGS', '-DLIBDCP_POSIX')
 
-    if not conf.env.TARGET_OSX:
-        conf.env.append_value('CXXFLAGS', ['-Wno-unused-result', '-Wno-unused-parameter'])
+    if conf.env.TARGET_OSX:
+        conf.env.append_value('CXXFLAGS', ['-Wno-unused-result', '-Wno-unused-parameter', '-Wno-unused-local-typedef'])
 
     if conf.options.enable_openmp:
         conf.env.append_value('CXXFLAGS', '-fopenmp')
@@ -61,20 +79,12 @@ def configure(conf):
     conf.check_cfg(package='sndfile', args='--cflags --libs', uselib_store='SNDFILE', mandatory=False)
 
     if conf.options.static:
-        conf.check_cc(fragment="""
-                     #include <stdio.h>\n
-                     #include <openjpeg.h>\n
-                     int main () {\n
-                     void* p = (void *) opj_image_create;\n
-                     return 0;\n
-                     }
-                     """,
-                       msg='Checking for library openjpeg', stlib='openjpeg', uselib_store='OPENJPEG', mandatory=True)
-
+        conf.check_cfg(package='libopenjp2', args='--cflags', atleast_version='2.1.0', uselib_store='OPENJPEG', mandatory=True)
+        conf.env.STLIB_OPENJPEG = ['openjp2']
         conf.env.HAVE_CXML = 1
         conf.env.STLIB_CXML = ['cxml']
     else:
-        conf.check_cfg(package='libopenjpeg', args='--cflags --libs', uselib_store='OPENJPEG', mandatory=True)
+        conf.check_cfg(package='libopenjp2', args='--cflags --libs', atleast_version='2.1.0', uselib_store='OPENJPEG', mandatory=True)
         conf.check_cfg(package='libcxml', atleast_version='0.14.0', args='--cflags --libs', uselib_store='CXML', mandatory=True)
 
     if conf.options.target_windows: