Add --with-freetype
authorBehdad Esfahbod <behdad@behdad.org>
Mon, 27 May 2013 23:33:36 +0000 (19:33 -0400)
committerBehdad Esfahbod <behdad@behdad.org>
Mon, 27 May 2013 23:33:36 +0000 (19:33 -0400)
Defaults to auto.

configure.ac

index 4fb4243..fbe76c3 100644 (file)
@@ -247,7 +247,17 @@ AM_CONDITIONAL(HAVE_GRAPHITE2, $have_graphite2)
 
 dnl ==========================================================================
 
-PKG_CHECK_MODULES(FREETYPE, freetype2 >= 2.3.8, have_freetype=true, have_freetype=false)
+AC_ARG_WITH(freetype,
+       [AS_HELP_STRING([--with-freetype=@<:@yes/no/auto@:>@],
+                       [Use the FreeType library @<:@default=auto@:>@])],,
+       [with_freetype=auto])
+have_freetype=false
+if test "x$with_freetype" = "xyes" -o "x$with_freetype" = "xauto"; then
+       PKG_CHECK_MODULES(FREETYPE, freetype2 >= 2.3.8, have_freetype=true)
+fi
+if test "x$with_freetype" = "xyes" -a "x$have_freetype" != "xtrue"; then
+       AC_MSG_ERROR([FreeType support requested but libfreetype2 not found])
+fi
 if $have_freetype; then
        AC_DEFINE(HAVE_FREETYPE, 1, [Have FreeType 2 library])
        _save_libs="$LIBS"