summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2019-09-18 14:38:47 +0200
committerJoerg Bornemann <joerg.bornemann@qt.io>2019-09-18 20:46:20 +0200
commit02759551f6f5aa0f365fecc4d880901e42908675 (patch)
tree472b10545cdde00a3849a6acc3ae754dd03dfcd3
parent0c52ea31c485043ea66e999790a592730196d963 (diff)
Fix and re-work compile tests
The compile tests were seriously broken, and we didn't notice, because configure leniently ignores the second level "test" object and the inline sources provide the absolute path. Merge the 2nd level test objects with the right ones. Remove superfluous label entries. Remove superfluous qmake entries. The inline sources already provide the right -l argument. Remove superfluous return statements. The generated main function already returns 0. Remove superfluous "type" entry, because "compile" is the default anyways. Note that the jasper version test is bogus, because these are compile tests that are not actually executed. The reference to JAS_VERSION is kept to test for existence of this define. Fixes: QTBUG-78473 Change-Id: I1d4fa634e29329cfc34c0a2f78b2eb730ef84d50 Reviewed-by: Liang Qi <liang.qi@qt.io>
-rw-r--r--src/imageformats/configure.json156
1 files changed, 59 insertions, 97 deletions
diff --git a/src/imageformats/configure.json b/src/imageformats/configure.json
index 7c6eaef..4724d86 100644
--- a/src/imageformats/configure.json
+++ b/src/imageformats/configure.json
@@ -16,133 +16,95 @@
"libraries": {
"jasper": {
- "label": "jasper",
+ "headers": "jasper/jasper.h",
"test": {
- "label": "Jasper(header in /usr/include)",
- "type": "compile",
- "test": {
- "include": [
- "string.h",
- "jasper/jasper.h"
- ],
- "qmake": [
- "msvc: LIBS += libjasper.lib",
- "else: LIBS += -ljasper"
- ],
- "main": [
- "// This version of Jasper is broken, according to the old Qt Solutions docs",
- "if (strcmp(JAS_VERSION, \"1.900.0\") == 0)",
- " return 1;",
- "return 0;"
- ]
- }
+ "include": [
+ "string.h",
+ "jasper/jasper.h"
+ ],
+ "main": [
+ "// This version of Jasper is broken, according to the old Qt Solutions docs",
+ "if (strcmp(JAS_VERSION, \"1.900.0\") == 0)",
+ " return 1;"
+ ]
},
"sources": [
"-ljasper"
]
},
"mng": {
- "label": "mng",
+ "headers": "libmng.h",
"test": {
- "label": "MNG(header in /usr/include)",
- "type": "compile",
- "test": {
- "include": [
- "stdio.h",
- "libmng.h"
- ],
- "qmake": [
- "LIBS += -lmng"
- ],
- "main": [
- "mng_handle hMNG;",
- "mng_cleanup(&hMNG);",
+ "include": [
+ "stdio.h",
+ "libmng.h"
+ ],
+ "main": [
+ "mng_handle hMNG;",
+ "mng_cleanup(&hMNG);",
"#if defined(MNG_VERSION_MAJOR)",
"#if MNG_VERSION_MAJOR < 1 || (MNG_VERSION_MAJOR == 1 && MNG_VERSION_MINOR == 0 && MNG_VERSION_RELEASE < 9)",
"#error System libmng version is less than 1.0.9",
"#endif",
- "#endif",
- "return 0;"
- ]
- }
+ "#endif"
+ ]
},
"sources": [
"-lmng"
]
},
"tiff": {
- "label": "tiff",
+ "headers": "tiffio.h",
"test": {
- "label": "TIFF(header in /usr/include)",
- "type": "compile",
- "test": {
- "include": "tiffio.h",
- "qmake": [
- "unix|mingw: LIBS += -ltiff",
- "else:win32: LIBS += libtiff.lib"
- ],
- "main": [
- "#if !defined(TIFF_VERSION) && defined(TIFF_VERSION_CLASSIC)",
- "// libtiff 4.0 splits it into TIFF_VERSION_CLASSIC and TIFF_VERSION_BIG",
- "# define TIFF_VERSION TIFF_VERSION_CLASSIC",
- "#endif",
-
- "#if !defined(TIFF_VERSION)",
- "# error \"Required libtiff not found\"",
- "#elif TIFF_VERSION < 42",
- "# error \"unsupported tiff version\"",
- "#endif",
+ "main": [
+ "#if !defined(TIFF_VERSION) && defined(TIFF_VERSION_CLASSIC)",
+ "// libtiff 4.0 splits it into TIFF_VERSION_CLASSIC and TIFF_VERSION_BIG",
+ "# define TIFF_VERSION TIFF_VERSION_CLASSIC",
+ "#endif",
- "tdata_t buffer = _TIFFmalloc(128);",
- "_TIFFfree(buffer);",
+ "#if !defined(TIFF_VERSION)",
+ "# error \"Required libtiff not found\"",
+ "#elif TIFF_VERSION < 42",
+ "# error \"unsupported tiff version\"",
+ "#endif",
- "// some libtiff implementations where TIFF_VERSION >= 42 do not",
- "// have TIFFReadRGBAImageOriented(), so let's check for it",
- "TIFFReadRGBAImageOriented(0, 0, 0, 0, 0, 0);",
+ "tdata_t buffer = _TIFFmalloc(128);",
+ "_TIFFfree(buffer);",
- "return 0;"
- ]
- }
+ "// some libtiff implementations where TIFF_VERSION >= 42 do not",
+ "// have TIFFReadRGBAImageOriented(), so let's check for it",
+ "TIFFReadRGBAImageOriented(0, 0, 0, 0, 0, 0);"
+ ]
},
"sources": [
"-ltiff"
]
},
"webp": {
- "label": "webp",
+ "headers": [
+ "webp/decode.h",
+ "webp/encode.h",
+ "webp/demux.h",
+ "webp/mux.h"
+ ],
"test": {
- "label": "WebP(header in /usr/include)",
- "type": "compile",
- "test": {
- "include": [
- "webp/decode.h",
- "webp/encode.h",
- "webp/demux.h",
- "webp/mux.h"
- ],
- "qmake": [
- "LIBS += -lwebp -lwebpdemux -lwebpmux"
- ],
- "main": [
- "#if WEBP_ABI_IS_INCOMPATIBLE(WEBP_DECODER_ABI_VERSION, 0x0203) || WEBP_ABI_IS_INCOMPATIBLE(WEBP_ENCODER_ABI_VERSION, 0x0202)",
- "#error \"Incompatible libwebp version\"",
- "#endif",
-
- "WebPDecoderConfig config;",
- "WebPDecBuffer *output_buffer = &config.output;",
- "WebPBitstreamFeatures *bitstream = &config.input;",
- "WebPPicture picture;",
- "picture.use_argb = 0;",
- "WebPConfig config2;",
- "config2.lossless = 0;",
- "WebPData data = {};",
- "WebPDemuxer *demuxer = WebPDemux(&data);",
- "WebPIterator iter;",
- "iter.frame_num = 0;",
+ "main": [
+ "#if WEBP_ABI_IS_INCOMPATIBLE(WEBP_DECODER_ABI_VERSION, 0x0203) || WEBP_ABI_IS_INCOMPATIBLE(WEBP_ENCODER_ABI_VERSION, 0x0202)",
+ "#error \"Incompatible libwebp version\"",
+ "#endif",
- "return 0;"
- ]
- }
+ "WebPDecoderConfig config;",
+ "WebPDecBuffer *output_buffer = &config.output;",
+ "WebPBitstreamFeatures *bitstream = &config.input;",
+ "WebPPicture picture;",
+ "picture.use_argb = 0;",
+ "WebPConfig config2;",
+ "config2.lossless = 0;",
+ "WebPData data = {};",
+ "WebPDemuxer *demuxer = WebPDemux(&data);",
+ "WebPIterator iter;",
+ "iter.frame_num = 0;"
+ ]
},
"sources": [
"-lwebp -lwebpdemux -lwebpmux"