From a8045ff78d6be5efae6ca1b46084684f7398a3d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Severin=20Gl=C3=B6ckner?= Date: Thu, 27 Dec 2018 22:19:55 +0100 Subject: [PATCH] Better freetype fix One doesn't need to specify a freetype prefix anymore. It worked previously not due to the prefix, but because specifying a prefix bypassed the tests. This removes the obsolete test and adds a new one. --- configure.ac | 48 ++++++++++++++---------------------------------- 1 file changed, 14 insertions(+), 34 deletions(-) diff --git a/configure.ac b/configure.ac index a3b1849664c3..9af8965d5a53 100644 --- a/configure.ac +++ b/configure.ac @@ -515,42 +515,22 @@ AC_SUBST([SDL_IMAGE_LIBS]) AC_SUBST([SDL_MIXER_LIBS]) AC_SUBST([SDL_NET_LIBS]) -# Checking for the freetype library. This was copied from the -# config script of SDL_ttf, modified for CPPFLAGS - -dnl Get the cflags and libraries from the freetype-config script - -AC_ARG_WITH([freetype-prefix], - AS_HELP_STRING([--with-freetype-prefix=PFX], [Prefix where FREETYPE is installed (optional)]), - [freetype_prefix="$withval"], - [freetype_prefix=""]) - -AC_ARG_WITH([freetype-exec-prefix], - AS_HELP_STRING([--with-freetype-exec-prefix=PFX], [Exec prefix where FREETYPE is installed (optional)]), - [freetype_exec_prefix="$withval"], - [freetype_exec_prefix=""]) - -if test x$freetype_exec_prefix != x ; then - freetype_args="$freetype_args --exec-prefix=$freetype_exec_prefix" - if test x${FREETYPE_CONFIG+set} != xset ; then - FREETYPE_CONFIG=$freetype_exec_prefix/bin/freetype-config - fi -fi -if test x$freetype_prefix != x ; then - freetype_args="$freetype_args --prefix=$freetype_prefix" - if test x${FREETYPE_CONFIG+set} != xset ; then - FREETYPE_CONFIG=$freetype_prefix/bin/freetype-config - fi +# Checking for the freetype library. + +AC_PATH_PROG([PKG_CONFIG], [pkg-config], [none]) +if test "x$PKG_CONFIG" = "xnone"; then + AC_MSG_ERROR([*** Please install pkg-config or pkgconf]) fi -AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no) -no_freetype="" -if test "$FREETYPE_CONFIG" = "no" ; then - AC_MSG_ERROR([ -*** Unable to find FreeType2 library (http://www.freetype.org/) -]) + +AC_MSG_CHECKING(for freetype2) +$PKG_CONFIG --exists freetype2 +if test $? != 0 ; then + AC_MSG_RESULT(no) + AC_MSG_ERROR([*** Unable to find FreeType2 library (https://www.freetype.org/)]) else - CPPFLAGS="$CPPFLAGS `pkg-config --cflags freetype2`" - FREETYPE_LIBS=`pkg-config --libs freetype2` + AC_MSG_RESULT(yes) + CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags freetype2`" + FREETYPE_LIBS="`$PKG_CONFIG --libs freetype2`" fi AC_SUBST([FREETYPE_LIBS])