configure.ac: use pkg-config to check freetype version

the PKG_CHECK_MODULES macro allows to check for a version -- use it
instead of homegrown TUXBOX_APPS_LIB_PKGCONFIG

Signed-off-by: M. Liebmann <git@tuxcode.de>
This commit is contained in:
Stefan Seyfried
2017-02-01 22:07:10 +01:00
committed by M. Liebmann
parent 1c217b404f
commit 2ca807e34a

View File

@@ -90,9 +90,20 @@ AM_CONDITIONAL(USE_TREMOR, test "$TREMOR" = "yes")
# TUXBOX_APPS_LIB_PKGCONFIG(OPENSSL,openssl) # TUXBOX_APPS_LIB_PKGCONFIG(OPENSSL,openssl)
TUXBOX_APPS_LIB_PKGCONFIG(CURL,libcurl) TUXBOX_APPS_LIB_PKGCONFIG(CURL,libcurl)
TUXBOX_APPS_LIB_PKGCONFIG(FREETYPE,freetype2)
CPPFLAGS+=" $(freetype-config --cflags)" ## For the check you must use the corresponding libtool number as version number,
AC_MSG_CHECKING([whether FreeType version is 2.5.0 or higher]) ## see freetype source code docs/VERSIONS.TXT
PKG_CHECK_MODULES([FREETYPE], [freetype2 >= 16.2.10], echo "freetype2 >= 2.5.0 found", [echo "freetype2 >= 2.5.0 not found"; exit 1])
# fallback to curl-config (which is ugly for cross-compilation)
if test -z "$CURL_LIBS" -a -z "$CURL_CFLAGS"; then
TUXBOX_APPS_LIB_CONFIG(CURL,curl-config)
fi
# fallback to freetype-config (which is ugly for cross-compilation)
if test -z "$FREETYPE_LIBS" -a -z "$FREETYPE_CFLAGS"; then
TUXBOX_APPS_LIB_CONFIG(FREETYPE,freetype-config)
CPPFLAGS+="$FREETYPE_CFLAGS"
AC_MSG_CHECKING([whether FreeType version is 2.5.0 or higher])
AC_TRY_CPP([ AC_TRY_CPP([
#include <ft2build.h> #include <ft2build.h>
#include FT_FREETYPE_H #include FT_FREETYPE_H
@@ -103,14 +114,6 @@ AC_MSG_CHECKING([whether FreeType version is 2.5.0 or higher])
[AC_MSG_RESULT(yes)], [AC_MSG_RESULT(yes)],
[AC_MSG_ERROR([Need FreeType library version 2.5.0 or higher]) [AC_MSG_ERROR([Need FreeType library version 2.5.0 or higher])
]) ])
# fallback to curl-config (which is ugly for cross-compilation)
if test -z "$CURL_LIBS" -a -z "$CURL_CFLAGS"; then
TUXBOX_APPS_LIB_CONFIG(CURL,curl-config)
fi
# fallback to freetype-config (which is ugly for cross-compilation)
if test -z "$FREETYPE_LIBS" -a -z "$FREETYPE_CFLAGS"; then
TUXBOX_APPS_LIB_CONFIG(FREETYPE,freetype-config)
fi fi
TUXBOX_APPS_LIB_PKGCONFIG(PNG,libpng) TUXBOX_APPS_LIB_PKGCONFIG(PNG,libpng)