Tidy up openjpeg configuration, and insist on 1.5.0 or 1.5.1 (#38).
authorCarl Hetherington <cth@carlh.net>
Fri, 25 Jan 2013 12:24:22 +0000 (12:24 +0000)
committerCarl Hetherington <cth@carlh.net>
Fri, 25 Jan 2013 12:24:22 +0000 (12:24 +0000)
wscript

diff --git a/wscript b/wscript
index f392ee67ff54130fddd2b993dd215ec813bdca67..9acb61262e053880d75941307821a9b0624226de 100644 (file)
--- a/wscript
+++ b/wscript
@@ -91,19 +91,19 @@ def configure(conf):
     conf.check_cfg(package = 'glib-2.0', args = '--cflags --libs', uselib_store = 'GLIB', mandatory = True)
     conf.check_cfg(package = '', path = 'Magick++-config', args = '--cppflags --cxxflags --libs', uselib_store = 'MAGICK', mandatory = True)
 
-    openjpeg_fragment = """
+    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
                        }
-                       """
-
-    if conf.options.static:
-        conf.check_cc(fragment = openjpeg_fragment, msg = 'Checking for library openjpeg', stlib = 'openjpeg', uselib_store = 'OPENJPEG')
+                       """, msg = 'Checking for library openjpeg', stlib = 'openjpeg', uselib_store = 'OPENJPEG')
     else:
-        conf.check_cfg(package = 'libopenjpeg', args = '--cflags --libs', uselib_store = 'OPENJPEG', mandatory = True)
+        # Only 1.5.0 and 1.5.1 have been tested.
+        conf.check_cfg(package = 'libopenjpeg', args = '--cflags --libs', atleast_version = '1.5.0', uselib_store = 'OPENJPEG', mandatory = True)
+        conf.check_cfg(package = 'libopenjpeg', args = '--cflags --libs', max_version = '1.5.1', mandatory = True)
 
     conf.check_cc(fragment  = """
                               #include <libssh/libssh.h>\n