From 9df23dddc2bc2260337021a8e7501a5ec46fdabc Mon Sep 17 00:00:00 2001 From: James Zern Date: Sat, 3 Jul 2021 15:37:48 -0700 Subject: [PATCH 1/3] configure: move lib flag checks before binaries this ensures the defaults are set properly before testing conditions for enabling certain binaries. previously anim_diff would need --enable-libwebpdemux to be explicitly added though it defaults to enabled. Bug: webp:501 Change-Id: Ifac68eac7096b39e98d0025e07a37b0be3d32c0a --- configure.ac | 66 ++++++++++++++++++++++++++-------------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/configure.ac b/configure.ac index 35d37483..ce7522e2 100644 --- a/configure.ac +++ b/configure.ac @@ -32,6 +32,39 @@ AC_ARG_ENABLE([everything], SET_IF_UNSET([enable_libwebpextras], [$enableval]) SET_IF_UNSET([enable_libwebpmux], [$enableval])]) +dnl === Check whether libwebpmux should be built +AC_MSG_CHECKING(whether libwebpmux is to be built) +AC_ARG_ENABLE([libwebpmux], + AS_HELP_STRING([--enable-libwebpmux], + [Build libwebpmux @<:@default=no@:>@])) +AC_MSG_RESULT(${enable_libwebpmux-no}) +AM_CONDITIONAL([BUILD_MUX], [test "$enable_libwebpmux" = "yes"]) + +dnl === Check whether libwebpdemux should be built +AC_MSG_CHECKING(whether libwebpdemux is to be built) +AC_ARG_ENABLE([libwebpdemux], + AS_HELP_STRING([--disable-libwebpdemux], + [Disable libwebpdemux @<:@default=no@:>@]), + [], [enable_libwebpdemux=yes]) +AC_MSG_RESULT(${enable_libwebpdemux-no}) +AM_CONDITIONAL([BUILD_DEMUX], [test "$enable_libwebpdemux" = "yes"]) + +dnl === Check whether decoder library should be built. +AC_MSG_CHECKING(whether decoder library is to be built) +AC_ARG_ENABLE([libwebpdecoder], + AS_HELP_STRING([--enable-libwebpdecoder], + [Build libwebpdecoder @<:@default=no@:>@])) +AC_MSG_RESULT(${enable_libwebpdecoder-no}) +AM_CONDITIONAL([BUILD_LIBWEBPDECODER], [test "$enable_libwebpdecoder" = "yes"]) + +dnl === Check whether libwebpextras should be built +AC_MSG_CHECKING(whether libwebpextras is to be built) +AC_ARG_ENABLE([libwebpextras], + AS_HELP_STRING([--enable-libwebpextras], + [Build libwebpextras @<:@default=no@:>@])) +AC_MSG_RESULT(${enable_libwebpextras-no}) +AM_CONDITIONAL([BUILD_EXTRAS], [test "$enable_libwebpextras" = "yes"]) + dnl === If --enable-asserts is not defined, define NDEBUG AC_MSG_CHECKING(whether asserts are enabled) @@ -692,39 +725,6 @@ else AC_MSG_RESULT([no]) fi -dnl === Check whether libwebpmux should be built -AC_MSG_CHECKING(whether libwebpmux is to be built) -AC_ARG_ENABLE([libwebpmux], - AS_HELP_STRING([--enable-libwebpmux], - [Build libwebpmux @<:@default=no@:>@])) -AC_MSG_RESULT(${enable_libwebpmux-no}) -AM_CONDITIONAL([BUILD_MUX], [test "$enable_libwebpmux" = "yes"]) - -dnl === Check whether libwebpdemux should be built -AC_MSG_CHECKING(whether libwebpdemux is to be built) -AC_ARG_ENABLE([libwebpdemux], - AS_HELP_STRING([--disable-libwebpdemux], - [Disable libwebpdemux @<:@default=no@:>@]), - [], [enable_libwebpdemux=yes]) -AC_MSG_RESULT(${enable_libwebpdemux-no}) -AM_CONDITIONAL([BUILD_DEMUX], [test "$enable_libwebpdemux" = "yes"]) - -dnl === Check whether decoder library should be built. -AC_MSG_CHECKING(whether decoder library is to be built) -AC_ARG_ENABLE([libwebpdecoder], - AS_HELP_STRING([--enable-libwebpdecoder], - [Build libwebpdecoder @<:@default=no@:>@])) -AC_MSG_RESULT(${enable_libwebpdecoder-no}) -AM_CONDITIONAL([BUILD_LIBWEBPDECODER], [test "$enable_libwebpdecoder" = "yes"]) - -dnl === Check whether libwebpextras should be built -AC_MSG_CHECKING(whether libwebpextras is to be built) -AC_ARG_ENABLE([libwebpextras], - AS_HELP_STRING([--enable-libwebpextras], - [Build libwebpextras @<:@default=no@:>@])) -AC_MSG_RESULT(${enable_libwebpextras-no}) -AM_CONDITIONAL([BUILD_EXTRAS], [test "$enable_libwebpextras" = "yes"]) - dnl ========================= AC_CONFIG_MACRO_DIR([m4]) From dc7e2b42e75a6256700938bff5a9eeb2cf44734e Mon Sep 17 00:00:00 2001 From: James Zern Date: Sat, 3 Jul 2021 15:51:23 -0700 Subject: [PATCH 2/3] configure: add informational notices when disabling binaries this better documents the requirements for some of the examples. Bug: webp:501 Change-Id: If20675e71ebf2c1d9bb51d65a05fd4e9f339ac5a --- configure.ac | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index ce7522e2..1739238e 100644 --- a/configure.ac +++ b/configure.ac @@ -442,6 +442,10 @@ AS_IF([test "x$enable_gl" != "xno"], [ if test "$glut_support" = "yes" -a "$enable_libwebpdemux" = "yes"; then build_vwebp=yes + else + AC_MSG_NOTICE( + m4_normalize([Not building vwebp. + OpenGL libraries and --enable-libwebpdemux are required.])) fi ]) AM_CONDITIONAL([BUILD_VWEBP], [test "$build_vwebp" = "yes"]) @@ -501,7 +505,7 @@ AS_IF([test "x$enable_sdl" != "xno"], [ if test x"$sdl_support" = "xyes"; then build_vwebp_sdl=yes else - AC_MSG_WARN(Optional SDL library not found) + AC_MSG_NOTICE([Not building vwebp-sdl. SDL library is required.]) fi ]) @@ -625,11 +629,17 @@ AS_IF([test "x$enable_gif" != "xno"], [ if test "$gif_support" = "yes" -a \ "$enable_libwebpdemux" = "yes"; then build_anim_diff=yes + else + AC_MSG_NOTICE( + [Not building anim_diff. libgif and --enable-libwebpdemux are required.]) fi if test "$gif_support" = "yes" -a \ "$enable_libwebpmux" = "yes"; then build_gif2webp=yes + else + AC_MSG_NOTICE( + [Not building gif2webp. libgif and --enable-libwebpmux are required.]) fi ]) AM_CONDITIONAL([BUILD_ANIMDIFF], [test "${build_anim_diff}" = "yes"]) @@ -637,11 +647,17 @@ AM_CONDITIONAL([BUILD_GIF2WEBP], [test "${build_gif2webp}" = "yes"]) if test "$enable_libwebpdemux" = "yes" -a "$enable_libwebpmux" = "yes"; then build_img2webp=yes +else + AC_MSG_NOTICE( + m4_normalize([Not building img2webp. + --enable-libwebpdemux & --enable-libwebpmux are required.])) fi AM_CONDITIONAL([BUILD_IMG2WEBP], [test "${build_img2webp}" = "yes"]) if test "$enable_libwebpmux" = "yes"; then build_webpinfo=yes +else + AC_MSG_NOTICE([Not building webpinfo. --enable-libwebpdemux is required.]) fi AM_CONDITIONAL([BUILD_WEBPINFO], [test "${build_webpinfo}" = "yes"]) From f70819de51fa4709df2073a2b0d50445be1a150d Mon Sep 17 00:00:00 2001 From: James Zern Date: Sat, 3 Jul 2021 15:53:17 -0700 Subject: [PATCH 3/3] configure: enable libwebpmux by default this will provide the main libraries and their supporting examples by default if external library requirements (e.g., gif2webp+libgif) are met. Bug: webp:501 Change-Id: I593adf9222698e2dc5a2199909949c7fea1273b2 --- configure.ac | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 1739238e..de2046fe 100644 --- a/configure.ac +++ b/configure.ac @@ -35,8 +35,9 @@ AC_ARG_ENABLE([everything], dnl === Check whether libwebpmux should be built AC_MSG_CHECKING(whether libwebpmux is to be built) AC_ARG_ENABLE([libwebpmux], - AS_HELP_STRING([--enable-libwebpmux], - [Build libwebpmux @<:@default=no@:>@])) + AS_HELP_STRING([--disable-libwebpmux], + [Disable libwebpmux @<:@default=no@:>@]), + [], [enable_libwebpmux=yes]) AC_MSG_RESULT(${enable_libwebpmux-no}) AM_CONDITIONAL([BUILD_MUX], [test "$enable_libwebpmux" = "yes"])