From ca7e3694a56d5a817b78b8802d9c24269b1c4138 Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Tue, 20 Dec 2016 19:21:37 +0100 Subject: [PATCH] FS-9858: add configure switches to disable libpng and freetype support Signed-off-by: Sebastian Kemper --- configure.ac | 38 ++++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/configure.ac b/configure.ac index 47afda4666..72f835c552 100644 --- a/configure.ac +++ b/configure.ac @@ -1279,17 +1279,35 @@ module_enabled() { grep -v -e "\#" -e "^\$" modules.conf | sed -e "s|^.*/||" | grep "^${1}\$" >/dev/null } +AC_ARG_WITH(png, + [AS_HELP_STRING([--without-png], + [disable support for libpng])], + [with_png="$withval"], + [with_png="yes"]) +if test "$with_png" = "yes"; then + PKG_CHECK_MODULES([LIBPNG], [libpng >= 1.6.16],[ + AM_CONDITIONAL([HAVE_PNG],[true])],[ + PKG_CHECK_MODULES([LIBPNG], [libpng16 >= 1.6.16],[ + AM_CONDITIONAL([HAVE_PNG],[true])],[ + PKG_CHECK_MODULES([LIBPNG], [libpng >= 1.2.49],[ + AM_CONDITIONAL([HAVE_PNG],[true])],[ + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_PNG],[false])])])]) +else + AM_CONDITIONAL([HAVE_PNG],[false]) +fi -PKG_CHECK_MODULES([LIBPNG], [libpng >= 1.6.16],[ - AM_CONDITIONAL([HAVE_PNG],[true])],[ - PKG_CHECK_MODULES([LIBPNG], [libpng16 >= 1.6.16],[ - AM_CONDITIONAL([HAVE_PNG],[true])],[ - PKG_CHECK_MODULES([LIBPNG], [libpng >= 1.2.49],[ - AM_CONDITIONAL([HAVE_PNG],[true])],[ - AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_PNG],[false])])])]) -PKG_CHECK_MODULES([FREETYPE], [freetype2 >= 2.4.9],[ - AM_CONDITIONAL([HAVE_FREETYPE],[true])],[ - AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_FREETYPE],[false])]) +AC_ARG_WITH(freetype, + [AS_HELP_STRING([--without-freetype], + [disable support for freetype])], + [with_freetype="$withval"], + [with_freetype="yes"]) +if test "$with_freetype" = "yes"; then + PKG_CHECK_MODULES([FREETYPE], [freetype2 >= 2.4.9],[ + AM_CONDITIONAL([HAVE_FREETYPE],[true])],[ + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_FREETYPE],[false])]) +else + AM_CONDITIONAL([HAVE_FREETYPE],[false]) +fi PKG_CHECK_MODULES([GUMBO], [gumbo >= 0.10.1],[ AM_CONDITIONAL([HAVE_GUMBO],[true])],[