# HG changeset patch # User arpi # Date 1030922797 0 # Node ID 280aa5fdc0b43a077d1a78d10d759367699a2b1a # Parent 6f44ed6c456881d1aefa6f53e95994498361bbfc better freetype detection diff -r 6f44ed6c4568 -r 280aa5fdc0b4 configure --- a/configure Sun Sep 01 23:06:15 2002 +0000 +++ b/configure Sun Sep 01 23:26:37 2002 +0000 @@ -3243,17 +3243,35 @@ if test "$_freetype" = yes ; then if ( freetype-config --version ) >/dev/null 2>&1 ; then cat > $TMPC << EOF +#include #include #if !(FREETYPE_MAJOR >= 2) #error "Need FreeType 2.0 or newer" #endif int main() { + FT_Library library; + FT_Int major=-1,minor=-1,patch=-1; + int err=FT_Init_FreeType(&library); + if(err){ + printf("Couldn't initialize freetype2 lib, err code: %d\n",err); + exit(err); + } +#if (FREETYPE_MINOR >= 1) + FT_Library_Version(library,&major,&minor,&patch); // in v2.1.0+ only :((( + printf("freetype2 header version: %d.%d.%d library version: %d.%d.%d\n", + FREETYPE_MAJOR,FREETYPE_MINOR,FREETYPE_PATCH, + (int)major,(int)minor,(int)patch ); + if(major!=FREETYPE_MAJOR || minor!=FREETYPE_MINOR){ + printf("Library and header version mismatch! Fix it in your distribution!\n"); + exit(1); + } +#endif return 0; } EOF _freetype=no - cc_check `freetype-config --cflags` && _freetype=yes + cc_check `freetype-config --cflags` `freetype-config --libs` && ( $TMPO >> "$TMPLOG" ) && _freetype=yes else _freetype=no fi