From 7a87d3a2ee89e166e241dc8e2ac46f62b5f7fc0b Mon Sep 17 00:00:00 2001 From: Amar Takhar Date: Sat, 22 Mar 2008 23:10:55 +0000 Subject: [PATCH] Change AC_AGI_COMPILE to use AC_RUN_IFELSE instead of AC_COMPILE_IFELSE which only checks if the program links correctly, this way we can make functional programs to check for library sanity. Also disable the GL check until amz writes us a slice that uses gl.h/glext.h. Originally committed to SVN as r2117. --- configure.in | 19 ++++++++++++++----- m4macros/ac_agi.m4 | 2 +- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/configure.in b/configure.in index 8059714c3..6e91db08f 100644 --- a/configure.in +++ b/configure.in @@ -150,12 +150,7 @@ AC_SUBST(GL_LIBS) #XXX: This needs to be fixed for OSX. AC_AGI_COMPILE([OpenGL], [opengl], [$GL_CFLAGS], [$GL_LIBS],[ -#include -#include -#include int main(void) { - glXCreateContext(NULL, NULL, NULL, True); - glFinish(); return 0; }]) @@ -167,6 +162,20 @@ PKG_CHECK_MODULES(FREETYPE, freetype2 >= 9.7.0, AC_DEFINE(WITH_FREETYPE2, 1, [Enable FreeType 2 support.]), [AC_MSG_FAILURE([aegisub requires >= FreeType2 2.1.9])]) +AC_AGI_COMPILE([Freetype], [freetype], [$FREETYPE_CFLAGS], [$FREETYPE_LIBS],[ +#include +#include FT_FREETYPE_H +int main(void) { + FT_Library ft; + if (FT_Init_FreeType(&ft)) { return 1; } + return; +}]) + +if test "$agi_with_freetype" = "no"; then + AC_MSG_FAILURE([Please install a working Freetype library.]) +fi + + PKG_CHECK_MODULES(FONTCONFIG, fontconfig >= 2.4, AC_DEFINE(WITH_FONTCONFIG, 1, [Enable FontConfig support.]), [AC_MSG_FAILURE([aegisub requires >= fontconfig >= 2.4])]) diff --git a/m4macros/ac_agi.m4 b/m4macros/ac_agi.m4 index ea79779ca..cc4068fe2 100644 --- a/m4macros/ac_agi.m4 +++ b/m4macros/ac_agi.m4 @@ -5,7 +5,7 @@ AC_DEFUN([AC_AGI_COMPILE],[ LDFLAGS="$4" AC_CACHE_CHECK( [wether $1 works], [agi_with_$2], - [AC_COMPILE_IFELSE([$5], + [AC_RUN_IFELSE([$5], [eval agi_with_$2="yes"], [eval agi_with_$2="no"]) ])