From f1fe720124d2fdc33defe18f6d1c3feda86980cf Mon Sep 17 00:00:00 2001 From: kramm Date: Sun, 7 Mar 2004 09:39:29 +0000 Subject: [PATCH] fix for newer avifile versions --- avi2swf/avi2swf.cc | 9 ++++++++- config.h.in | 7 +++++++ m4/avi2swf.m4 | 35 +++++++++++++++++++++++++++++++++-- 3 files changed, 48 insertions(+), 3 deletions(-) diff --git a/avi2swf/avi2swf.cc b/avi2swf/avi2swf.cc index 945afd1..d231762 100644 --- a/avi2swf/avi2swf.cc +++ b/avi2swf/avi2swf.cc @@ -41,7 +41,14 @@ extern "C" { #include "../lib/q.h" #undef HAVE_CONFIG_H -#include + +#ifdef HAVE_VERSION_H + #include +#endif +#ifdef HAVE_AVIFILE_VERSION_H + #include +#endif + #if (AVIFILE_MAJOR_VERSION == 0) && (AVIFILE_MINOR_VERSION>=6) #include #include diff --git a/config.h.in b/config.h.in index 234d6f8..a95b95b 100644 --- a/config.h.in +++ b/config.h.in @@ -91,6 +91,13 @@ /* Define if you have the header file. */ #undef HAVE_ZLIB_H +/* Define if you have the header file. */ +#undef HAVE_AVIFILE_VERSION_H + +/* Define if you have the header file. */ +#undef HAVE_VERSION_H + +/* Define if you have the jpeg library (-ljpeg). */ /* Define if you have the jpeg library (-ljpeg). */ #undef HAVE_LIBJPEG diff --git a/m4/avi2swf.m4 b/m4/avi2swf.m4 index 9339f7d..36f23cc 100644 --- a/m4/avi2swf.m4 +++ b/m4/avi2swf.m4 @@ -1,10 +1,41 @@ AC_DEFUN(RFX_CHECK_AVI2SWF, [ + AC_CHECK_PROGS(AVIFILE_CONFIG, avifile-config) + +if test "x$AVIFILE_CONFIG" '!=' "x";then + OLDCPPFLAGS="$CPPFLAGS" + #OLDLDFLAGS="$LDFLAGS" + CPPFLAGS="$CPPFLAGS $CXXFLAGS "`$AVIFILE_CONFIG --cflags` + #LDFLAGS="$LDFLAGS `$AVIFILE_CONFIG --libs`" + AC_CHECK_HEADERS(avifile/version.h version.h) + #LDFLAGS="$OLDLDFLAGS" + CPPFLAGS="$OLDCPPFLAGS" +fi + AC_MSG_CHECKING([whether we can compile the avifile test program]) +if test "x${ac_cv_header_version_h}" '=' "xyes";then + HAVE_VERSION_H_DEFINE='#define HAVE_VERSION_H' +fi +if test "x${ac_cv_header_avifile_version_h}" '=' "xyes";then + HAVE_AVIFILE_VERSION_H_DEFINE='#define HAVE_AVIFILE_VERSION_H' +fi + cat > conftest.cpp << EOF -#include + +// hack- we can't yet access the variables in config.h (because it hasn't been generated yet), +// so we have to introduce them this way +$HAVE_VERSION_H_DEFINE +$HAVE_AVIFILE_VERSION_H_DEFINE + +#ifdef HAVE_VERSION_H + #include +#endif +#ifdef HAVE_AVIFILE_VERSION_H + #include +#endif + #if (AVIFILE_MAJOR_VERSION == 0) && (AVIFILE_MINOR_VERSION>=6) #include #include @@ -22,7 +53,7 @@ cat > conftest.cpp << EOF #define Bpp bpp #endif -int test() +void test() { IAviReadFile* player; IAviReadStream* astream; -- 1.7.10.4