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.
This commit is contained in:
Amar Takhar 2008-03-22 23:10:55 +00:00
parent b6d8b403d6
commit 7a87d3a2ee
2 changed files with 15 additions and 6 deletions

View File

@ -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 <GL/gl.h>
#include <X11/Xlib.h>
#include <GL/glx.h>
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 <ft2build.h>
#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])])

View File

@ -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"])
])