--- psiconv/trunk/configure.in 2004/02/26 21:33:52 237 +++ psiconv/trunk/configure.in 2014/10/20 11:45:31 344 @@ -1,7 +1,7 @@ dnl Process this file with autoconf to produce a configure script. AC_INIT AC_CONFIG_SRCDIR([lib/psiconv]) -AM_INIT_AUTOMAKE(psiconv,0.9.4) +AM_INIT_AUTOMAKE(psiconv,0.9.9) AM_CONFIG_HEADER(config.h) @@ -81,21 +81,63 @@ AC_MSG_CHECKING(whether GetMagickInfo works and which API to use) AC_TRY_RUN([ #include + #include + #include #include - int main(void) { ExceptionInfo exception; - GetExceptionInfo(&exception); - OpenModules(&exception); - return (NULL == GetMagickInfo(NULL,&exception)); }], - IMAGEMAGICK=new,IMAGEMAGICK=no,IMAGEMAGICK=no) + int main(void) { + unsigned long number_formats; + ExceptionInfo exception; + GetExceptionInfo(&exception); + OpenModules(&exception); + GetMagickInfoList("*",&number_formats,&exception); + return number_formats == 0; }], + IMAGEMAGICK=4,IMAGEMAGICK=no,IMAGEMAGICK=no) + if test x"$IMAGEMAGICK" = xno ; then + AC_TRY_RUN([ #include + #include + #include + #include + int main(void) { + unsigned long number_formats; + ExceptionInfo exception; + GetExceptionInfo(&exception); + OpenModules(&exception); + GetMagickInfoList("*",&number_formats); + return number_formats == 0; }], + IMAGEMAGICK=3,IMAGEMAGICK=no,IMAGEMAGICK=no) + fi + if test x"$IMAGEMAGICK" = xno ; then + AC_TRY_RUN([ #include + #include + #include + #include + int main(void) { ExceptionInfo exception; + GetExceptionInfo(&exception); + OpenModules(&exception); + return (NULL == GetMagickInfo(NULL,&exception)); }], + IMAGEMAGICK=2,IMAGEMAGICK=no,IMAGEMAGICK=no) + fi if test x"$IMAGEMAGICK" = xno ; then AC_TRY_RUN([ #include int main(void) { ExceptionInfo exception; GetExceptionInfo(&exception); OpenModules(&exception); return (NULL == GetMagickInfo(NULL,&exception)); }], - IMAGEMAGICK=old,IMAGEMAGICK=no,IMAGEMAGICK=no) + IMAGEMAGICK=1,IMAGEMAGICK=no,IMAGEMAGICK=no) + fi + if test x"$IMAGEMAGICK" = xno ; then + # 100 equals GraphicsMagick + AC_TRY_RUN([ #include + int main(void) { + MagickInfo **formats; + ExceptionInfo exception; + InitializeMagick(NULL); + GetExceptionInfo(&exception); + return (NULL == GetMagickInfoArray(&exception)); }], + IMAGEMAGICK=100,IMAGEMAGICK=no,IMAGEMAGICK=no) fi - AC_MSG_RESULT($IMAGEMAGICK) + + AC_MSG_RESULT("Version $IMAGEMAGICK") LDFLAGS="$LDFLAGS_OLD" LIBS="$LIBS_OLD" dnl Note: CFLAGS can't be set for single directories, so we propagate them @@ -107,10 +149,8 @@ fi if test x"$IMAGEMAGICK" != xno ; then LIB_MAGICK="`Magick-config --libs` `Magick-config --ldflags`" - AC_DEFINE(IMAGEMAGICK,1,[ImageMagick availability]) - if test x"$IMAGEMAGICK" = xold ; then - AC_DEFINE(IMAGEMAGICK_OLD,1,[ImageMagick old API version]) - fi + AC_DEFINE(IMAGEMAGICK, 1 ,[ImageMagick availability]) + AC_DEFINE_UNQUOTED(IMAGEMAGICK_API, $IMAGEMAGICK, [ImageMagick API version]) else LIB_MAGICK= fi @@ -255,5 +295,5 @@ [IMAGEMAGICK=$withval], [IMAGEMAGICK='yes']) -AC_CONFIG_FILES([Makefile compat/Makefile lib/Makefile lib/psiconv/Makefile program/Makefile program/psiconv/Makefile program/psiconv-config/Makefile program/psiconv-config/psiconv-config program/psiconv-config/psiconv-config.man lib/psiconv/general.h formats/Makefile docs/Makefile program/extra/Makefile etc/Makefile]) +AC_CONFIG_FILES([Makefile compat/Makefile lib/Makefile lib/psiconv/Makefile program/Makefile program/psiconv/Makefile program/psiconv-config/Makefile program/psiconv-config/psiconv-config program/psiconv-config/psiconv-config.man lib/psiconv/general.h formats/Makefile docs/Makefile program/extra/Makefile etc/Makefile examples/Makefile]) AC_OUTPUT