summaryrefslogtreecommitdiff
path: root/shared
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2016-02-16 01:57:51 +0000
committerBryce Harrington <bryce@osg.samsung.com>2016-02-19 18:33:00 -0800
commit58b7a156c5cddc11fe5a5e3f982d65d433a9177a (patch)
treed04de5005460e815e2492a65660972be2d52331f /shared
parente1719c789185d4a70964ad76da5a924d688cf798 (diff)
configure: Make WebP support togglable, and improve its error message.
The current way was enabling WebP support whenever libwebp was found, giving no way to the user to disable it if they had the library installed but didn’t want to link against it. This adds a --without-webp configure option to never link against it, and a --with-webp one to fail the build if it isn’t found, the default being to use it if it is present. Additionally, we now tell the user when WebP support has been disabled and they try to load a WebP file. Signed-off-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Diffstat (limited to 'shared')
-rw-r--r--shared/image-loader.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/shared/image-loader.c b/shared/image-loader.c
index ec75bd4f..050f0677 100644
--- a/shared/image-loader.c
+++ b/shared/image-loader.c
@@ -352,6 +352,15 @@ load_webp(FILE *fp)
config.output.u.RGBA.stride);
}
+#else
+
+static pixman_image_t *
+load_webp(FILE *fp)
+{
+ fprintf(stderr, "WebP support disabled at compile-time\n");
+ return NULL;
+}
+
#endif
@@ -364,9 +373,7 @@ struct image_loader {
static const struct image_loader loaders[] = {
{ { 0x89, 'P', 'N', 'G' }, 4, load_png },
{ { 0xff, 0xd8 }, 2, load_jpeg },
-#ifdef HAVE_WEBP
{ { 'R', 'I', 'F', 'F' }, 4, load_webp }
-#endif
};
pixman_image_t *