diff --git a/configure.ac b/configure.ac index f007118..43b8179 100644 --- a/configure.ac +++ b/configure.ac @@ -129,23 +129,36 @@ AC_ARG_WITH([freetype-config], [freetype_config=$withval], [freetype_config=yes]) +AC_ARG_VAR([FREETYPE_CPPFLAGS], + [C compiler flags for FREETYPE, overriding freetype-config]) +AC_ARG_VAR([FREETYPE_LIBS], + [C linker flags for FREETYPE, overriding freetype-config]) + if test "$freetype_config" = "yes"; then AC_PATH_TOOL(ft_config, freetype-config, no) - if test "$ft_config" = "no"; then - AC_MSG_ERROR([FreeType library is missing; see http://www.freetype.org/]) - fi else ft_config="$freetype_config" fi -FREETYPE_CPPFLAGS="`$ft_config --cflags`" -FREETYPE_LIBS="`$ft_config --libtool`" +if test "$ft_config" = "no"; then + if { test -z "$FREETYPE_CPPFLAGS" || test -z "$FREETYPE_LIBS"; }; then + AC_MSG_ERROR([FreeType library is missing; see http://www.freetype.org/]) + fi +else + if test -z "$FREETYPE_CPPFLAGS"; then + FREETYPE_CPPFLAGS="`$ft_config --cflags`" + fi + + if test -z "$FREETYPE_LIBS"; then + FREETYPE_LIBS="`$ft_config --libtool`" -# many platforms no longer install .la files for system libraries -if test ! -f "$FREETYPE_LIBS"; then - FREETYPE_LIBS="`$ft_config --libs`" + # many platforms no longer install .la files for system libraries + if test ! -f "$FREETYPE_LIBS"; then + FREETYPE_LIBS="`$ft_config --libs`" + fi + fi fi AC_SUBST([FREETYPE_CPPFLAGS])