mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-22 04:28:34 +00:00
better freetype check
When specifying a prefix to freetype, the check was always passing. This removes the check, allowing to compile without specifing the option. Adds an alternative check for freetype.
This commit is contained in:
parent
3cc8ddb5a2
commit
848eb46867
46
configure.ac
46
configure.ac
@ -728,45 +728,25 @@ AC_SUBST([SDL_IMAGE_LIBS])
|
|||||||
AC_SUBST([SDL_MIXER_LIBS])
|
AC_SUBST([SDL_MIXER_LIBS])
|
||||||
AC_SUBST([SDL_NET_LIBS])
|
AC_SUBST([SDL_NET_LIBS])
|
||||||
|
|
||||||
# Checking for the freetype library. This was copied from the
|
# Checking for the freetype library.
|
||||||
# config script of SDL_ttf, modified for CPPFLAGS
|
|
||||||
|
|
||||||
dnl Get the cflags and libraries from the freetype-config script
|
|
||||||
|
|
||||||
if test "x$game" = "xyes"
|
if test "x$game" = "xyes"
|
||||||
then
|
then
|
||||||
|
|
||||||
AC_ARG_WITH([freetype-prefix],
|
AC_PATH_PROG([PKG_CONFIG], [pkg-config], [none])
|
||||||
AS_HELP_STRING([--with-freetype-prefix=PFX], [Prefix where FREETYPE is installed (optional)]),
|
if test "x$PKG_CONFIG" = "xnone"; then
|
||||||
[freetype_prefix="$withval"],
|
AC_MSG_ERROR([*** Please install pkg-config or pkgconf])
|
||||||
[freetype_prefix=""])
|
fi
|
||||||
|
|
||||||
AC_ARG_WITH([freetype-exec-prefix],
|
AC_MSG_CHECKING(for freetype2)
|
||||||
AS_HELP_STRING([--with-freetype-exec-prefix=PFX], [Exec prefix where FREETYPE is installed (optional)]),
|
$PKG_CONFIG --exists freetype2
|
||||||
[freetype_exec_prefix="$withval"],
|
if test $? != 0 ; then
|
||||||
[freetype_exec_prefix=""])
|
AC_MSG_RESULT(no)
|
||||||
|
AC_MSG_ERROR([*** Unable to find FreeType2 library (https://www.freetype.org/)])
|
||||||
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
|
|
||||||
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/)
|
|
||||||
])
|
|
||||||
else
|
else
|
||||||
CPPFLAGS="$CPPFLAGS `pkg-config --cflags freetype2`"
|
AC_MSG_RESULT(yes)
|
||||||
FREETYPE_LIBS="`pkg-config --libs freetype2`"
|
CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags freetype2`"
|
||||||
|
FREETYPE_LIBS="`$PKG_CONFIG --libs freetype2`"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user