comparison configure @ 7239:280aa5fdc0b4

better freetype detection
author arpi
date Sun, 01 Sep 2002 23:26:37 +0000
parents 32fcb4422cbb
children 1dcd9cc4f801
comparison
equal deleted inserted replaced
7238:6f44ed6c4568 7239:280aa5fdc0b4
3241 3241
3242 echocheck "freetype 2" 3242 echocheck "freetype 2"
3243 if test "$_freetype" = yes ; then 3243 if test "$_freetype" = yes ; then
3244 if ( freetype-config --version ) >/dev/null 2>&1 ; then 3244 if ( freetype-config --version ) >/dev/null 2>&1 ; then
3245 cat > $TMPC << EOF 3245 cat > $TMPC << EOF
3246 #include <stdio.h>
3246 #include <freetype/freetype.h> 3247 #include <freetype/freetype.h>
3247 #if !(FREETYPE_MAJOR >= 2) 3248 #if !(FREETYPE_MAJOR >= 2)
3248 #error "Need FreeType 2.0 or newer" 3249 #error "Need FreeType 2.0 or newer"
3249 #endif 3250 #endif
3250 int main() 3251 int main()
3251 { 3252 {
3253 FT_Library library;
3254 FT_Int major=-1,minor=-1,patch=-1;
3255 int err=FT_Init_FreeType(&library);
3256 if(err){
3257 printf("Couldn't initialize freetype2 lib, err code: %d\n",err);
3258 exit(err);
3259 }
3260 #if (FREETYPE_MINOR >= 1)
3261 FT_Library_Version(library,&major,&minor,&patch); // in v2.1.0+ only :(((
3262 printf("freetype2 header version: %d.%d.%d library version: %d.%d.%d\n",
3263 FREETYPE_MAJOR,FREETYPE_MINOR,FREETYPE_PATCH,
3264 (int)major,(int)minor,(int)patch );
3265 if(major!=FREETYPE_MAJOR || minor!=FREETYPE_MINOR){
3266 printf("Library and header version mismatch! Fix it in your distribution!\n");
3267 exit(1);
3268 }
3269 #endif
3252 return 0; 3270 return 0;
3253 } 3271 }
3254 EOF 3272 EOF
3255 _freetype=no 3273 _freetype=no
3256 cc_check `freetype-config --cflags` && _freetype=yes 3274 cc_check `freetype-config --cflags` `freetype-config --libs` && ( $TMPO >> "$TMPLOG" ) && _freetype=yes
3257 else 3275 else
3258 _freetype=no 3276 _freetype=no
3259 fi 3277 fi
3260 fi 3278 fi
3261 if test "$_freetype" = yes ; then 3279 if test "$_freetype" = yes ; then