--- psiconv/trunk/configure.in 2002/01/29 18:38:38 142 +++ 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.8.2) +AM_INIT_AUTOMAKE(psiconv,0.9.9) AM_CONFIG_HEADER(config.h) @@ -78,14 +78,66 @@ LDFLAGS="$LDFLAGS `Magick-config --ldflags`" LIBS="$LIBS `Magick-config --libs`" - AC_MSG_CHECKING(whether GetMagickInfo works) - AC_TRY_RUN([ #include - int main(void) { ExceptionInfo exception; - GetExceptionInfo(&exception); - OpenModules(&exception); - return (NULL == GetMagickInfo(NULL,&exception)); }], - IMAGEMAGICK=yes,IMAGEMAGICK=no,IMAGEMAGICK=yes) - AC_MSG_RESULT($IMAGEMAGICK) + + AC_MSG_CHECKING(whether GetMagickInfo works and which API to use) + AC_TRY_RUN([ #include + #include + #include + #include + 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=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("Version $IMAGEMAGICK") LDFLAGS="$LDFLAGS_OLD" LIBS="$LIBS_OLD" dnl Note: CFLAGS can't be set for single directories, so we propagate them @@ -95,9 +147,10 @@ fi fi fi -if test x"$IMAGEMAGICK" = xyes ; then +if test x"$IMAGEMAGICK" != xno ; then LIB_MAGICK="`Magick-config --libs` `Magick-config --ldflags`" - AC_DEFINE(IMAGEMAGICK,1,[ImageMagick availability]) + AC_DEFINE(IMAGEMAGICK, 1 ,[ImageMagick availability]) + AC_DEFINE_UNQUOTED(IMAGEMAGICK_API, $IMAGEMAGICK, [ImageMagick API version]) else LIB_MAGICK= fi @@ -127,7 +180,6 @@ INT_8_BIT=short AC_MSG_RESULT(short) elif test $ac_cv_sizeof_int -ge 1 ; then - INT_8_BIT=int AC_MSG_RESULT(int) elif test $ac_cv_sizeof_long -ge 1 ; then INT_8_BIT=long @@ -177,7 +229,11 @@ dnl Checks for library functions. AC_FUNC_VPRINTF AC_REPLACE_FUNCS(strdup) -AC_CHECK_FUNCS(getopt_long,,LIBOBJS="$LIBOBJS getopt.lo getopt1.lo") +AC_CHECK_FUNC(getopt_long,getopt=yes,getopt=no) +if test $getopt = no; then + AC_LIBOBJ([getopt]) + AC_LIBOBJ([getopt1]) +fi AC_ARG_ENABLE(dmalloc, [ --enable-dmalloc Enable dmalloc for developers (default:off)], @@ -201,14 +257,14 @@ AC_SUBST(LIB_DMALLOC) dnl With and without functions -AC_ARG_ENABLE(html-docs, -[ --disable-html-docs Disable generation of HTML 3.2 docs (default: on)], +AC_ARG_ENABLE(xhtml-docs, +[ --disable-xhtml-docs Disable generation of XHTML docs (default: on)], [case "${enableval}" in - yes) htmldocs=true ;; - no) htmldocs=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-html-docs) ;; -esac],[htmldocs=true]) -AM_CONDITIONAL(HTMLDOCS,test x$htmldocs = xtrue) + yes) xhtmldocs=true ;; + no) xhtmldocs=false ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-xhtml-docs) ;; +esac],[xhtmldocs=true]) +AM_CONDITIONAL(XHTMLDOCS,test x$xhtmldocs = xtrue) AC_ARG_ENABLE(html4-docs, [ --enable-html4-docs Enable generation of HTML 4 docs (default: off)], @@ -228,15 +284,16 @@ esac],[asciidocs=false]) AM_CONDITIONAL(ASCIIDOCS,test x$asciidocs = xtrue) -AC_ARG_ENABLE(rtf-docs, -[ --enable-rtf-docs Enable generation of RTF docs (default: off)], -[case "${enableval}" in - yes) rtfdocs=true ;; - no) rtfdocs=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-rtf-docs) ;; -esac],[rtfdocs=false]) -AM_CONDITIONAL(RTFDOCS,test x$rtfdocs = xtrue) +AC_ARG_WITH(etcdir, + [ --with-etcdir=DIR Set configfile dir (default: SYSCONFDIR/psiconv)], + [PSICONVETCDIR=${withval}], + [PSICONVETCDIR=${sysconfdir}/psiconv]) +AC_SUBST(PSICONVETCDIR) +AC_ARG_WITH(imagemagick, + [ --with-imagemagick enable ImageMagick (default = yes)], + [IMAGEMAGICK=$withval], + [IMAGEMAGICK='yes']) -AC_CONFIG_FILES([Makefile compat/Makefile lib/Makefile lib/psiconv/Makefile program/Makefile program/psiconv/Makefile lib/psiconv/general.h formats/Makefile docs/Makefile extra/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