Skip to content

Commit

Permalink
Better freetype fix
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sevu committed Dec 27, 2018
1 parent 60284d9 commit a8045ff
Showing 1 changed file with 14 additions and 34 deletions.
48 changes: 14 additions & 34 deletions configure.ac
Expand Up @@ -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])
Expand Down

0 comments on commit a8045ff

Please sign in to comment.