diff --git a/configure.ac b/configure.ac index c31adf88..09405636 100644 --- a/configure.ac +++ b/configure.ac @@ -187,6 +187,8 @@ if test "$glut_headers" = "yes"; then glutMainLoop(); ]) ], + AC_DEFINE(WEBP_HAVE_GL, [1], + [Set to 1 if OpenGL is supported]) [glut_support=yes], [] ) if test "$glut_support" = "yes"; then @@ -296,6 +298,8 @@ LIBCHECK_PROLOGUE([GIF]) AC_CHECK_HEADER(gif_lib.h, AC_CHECK_LIB([gif], [DGifOpenFileHandle], [GIF_LIBS="$GIF_LIBS -lgif" + AC_DEFINE(WEBP_HAVE_GIF, [1], + [Set to 1 if GIF library is installed]) gif_support=yes ], AC_MSG_WARN(Optional gif library not found), @@ -443,7 +447,8 @@ dwebp : yes ===================== PNG : ${png_support-no} WIC : ${wic_support-no} -gif2webp : ${build_gif2webp-no} -webpmux : ${enable_libwebpmux-no} -vwebp : ${build_vwebp-no} +GIF support : ${gif_support-no} +gif2webp : ${build_gif2webp-no} +webpmux : ${enable_libwebpmux-no} +vwebp : ${build_vwebp-no} ]) diff --git a/examples/gif2webp.c b/examples/gif2webp.c index 1dbb8c7c..2f9b1e65 100644 --- a/examples/gif2webp.c +++ b/examples/gif2webp.c @@ -20,6 +20,8 @@ #include "config.h" #endif +#ifdef WEBP_HAVE_GIF + #include #include "webp/encode.h" #include "webp/mux.h" @@ -636,4 +638,14 @@ int main(int argc, const char *argv[]) { return !ok; } +#else // !WEBP_HAVE_GIF + +int main(int argc, const char *argv[]) { + fprintf(stderr, "GIF support not enabled in %s.\n", argv[0]); + (void)argc; + return 0; +} + +#endif + //------------------------------------------------------------------------------ diff --git a/examples/vwebp.c b/examples/vwebp.c index 3ff3f489..b0f0771d 100644 --- a/examples/vwebp.c +++ b/examples/vwebp.c @@ -18,6 +18,8 @@ #include #include +#if defined(WEBP_HAVE_GL) + #if defined(HAVE_GLUT_GLUT_H) #include #else @@ -514,4 +516,14 @@ int main(int argc, char *argv[]) { return -1; } +#else // !WEBP_HAVE_GL + +int main(int argc, const char *argv[]) { + fprintf(stderr, "OpenGL support not enabled in %s.\n", argv[0]); + (void)argc; + return 0; +} + +#endif + //------------------------------------------------------------------------------ diff --git a/makefile.unix b/makefile.unix index 9d838612..c47c8474 100644 --- a/makefile.unix +++ b/makefile.unix @@ -245,9 +245,11 @@ examples/dwebp: EXTRA_LIBS += $(DWEBP_LIBS) examples/gif2webp: examples/libexample_util.a examples/libgif2webp_util.a examples/gif2webp: src/mux/libwebpmux.a src/libwebp.a examples/gif2webp: EXTRA_LIBS += $(GIF_LIBS) +examples/gif2webp: EXTRA_FLAGS += -DWEBP_HAVE_GIF examples/vwebp: examples/libexample_util.a src/demux/libwebpdemux.a examples/vwebp: src/libwebp.a examples/vwebp: EXTRA_LIBS += $(GL_LIBS) +examples/vwebp: EXTRA_FLAGS += -DWEBP_HAVE_GL examples/webpmux: examples/libexample_util.a src/mux/libwebpmux.a examples/webpmux: src/libwebpdecoder.a