# HG changeset patch # User Mike Miller # Date 1506986758 25200 # Node ID e2dc75c661acd6a41b58dde30d2143795627605a # Parent 0d446e938f1f287c341b1e65426d19eb466cdcba configure: add a command-line option '--without-freetype' to disable FreeType * configure.ac: Add a command-line option '--without-freetype' to optionally disable building Octave with FreeType. diff -r 0d446e938f1f -r e2dc75c661ac configure.ac --- a/configure.ac Mon Oct 02 10:36:28 2017 -0700 +++ b/configure.ac Mon Oct 02 16:25:58 2017 -0700 @@ -2020,24 +2020,35 @@ ## Check for FreeType 2 library +check_freetype=yes warn_freetype="" -PKG_CHECK_MODULES([FT2], [freetype2], [ - min_ft2_version=9.03 - AC_MSG_CHECKING([for FreeType2 version >= $min_ft2_version]) - $PKG_CONFIG freetype2 --atleast-version=$min_ft2_version - ac_status=$? - if test "$ac_status" = 0; then - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_FREETYPE, 1, [Define to 1 if Freetype is available.]) - save_LIBS="$LIBS" - LIBS="$FT2_LIBS $LIBS" - AC_CHECK_FUNCS([FT_Reference_Face]) - LIBS="$save_LIBS" - else - AC_MSG_RESULT(no) - warn_freetype="FreeType library >= 9.03 not found. OpenGL graphics will not be fully functional." - fi], - [warn_freetype="FreeType library not found. OpenGL graphics will not be fully functional."]) +AC_ARG_WITH([freetype], + [AS_HELP_STRING([--without-freetype], + [don't use FreeType library, OpenGL graphics will not be fully functional])], + [if test x"$withval" = xno; then + check_freetype=no + warn_freetype="--without-freetype specified. OpenGL graphics will not be fully functional." + fi]) + +if test $check_freetype = yes; then + PKG_CHECK_MODULES([FT2], [freetype2], [ + min_ft2_version=9.03 + AC_MSG_CHECKING([for FreeType2 version >= $min_ft2_version]) + $PKG_CONFIG freetype2 --atleast-version=$min_ft2_version + ac_status=$? + if test "$ac_status" = 0; then + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_FREETYPE, 1, [Define to 1 if Freetype is available.]) + save_LIBS="$LIBS" + LIBS="$FT2_LIBS $LIBS" + AC_CHECK_FUNCS([FT_Reference_Face]) + LIBS="$save_LIBS" + else + AC_MSG_RESULT(no) + warn_freetype="FreeType library >= 9.03 not found. OpenGL graphics will not be fully functional." + fi], + [warn_freetype="FreeType library not found. OpenGL graphics will not be fully functional."]) +fi if test -n "$warn_freetype"; then OCTAVE_CONFIGURE_WARNING([warn_freetype])