2008-03-22 20:43:23 +01:00
|
|
|
AC_DEFUN([AC_AGI_COMPILE],[
|
|
|
|
aegisub_save_LDFLAGS="$LDFLAGS"
|
|
|
|
aegisub_save_CPPFLAGS="$CPPFLAGS"
|
|
|
|
CPPFLAGS="$3"
|
|
|
|
LDFLAGS="$4"
|
|
|
|
AC_CACHE_CHECK(
|
2008-12-16 03:03:01 +01:00
|
|
|
[whether $1 works], [agi_cv_with_$2],
|
2011-11-08 05:06:31 +01:00
|
|
|
[AC_RUN_IFELSE([AC_LANG_SOURCE([$5])],
|
2008-12-16 03:03:01 +01:00
|
|
|
[eval agi_cv_with_$2="yes"],
|
2009-04-22 00:32:07 +02:00
|
|
|
[eval agi_cv_with_$2="no"],
|
|
|
|
[if test $? -ne 0; then
|
|
|
|
eval agi_cv_with_$2="no";
|
|
|
|
else
|
|
|
|
eval agi_cv_with_$2="yes";
|
|
|
|
fi])
|
2008-03-22 20:43:23 +01:00
|
|
|
])
|
|
|
|
CPPFLAGS="$aegisub_save_CPPFLAGS"
|
|
|
|
LDFLAGS="$aegisub_save_LDFLAGS"
|
|
|
|
])
|
2008-03-25 01:24:39 +01:00
|
|
|
|
|
|
|
|
|
|
|
AC_DEFUN([AC_AGI_LINK],[
|
|
|
|
aegisub_save_CPPFLAGS="$CPPFLAGS"
|
|
|
|
aegisub_save_CXXFLAGS="$CXXFLAGS"
|
|
|
|
CPPFLAGS="$4"
|
|
|
|
CXXFLAGS="$CPPFLAGS"
|
2008-12-16 03:03:01 +01:00
|
|
|
AC_CHECK_HEADER([$3],[agi_cv_header="yes"], [agi_cv_header="no"])
|
|
|
|
if test "$agi_cv_header" = "yes"; then
|
2008-03-25 01:24:39 +01:00
|
|
|
aegisub_save_LDFLAGS="$LDFLAGS"
|
|
|
|
LDFLAGS="$5"
|
|
|
|
AC_CACHE_CHECK(
|
2008-12-16 03:03:01 +01:00
|
|
|
[whether $1 works], [agi_cv_with_$2],
|
2011-11-08 05:06:31 +01:00
|
|
|
[AC_LINK_IFELSE([AC_LANG_SOURCE([$6])],
|
2008-12-16 03:03:01 +01:00
|
|
|
[eval agi_cv_with_$2="yes"],
|
|
|
|
[eval agi_cv_with_$2="no"])
|
2008-03-25 01:24:39 +01:00
|
|
|
])
|
|
|
|
LDFLAGS="$aegisub_save_LDFLAGS"
|
|
|
|
else
|
2008-12-16 03:03:01 +01:00
|
|
|
eval agi_cv_with_$2="no"
|
2008-03-25 01:24:39 +01:00
|
|
|
fi
|
|
|
|
CPPFLAGS="$aegisub_save_CPPFLAGS"
|
|
|
|
CXXFLAGS="$aegisub_save_CXXFLAGS"
|
|
|
|
])
|