changeset 7239:280aa5fdc0b4

better freetype detection
author arpi
date Sun, 01 Sep 2002 23:26:37 +0000
parents 6f44ed6c4568
children a1ae7d811e35
files configure
diffstat 1 files changed, 19 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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 <stdio.h>
 #include <freetype/freetype.h>
 #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