--- psiconv/trunk/configure.in 2001/06/30 13:36:39 118 +++ psiconv/trunk/configure.in 2003/11/22 22:17:04 163 @@ -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.1) +AM_INIT_AUTOMAKE(psiconv,0.9.0) AM_CONFIG_HEADER(config.h) @@ -78,13 +78,23 @@ LDFLAGS="$LDFLAGS `Magick-config --ldflags`" LIBS="$LIBS `Magick-config --libs`" - AC_MSG_CHECKING(whether GetMagickInfo works) - AC_TRY_RUN([ #include + + AC_MSG_CHECKING(whether GetMagickInfo works and which API to use) + AC_TRY_RUN([ #include + #include int main(void) { ExceptionInfo exception; GetExceptionInfo(&exception); OpenModules(&exception); return (NULL == GetMagickInfo(NULL,&exception)); }], - IMAGEMAGICK=yes,IMAGEMAGICK=no,IMAGEMAGICK=yes) + IMAGEMAGICK=new,IMAGEMAGICK=no,IMAGEMAGICK=no) + 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) + fi AC_MSG_RESULT($IMAGEMAGICK) LDFLAGS="$LDFLAGS_OLD" LIBS="$LIBS_OLD" @@ -95,9 +105,12 @@ 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]) + if test x"$IMAGEMAGICK" = xold ; then + AC_DEFINE(IMAGEMAGICK_OLD,1,[ImageMagick old API version]) + fi else LIB_MAGICK= fi @@ -127,7 +140,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,8 +189,28 @@ 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_FUNCS(getopt_long,,AC_LIBOBJ([getopt]);AC_LIBOBJ([getopt1])) +AC_ARG_ENABLE(dmalloc, +[ --enable-dmalloc Enable dmalloc for developers (default:off)], +[case "${enableval}" in + yes) dmalloc=yes ;; + no) dmalloc=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-dmalloc) ;; +esac],[dmalloc=false]) +if test x"$dmalloc" = xyes; then + AC_CHECK_LIB(dmalloc,malloc,dmalloc=yes,dmalloc=no) +fi +if test x"$dmalloc" = xyes; then +AC_CHECK_HEADER(dmalloc.h,dmalloc=yes,dmalloc=no) +fi +if test x"$dmalloc" = xyes ; then + LIB_DMALLOC=-ldmalloc + AC_DEFINE(DMALLOC,1,[DMalloc availability]) +else + LIB_DMALLOC= +fi +AC_SUBST(LIB_DMALLOC) dnl With and without functions AC_ARG_ENABLE(html-docs,