]> granicus.if.org Git - imagemagick/blobdiff - configure.ac
(no commit message)
[imagemagick] / configure.ac
index 2d7268d98b3e1f26e1ad6e7c406538390cbe2743..990dddddb7d19398aca67c3261fb2e2654019721 100755 (executable)
@@ -1,4 +1,4 @@
-#  Copyright 1999-2012 ImageMagick Studio LLC, a non-profit organization
+#  Copyright 1999-2013 ImageMagick Studio LLC, a non-profit organization
 #  dedicated to making software imaging solutions freely available.
 #
 #  You may not use this file except in compliance with the License.  You may
@@ -18,7 +18,7 @@
 #  are permitted in any medium without royalty provided the copyright
 #  notice and this notice are preserved.
 
-AC_PREREQ(2.67)
+AC_PREREQ(2.69)
 
 m4_define([magick_major_version], [7])
 m4_define([magick_minor_version], [0])
@@ -31,16 +31,18 @@ m4_define([magick_svn_revision], esyscmd([sh -c "(svnversion .) | awk '{ print \
 AC_INIT([ImageMagick],[magick_version],[http://www.imagemagick.org],[ImageMagick])
 AC_CONFIG_SRCDIR([MagickCore/MagickCore.h])
 AC_CONFIG_AUX_DIR([config])
+AC_REQUIRE_AUX_FILE([tap-driver.sh])
 AC_CONFIG_MACRO_DIR([m4])
-AC_CONFIG_LIBOBJ_DIR([ltdl])
 AC_CONFIG_HEADERS([config/config.h])
-AX_PREFIX_CONFIG_H([MagickCore/magick-config.h],[MagickCore])
+AX_PREFIX_CONFIG_H([MagickCore/magick-baseconfig.h],[MagickCore])
 AC_CONFIG_FILES([\
+    common.shi \
     config/configure.xml \
     config/delegates.xml \
     config/ImageMagick.rdf \
     config/MagickCore.dox \
     config/MagickWand.dox \
+    config/Magick++.dox \
     config/type-dejavu.xml \
     config/type-ghostscript.xml \
     config/type-windows.xml \
@@ -48,16 +50,20 @@ AC_CONFIG_FILES([\
     ImageMagick.spec \
     Magick++/bin/Magick++-config \
     MagickCore/ImageMagick.pc \
-    Magick++/lib/ImageMagick++.pc \
     Magick++/lib/Magick++.pc \
     MagickCore/MagickCore-config \
     MagickCore/MagickCore.pc \
     MagickCore/version.h \
     Makefile \
     magick.sh \
-    PerlMagick/Magick.pm \
-    PerlMagick/Makefile.PL \
     PerlMagick/check.sh \
+    PerlMagick/default/Magick.pm \
+    PerlMagick/Makefile.PL \
+    PerlMagick/default/Makefile.PL \
+    PerlMagick/quantum/Makefile.PL \
+    PerlMagick/quantum/quantum.pm \
+    PerlMagick/quantum/quantum.xs \
+    PerlMagick/quantum/typemap \
     utilities/animate.1 \
     utilities/compare.1 \
     utilities/composite.1 \
@@ -110,6 +116,15 @@ MAGICK_TARGET_OS=$host_os
 AC_SUBST(MAGICK_TARGET_OS)
 AC_DEFINE_UNQUOTED(MAGICK_TARGET_OS,$MAGICK_TARGET_OS,[Target Host OS])
 
+
+# Substitute versioning
+AC_SUBST([MAGICK_MAJOR_VERSION],[magick_major_version])
+AC_SUBST([MAGICK_MINOR_VERSION],[magick_minor_version])
+AC_SUBST([MAGICK_MICRO_VERSION],[magick_micro_version])
+AC_SUBST([MAGICK_PATCHLEVEL_VERSION],[magick_patchlevel_version])
+AC_SUBST([MAGICK_VERSION],[magick_version])
+AC_SUBST([MAGICK_SVN_REVISION],[magick_svn_revision])
+
 # Substitute library versioning
 AC_SUBST(MAGICK_LIBRARY_CURRENT)dnl
 AC_SUBST(MAGICK_LIBRARY_REVISION)dnl
@@ -118,7 +133,6 @@ AC_SUBST([MAGICK_LIBRARY_CURRENT_MIN],
          [`expr $MAGICK_LIBRARY_CURRENT - $MAGICK_LIBRARY_AGE`])
 AC_SUBST([MAGICK_LIBRARY_VERSION_INFO],
          [$MAGICK_LIBRARY_CURRENT:$MAGICK_LIBRARY_REVISION:$MAGICK_LIBRARY_AGE])
-AC_SUBST([MAGICK_SVN_REVISION],[magick_svn_revision])
 
 AC_SUBST(PACKAGE_NAME)dnl
 AC_SUBST(PACKAGE_VERSION)dnl
@@ -268,11 +282,16 @@ AX_COMPILER_VENDOR
 AC_PROG_INSTALL
 AC_PROG_MAKE_SET
 AC_PROG_LN_S
+AC_PROG_SED
+AC_PROG_AWK
 AM_WITH_DMALLOC
 AX_C___ATTRIBUTE__
 AX_GCC_ARCHFLAG([no])
 PKG_PROG_PKG_CONFIG
 
+# Check for linker script support
+gl_LD_VERSION_SCRIPT
+
 #
 # Enable run-time checking.
 #
@@ -364,23 +383,25 @@ fi
 
 dnl Platform-specific stuff
 case "$host" in
-*darwin* | *-macos10*)
-  dnl OS X universal binary support, requires --disable-dependency-tracking
-  AC_ARG_ENABLE([osx-universal-binary],
+  *darwin* | *-macos10*)
+    dnl Disable FORTIFY_SOURCE to fix a bug in LVVM / OpenMP support
+    CFLAGS="${CFLAGS} -D_FORTIFY_SOURCE=0"
+    dnl OS X universal binary support, requires --disable-dependency-tracking
+    AC_ARG_ENABLE([osx-universal-binary],
         AC_HELP_STRING([--enable-osx-universal-binary],
            [build universal binary on OS X [[default=no]]]),
         [build_osxuniversal="${enableval}"], [build_osxuniversal=no])
 
-  if test "${build_osxuniversal}" != no ; then
-    if test "$enable_dependency_tracking" != no ; then
-      AC_MSG_ERROR([--enable-osx-universal-binary requires --disable-dependency-tracking.
+    if test "${build_osxuniversal}" != no ; then
+      if test "$enable_dependency_tracking" != no ; then
+        AC_MSG_ERROR([--enable-osx-universal-binary requires --disable-dependency-tracking.
 Please re-run configure with these options:
   --disable-dependency-tracking --enable-osx-universal-binary
         ])
-    fi
-    CFLAGS="$CFLAGS -isysroot /Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386"
-    CXXFLAGS="$CXXFLAGS -isysroot /Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386"
-    LDFLAGS="$LDFLAGS -Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386"
+      fi
+      CFLAGS="$CFLAGS -isysroot /Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386"
+      CXXFLAGS="$CXXFLAGS -isysroot /Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386"
+      LDFLAGS="$LDFLAGS -Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386"
   fi
   ;;
 esac
@@ -407,9 +428,14 @@ AC_ARG_WITH([sharearch-dir],
                     [sharearch_dir="${LIB_DIR}"])
 
 eval "eval SHAREARCH_DIR=$sharearch_dir"
-SHAREARCH_DIR="$sharearch_dir"
 AC_SUBST(SHAREARCH_DIR)
 
+# Path to the pkgconfig folder
+AC_ARG_WITH([pkgconfigdir], AS_HELP_STRING([--with-pkgconfigdir=DIR],
+            [Path to the pkgconfig directory @<:@LIBDIR/pkgconfig@:>@]),
+            [pkgconfigdir="$withval"], [pkgconfigdir='${libdir}/pkgconfig'])
+AC_SUBST([pkgconfigdir])
+
 #
 # Enable support for threads
 AC_ARG_WITH([threads],
@@ -478,8 +504,8 @@ if test "$enable_largefile" != no; then
           exit(!(sizeof(off_t) == 8));
         }])],
         [ac_cv_sys_file_offset_bits=64; AC_DEFINE(_FILE_OFFSET_BITS,64)
-         AC_MSG_NOTICE([yes])],
-        [AC_MSG_NOTICE([no])])
+         AC_MSG_RESULT([yes])],
+        [AC_MSG_RESULT([no])])
         ;;
     *)
         LFS_CPPFLAGS="$LFS_CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
@@ -500,10 +526,6 @@ LT_INIT([win32-dll])
 LT_LANG([C++])
 AC_SUBST(LIBTOOL_DEPS)
 
-# Configure libltdl
-LT_CONFIG_LTDL_DIR([ltdl])
-LTDL_INIT([convenience nonrecursive])
-
 # Check to see if building shared libraries
 libtool_build_shared_libs='no'
 if test "$enable_shared" = 'yes'; then
@@ -520,6 +542,7 @@ AM_CONDITIONAL(WITH_SHARED_LIBS, test "${libtool_build_shared_libs}" = 'yes')
 #
 # Enable support for building loadable modules
 #
+build_modules='no'
 AC_ARG_WITH([modules],
     [AC_HELP_STRING([--with-modules],
                     [enable building dynamically loadable modules])],
@@ -530,31 +553,16 @@ AC_ARG_WITH([modules],
 if test "$with_modules" != 'no' ; then
     if test "$libtool_build_shared_libs" = 'no'; then
         AC_MSG_WARN([Modules may only be built if building shared libraries is enabled.])
-        with_modules='no'
-    fi
+    build_modules='no'
+  else
+    build_modules='yes'
+  fi
 fi
-if test "$with_modules" != 'no'; then
+if test "$build_modules" != 'no' ; then
     AC_DEFINE(BUILD_MODULES,1,Define if coders and filters are to be built as modules.)
+    MAGICK_FEATURES="$MAGICK_FEATURES Modules"
 fi
-AM_CONDITIONAL(WITH_MODULES, test "$with_modules" != 'no')
-
-# Enable building/use of libltdl if we are building shared libraries regardless
-# of whether modules are built or not.
-with_ltdl='no'
-if test "$libtool_build_shared_libs" != 'no'; then
-    with_ltdl='yes'
-fi
-
-AM_CONDITIONAL(WITH_LTDL, test "$with_ltdl" != 'no')
-if test "$with_ltdl" != 'no'; then
-    AC_DEFINE(LTDL_DELEGATE,1,Define if using libltdl to support dynamically loadable modules)
-
-    # Set DLLDFLAGS
-    if test X"$enable_shared" = Xyes; then
-        DLLDFLAGS=-export-dynamic
-        AC_SUBST(DLLDFLAGS)
-    fi
-fi
+AM_CONDITIONAL(WITH_MODULES, test "$build_modules" != 'no')
 
 # Enable build using delegate libraries built in subdirectories rather than installed
 # delegate libraries (bzlib fftw fpx gslib jp2 jbig jpeg lcms lzma png tiff ttf wmf xml zlib)
@@ -566,7 +574,7 @@ AC_ARG_ENABLE([delegate-build],
 
 AC_ARG_ENABLE([deprecated],
     [AC_HELP_STRING([--disable-deprecated],
-                    [exclude deprecated methods in MagickCore and MagickWand API's])],
+                    [exclude deprecated methods in MagickCore and MagickWand APIs])],
     [enable_deprecated=$enableval],
     [enable_deprecated='no'])
 
@@ -615,7 +623,7 @@ fi
 
 # Build a high dynamic range version of ImageMagick.
 AC_ARG_ENABLE([hdri],
-    [AC_HELP_STRING([--disable-hdri],
+    [AC_HELP_STRING([--enable-hdri],
                     [accurately represent the wide range of intensity levels found in real scenes])],
     [enable_hdri=$enableval],
     [enable_hdri='yes'])
@@ -623,10 +631,16 @@ AC_ARG_ENABLE([hdri],
 MAGICK_HDRI=""
 if test "$enable_hdri" = 'yes'; then
     MAGICK_HDRI="HDRI"
-    AC_DEFINE(HDRI_SUPPORT,1,[accurately represent the wide range of intensity levels in real scenes])
+    magick_hdri_enable='1';
     MAGICK_FEATURES="HDRI $MAGICK_FEATURES"
+else
+    magick_hdri_enable='0'
 fi
+AC_DEFINE_UNQUOTED(HDRI_ENABLE_OBSOLETE_IN_H,$magick_hdri_enable,[Whether hdri is enabled or not])
 AC_SUBST(MAGICK_HDRI)dnl
+MAGICK_PCFLAGS="$MAGICK_PCFLAGS -DMAGICKCORE_HDRI_ENABLE=$magick_hdri_enable"
+CFLAGS="$CFLAGS -DMAGICKCORE_HDRI_ENABLE=$magick_hdri_enable"
+CPPFLAGS="$CPPFLAGS -DMAGICKCORE_HDRI_ENABLE=$magick_hdri_enable"
 
 # Build a version of ImageMagick with assert statements.
 AC_ARG_ENABLE([assert],
@@ -723,8 +737,18 @@ case "${with_quantum_depth}" in
     * ) AC_MSG_ERROR("Pixel quantum depth must have value of 8, 16, 32, or 64") ;;
 esac
 QUANTUM_DEPTH="$with_quantum_depth"
-AC_DEFINE_UNQUOTED(QUANTUM_DEPTH,$QUANTUM_DEPTH,[Number of bits in a pixel Quantum (8/16/32/64)])
+AC_DEFINE_UNQUOTED(QUANTUM_DEPTH_OBSOLETE_IN_H,$QUANTUM_DEPTH,[Number of bits in a pixel Quantum (8/16/32/64)])
 AC_SUBST(QUANTUM_DEPTH)dnl
+MAGICK_PCFLAGS="$MAGICK_PCFLAGS -DMAGICKCORE_QUANTUM_DEPTH=$QUANTUM_DEPTH"
+CFLAGS="$CFLAGS -DMAGICKCORE_QUANTUM_DEPTH=$QUANTUM_DEPTH"
+CPPFLAGS="$CPPFLAGS -DMAGICKCORE_QUANTUM_DEPTH=$QUANTUM_DEPTH"
+
+# define a lib suffix for abi purpose
+MAGICK_ABI_SUFFIX="Q${QUANTUM_DEPTH}"
+if test "$enable_hdri" = 'yes'; then
+  MAGICK_ABI_SUFFIX="Q${QUANTUM_DEPTH}${MAGICK_HDRI}"
+fi
+AC_SUBST(MAGICK_ABI_SUFFIX)
 
 # Set pixel cache threshold
 AC_ARG_WITH([cache],
@@ -752,6 +776,13 @@ AC_ARG_WITH([magick-plus-plus],
     [with_magick_plus_plus=$withval],
     [with_magick_plus_plus='yes'])
 
+# Encode the this name into the shared library.
+AC_ARG_WITH([package-release-name],
+    [AC_HELP_STRING([--with-package-release-name=NAME],
+                    [encode this name into the shared library])],
+[MAGICK_LT_RELEASE_OPTS="-release $withval"])
+AC_SUBST(MAGICK_LT_RELEASE_OPTS)
+
 # Disable build/install of PerlMagick.
 AC_ARG_WITH([perl],
     [AC_HELP_STRING([--with-perl],
@@ -811,7 +842,7 @@ if test "${native_win32_build}" = 'yes'; then
         MAGICK_CPPFLAGS="$MAGICK_CPPFLAGS -D_DLL"
         MAGICK_PCFLAGS="$MAGICK_PCFLAGS -D_DLL"
         LIBRARY_EXTRA_CPPFLAGS="$LIBRARY_EXTRA_CPPFLAGS -D_MAGICKLIB_"
-        if test "$with_modules" = 'yes'; then
+        if test "$build_modules" = 'yes'; then
             LIBRARY_EXTRA_CPPFLAGS="$LIBRARY_EXTRA_CPPFLAGS -D_MAGICKMOD_"
         else
             MODULE_EXTRA_CPPFLAGS="$MODULE_EXTRA_CPPFLAGS -D_MAGICKLIB_"
@@ -841,7 +872,7 @@ AC_HEADER_ASSERT
 AC_HEADER_DIRENT
 
 # Check additional headers
-AC_CHECK_HEADERS(arm/limits.h complex.h errno.h fcntl.h limits.h linux/unistd.h locale.h machine/param.h mach-o/dyld.h OS.h process.h stdarg.h sys/ipc.h sys/resource.h sys/syslimits.h sys/time.h sys/timeb.h sys/times.h sys/wait.h wchar.h xlocale.h)
+AC_CHECK_HEADERS(arm/limits.h arpa/inet.h complex.h errno.h fcntl.h limits.h linux/unistd.h locale.h machine/param.h mach-o/dyld.h netinet/in.h OS.h process.h sun_prefetch.h stdarg.h sys/ipc.h sys/mman.h sys/resource.h sys/socket.h sys/syslimits.h sys/time.h sys/timeb.h sys/times.h sys/wait.h wchar.h xlocale.h)
 
 ########
 #
@@ -858,15 +889,14 @@ AC_STRUCT_TM
 AC_STRUCT_TIMEZONE
 AC_SYS_INTERPRETER
 
-# If the C compiler supports the keyword inline, do nothing. Otherwise
-# define inline to __inline__ or __inline if it accepts one of those,
-# otherwise define inline to be empty.
+#
+# Checks for language qualifiers and semantics.
+#
+AC_C_CHAR_UNSIGNED
+AC_C_CONST
 AC_C_INLINE
-
-# If the C compiler supports the keyword restrict, do nothing. Otherwise
-# define restrict to __restrict__ or __restrict if it accepts one of those,
-# otherwise define restrict to be empty.
 AC_C_RESTRICT
+AC_C_VOLATILE
 
 # If words are stored with the most significant byte first (like
 # Motorola and SPARC CPUs), define `WORDS_BIGENDIAN'.
@@ -897,9 +927,16 @@ AC_TYPE_UINTMAX_T
 AC_TYPE_UINTPTR_T
 AC_TYPE_UNSIGNED_LONG_LONG_INT
 
-# If the C type char is unsigned, define __CHAR_UNSIGNED__, unless the
-# C compiler predefines it.
-AC_C_CHAR_UNSIGNED
+# Float_t and double_t are intended to be the the most efficient type.
+AC_CHECK_TYPES([float_t], [], [], [[#include <math.h>]])
+AC_CHECK_TYPES([double_t], [], [], [[#include <math.h>]])
+AC_CHECK_SIZEOF([float_t], [], [[#include <math.h>]])
+AC_CHECK_SIZEOF([double_t], [], [[#include <math.h>]])
+
+# Get size of float, double and long double for comparaison.
+AC_CHECK_SIZEOF([float])
+AC_CHECK_SIZEOF([double])
+AC_CHECK_SIZEOF([long double])
 
 # Obtain size of an 'signed short' and define as SIZEOF_SIGNED_SHORT
 AC_CHECK_SIZEOF(signed short)
@@ -946,22 +983,22 @@ AC_CHECK_SIZEOF(unsigned int*)
 
 AC_MSG_CHECKING(for signed 8-bit type)
 INT8_T='signed char'
-AC_MSG_NOTICE($INT8_T)
+AC_MSG_RESULT($INT8_T)
 AC_SUBST(INT8_T)
 
 AC_MSG_CHECKING(for unsigned 8-bit type)
 UINT8_T='unsigned char'
-AC_MSG_NOTICE($UINT8_T)
+AC_MSG_RESULT($UINT8_T)
 AC_SUBST(UINT8_T)
 
 AC_MSG_CHECKING(for signed 16-bit type)
 INT16_T='signed short'
-AC_MSG_NOTICE($INT16_T)
+AC_MSG_RESULT($INT16_T)
 AC_SUBST(INT16_T)
 
 AC_MSG_CHECKING(for unsigned 16-bit type)
 UINT16_T='unsigned short'
-AC_MSG_NOTICE($UINT16_T)
+AC_MSG_RESULT($UINT16_T)
 AC_SUBST(UINT16_T)
 
 AC_MSG_CHECKING(for signed 32-bit type)
@@ -974,7 +1011,7 @@ elif test $ac_cv_sizeof_signed_long -eq 4; then
   INT32_T='signed long'
   INT32_F='"l"'
 fi
-AC_MSG_NOTICE($INT32_T)
+AC_MSG_RESULT($INT32_T)
 AC_SUBST(INT32_T)
 AC_SUBST(INT32_F)
 
@@ -988,7 +1025,7 @@ elif test $ac_cv_sizeof_unsigned_long -eq 4; then
   UINT32_T='unsigned long'
   UINT32_F='"l"'
 fi
-AC_MSG_NOTICE($UINT32_T)
+AC_MSG_RESULT($UINT32_T)
 AC_SUBST(UINT32_T)
 AC_SUBST(UINT32_F)
 
@@ -1007,7 +1044,7 @@ case "${host_os}" in
     INT64_F='"I64"'
     ;;
 esac
-AC_MSG_NOTICE($INT64_T)
+AC_MSG_RESULT($INT64_T)
 AC_SUBST(INT64_T)
 AC_SUBST(INT64_F)
 
@@ -1026,7 +1063,7 @@ case "${host_os}" in
     UINT64_F='"I64"'
     ;;
 esac
-AC_MSG_NOTICE($UINT64_T)
+AC_MSG_RESULT($UINT64_T)
 AC_SUBST(UINT64_T)
 AC_SUBST(UINT64_F)
 
@@ -1040,7 +1077,7 @@ elif test "$UINT32_T" != 'none'; then
   UINTMAX_T=$UINT32_T
   UINTMAX_F=$UINT32_F
 fi
-AC_MSG_NOTICE($UINTMAX_T)
+AC_MSG_RESULT($UINTMAX_T)
 AC_SUBST(UINTMAX_T)
 AC_SUBST(UINTMAX_F)
 
@@ -1054,22 +1091,22 @@ elif test $ac_cv_sizeof_unsigned_long_long -eq $ac_cv_sizeof_unsigned_intp; then
   UINTPTR_T='unsigned long long'
   UINTPTR_F='"ll"'
 fi
-AC_MSG_NOTICE($UINTPTR_T)
+AC_MSG_RESULT($UINTPTR_T)
 AC_SUBST(UINTPTR_T)
 AC_SUBST(UINTPTR_F)
 
 AC_MSG_CHECKING([whether our compiler supports __func__])
 AC_TRY_COMPILE([],
  [{ const char *func = __func__; return(func != 0 ? 0 : 1); }],
- AC_MSG_NOTICE([yes]),
- AC_MSG_NOTICE([no])
+ AC_MSG_RESULT([yes]),
+ AC_MSG_RESULT([no])
  AC_MSG_CHECKING([whether our compiler supports __FUNCTION__])
  AC_TRY_COMPILE([],
    [{ const char *func = __FUNCTION__; return(func != 0 ? 0 : 1); }],
-   AC_MSG_NOTICE([yes])
+   AC_MSG_RESULT([yes])
    AC_DEFINE(__func__, __FUNCTION__,
      [Define to appropriate substitue if compiler does not have __func__]),
-   AC_MSG_NOTICE([no])
+   AC_MSG_RESULT([no])
    AC_DEFINE(__func__, __FILE__,
      [Define to appropriate substitue if compiler does not have __func__])))
 
@@ -1098,7 +1135,17 @@ AC_CHECK_LIB(m,sqrt,MATH_LIBS="-lm",,)
 LIBS="$MATH_LIBS $LIBS"
 AC_SUBST(MATH_LIBS)
 
-AC_CHECK_FUNCS([acosh _aligned_malloc asinh atanh atoll atexit cabs carg cimag creal clock ctime_r directio _exit execvp fchmod floor fork ftime ftruncate getc_unlocked getcwd getpid getexecname getdtablesize getpagesize getrlimit getrusage gettimeofday gmtime_r isnan j0 j1 lltostr localtime_r lstat memmove memset mkstemp munmap nanosleep newlocale _NSGetExecutablePath pclose _pclose poll popen _popen posix_fadvise posix_fallocate posix_madvise posix_memalign posix_spawnp pow pread pwrite qsort_r raise rand_r readlink readdir_r realpath select seekdir setlocale sqrt setvbuf stat strchr strrchr strcspn strdup strpbrk strspn strstr strtod strtod_l strtol strtoul symlink sysconf sigemptyset sigaction spawnvp strerror strlcat strlcpy strcasecmp strncasecmp telldir tempnam times ulltostr uselocale usleep utime vfprintf vfprintf_l vsprintf vsnprintf vsnprintf_l waitpid _wfopen _wstat])
+#
+# Find socket library
+#
+AC_SEARCH_LIBS(gethostbyname, resolv nsl)
+AC_SEARCH_LIBS(socket, socket,
+[
+  AC_DEFINE([HAVE_SOCKET],[1],[Define to 1 if you have socket support.])
+  MAGICK_FEATURES="DPC $MAGICK_FEATURES"
+])
+
+AC_CHECK_FUNCS([acosh _aligned_malloc asinh atanh atoll atexit cabs carg cimag creal clock ctime_r directio _exit execvp fchmod floor fork ftime ftruncate getc_unlocked getcwd getpid getexecname getdtablesize getpagesize getrlimit getrusage gettimeofday gmtime_r isnan j0 j1 lltostr localtime_r lstat memmove memset mkstemp munmap nanosleep newlocale _NSGetExecutablePath pclose _pclose poll popen _popen posix_fadvise posix_fallocate posix_madvise posix_memalign posix_spawnp pow pread pwrite qsort_r raise rand_r readlink readdir_r realpath select seekdir setlocale socket sqrt setvbuf stat strchr strrchr strcspn strdup strpbrk strspn strstr strtod strtod_l strtol strtoul symlink sysconf sigemptyset sigaction spawnvp strerror strlcat strlcpy strcasecmp strncasecmp telldir tempnam times ulltostr uselocale usleep utime vfprintf vfprintf_l vsprintf vsnprintf vsnprintf_l waitpid _wfopen _wstat])
 
 #
 # Check for clock_gettime().
@@ -1112,11 +1159,11 @@ AC_SEARCH_LIBS(clock_gettime, rt,
       [[#include <time.h>]],
        [[clockid_t clockType = CLOCK_REALTIME;]])],
       [
-        AC_MSG_NOTICE(yes)
-       AC_DEFINE([HAVE_CLOCK_REALTIME],[1],
+        AC_MSG_RESULT(yes)
+        AC_DEFINE([HAVE_CLOCK_REALTIME],[1],
           [Define to 1 if clock_gettime supports CLOCK_REALTIME.])
       ],
-      AC_MSG_NOTICE(no)
+      AC_MSG_RESULT(no)
     )
   ],
   [
@@ -1173,7 +1220,7 @@ if test "$with_magick_plus_plus" = 'yes'; then
     else
         have_magick_plus_plus='no (failed tests)'
     fi
-    AC_MSG_NOTICE([$have_magick_plus_plus])
+    AC_MSG_RESULT([$have_magick_plus_plus])
     LIBS="$OLIBS"
 fi
 AM_CONDITIONAL(WITH_MAGICK_PLUS_PLUS, test "$have_magick_plus_plus" = 'yes')
@@ -1221,7 +1268,7 @@ fi
 
 # Assume that delegate headers reside under same directory as ImageMagick
 # installation prefix.
-MAGICK_CPPFLAGS="-I$INCLUDE_DIR/ImageMagick $MAGICK_CPPFLAGS"
+MAGICK_CPPFLAGS="-I$INCLUDE_DIR/${PACKAGE_NAME}-$MAGICK_MAJOR_VERSION $MAGICK_CPPFLAGS"
 
 #
 # Find the X11 RGB database
@@ -1277,7 +1324,7 @@ case "${build_os}" in
     X11ConfigurePath=`$WinPathScript "$X11ConfigurePath=" 1`
   ;;
 esac
-AC_DEFINE_UNQUOTED(X11_CONFIGURE_PATH,"$X11ConfigurePath",Location of X11 configure files)
+AC_DEFINE_UNQUOTED(X11_CONFIGURE_PATH,"$X11ConfigurePath",[Location of X11 configure files])
 
 #
 # Find OpenMP library
@@ -1344,7 +1391,7 @@ have_umem='no'
 UMEM_LIBS=''
 if test "$with_umem" != 'no'; then
   AC_MSG_CHECKING(for UMEM support )
-  AC_MSG_NOTICE()
+  AC_MSG_RESULT()
   failed=0
   passed=0
   AC_CHECK_HEADER(umem.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
@@ -1353,17 +1400,17 @@ if test "$with_umem" != 'no'; then
   AC_MSG_CHECKING(if umem memory allocation library is complete)
   if test $passed -gt 0; then
     if test $failed -gt 0; then
-      AC_MSG_NOTICE(no -- some components failed test)
+      AC_MSG_RESULT(no -- some components failed test)
       have_umem='no (failed tests)'
     else
       UMEM_LIBS='-lumem'
       LIBS="$UMEM_LIBS $LIBS"
       AC_DEFINE(HasUMEM,1,Define if you have umem memory allocation library)
-      AC_MSG_NOTICE(yes)
+      AC_MSG_RESULT(yes)
       have_umem='yes'
     fi
   else
-    AC_MSG_NOTICE(no)
+    AC_MSG_RESULT(no)
   fi
 fi
 AM_CONDITIONAL(HasUMEM, test "$have_umem" = 'yes')
@@ -1419,9 +1466,9 @@ fi
 have_bzlib='no'
 if test "$with_bzlib" != 'no'; then
     BZLIB_LIBS=''
-    AC_MSG_NOTICE([-------------------------------------------------------------])
+    AC_MSG_RESULT([-------------------------------------------------------------])
     AC_MSG_CHECKING([for BZLIB])
-    AC_MSG_NOTICE([])
+    AC_MSG_RESULT([])
     failed=0
     passed=0
     found_libbz=0
@@ -1438,17 +1485,17 @@ if test "$with_bzlib" != 'no'; then
     AC_MSG_CHECKING(if BZLIB package is complete)
     if test $passed -gt 0; then
       if test $failed -gt 0; then
-        AC_MSG_NOTICE(no -- some components failed test)
+        AC_MSG_RESULT(no -- some components failed test)
         have_bzlib='no (failed tests)'
       else
         BZLIB_LIBS='-lbz2'
         LIBS="$BZLIB_LIBS $LIBS"
         AC_DEFINE(BZLIB_DELEGATE,1,Define if you have the bzip2 library)
-        AC_MSG_NOTICE(yes)
+        AC_MSG_RESULT(yes)
         have_bzlib='yes'
       fi
     else
-      AC_MSG_NOTICE(no)
+      AC_MSG_RESULT(no)
     fi
 fi
 AM_CONDITIONAL(BZLIB_DELEGATE, test "$have_bzlib" = 'yes')
@@ -1463,9 +1510,9 @@ XEXT_LIBS=''
 XT_LIBS=''
 AC_PATH_XTRA
 if test "$no_x" != 'yes'; then
-    AC_MSG_NOTICE([-------------------------------------------------------------])
+    AC_MSG_RESULT([-------------------------------------------------------------])
     AC_MSG_CHECKING([for X11])
-    AC_MSG_NOTICE([])
+    AC_MSG_RESULT([])
     LDFLAGS="$LDFLAGS $X_LIBS"
     X11_LIBS="$X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
     LIBS="$X11_LIBS $LIBS"
@@ -1524,9 +1571,9 @@ have_zlib='no'
 ZLIB_LIBS=''
 dnl PNG requires zlib so enable zlib check if PNG is requested
 if test "$with_zlib" != 'no' || test "$with_png" != 'no'; then
-    AC_MSG_NOTICE([-------------------------------------------------------------])
+    AC_MSG_RESULT([-------------------------------------------------------------])
     AC_MSG_CHECKING([for ZLIB])
-    AC_MSG_NOTICE([])
+    AC_MSG_RESULT([])
     ZLIB_LIBS=''
     failed=0
     passed=0
@@ -1541,22 +1588,55 @@ if test "$with_zlib" != 'no' || test "$with_png" != 'no'; then
     AC_MSG_CHECKING([if ZLIB package is complete])
     if test $passed -gt 0; then
         if test $failed -gt 0; then
-            AC_MSG_NOTICE([no -- some components failed test])
+            AC_MSG_RESULT([no -- some components failed test])
             have_zlib='no (failed tests)'
         else
             ZLIB_LIBS='-lz'
             LIBS="$ZLIB_LIBS $LIBS"
             AC_DEFINE(ZLIB_DELEGATE,1,Define if you have zlib compression library)
-            AC_MSG_NOTICE([yes])
+            AC_MSG_RESULT([yes])
             have_zlib='yes'
         fi
     else
-        AC_MSG_NOTICE([no])
+        AC_MSG_RESULT([no])
     fi
 fi
 AM_CONDITIONAL(ZLIB_DELEGATE, test "$have_zlib" = 'yes')
 AC_SUBST(ZLIB_LIBS)
 
+# whether modules are built or not.
+with_ltdl='yes'
+have_ltdl='no'
+LTDL_LIBS=''
+if test "$build_modules" != 'no' ; then
+  AC_MSG_RESULT([-------------------------------------------------------------])
+  AC_MSG_CHECKING([for libltdl])
+  AC_MSG_RESULT([])
+  failed=0
+  passed=0
+  AC_CHECK_HEADER([ltdl.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
+  AC_CHECK_LIB([ltdl],[lt_dlinit],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
+  AC_MSG_CHECKING([if libltdl package is complete])
+  if test $passed -gt 0 ; then
+    if test $failed -gt 0 ; then
+      AC_MSG_RESULT([no -- some components failed test])
+      have_ltdl='no (failed tests)'
+    else
+      LTDL_LIBS='-lltdl'
+      LIBS="$LTDL_LIBS $LIBS"
+      AC_DEFINE(LTDL_DELEGATE,1,[Define if using libltdl to support dynamically loadable modules])
+      AC_MSG_RESULT([yes])
+      have_ltdl='yes'
+    fi
+  else
+    AC_MSG_RESULT([no])
+  fi
+  if test "$have_ltdl" != 'yes' ; then
+    AC_MSG_FAILURE([libltdl is required for modules build],[1])
+  fi
+fi
+AM_CONDITIONAL(WITH_LTDL, test "$have_ltdl" != 'no')
+
 #
 # If profiling, then check for -ldl and dlopen (required for Solaris & gcc)
 #
@@ -1587,16 +1667,16 @@ AUTOTRACE_CFLAGS=""
 AUTOTRACE_LIBS=""
 AUTOTRACE_PKG=""
 if test "x$with_autotrace" = "xyes"; then
-    AC_MSG_NOTICE([-------------------------------------------------------------])
+    AC_MSG_RESULT([-------------------------------------------------------------])
     PKG_CHECK_MODULES(AUTOTRACE,[autotrace >= 0.31.1], have_autotrace=yes, have_autotrace=no)
-    AC_MSG_NOTICE([])
+    AC_MSG_RESULT([])
 fi
 
 if test "$have_autotrace" = 'yes'; then
     failed=0
     AC_DEFINE(AUTOTRACE_DELEGATE,1,Define if you have AUTOTRACE library)
-    if test "$with_modules" = 'no'; then
-    CPPFLAGS="$AUTOTRACE_CFLAGS $CPPFLAGS"
+    if test "$build_modules" = 'no'; then
+      CPPFLAGS="$AUTOTRACE_CFLAGS $CPPFLAGS"
     fi
 fi
 
@@ -1622,9 +1702,9 @@ fi
 have_dps='no'
 DPS_LIBS=''
 if test "$with_dps" != 'no' && test "$with_x" != 'no'; then
-    AC_MSG_NOTICE([-------------------------------------------------------------])
+    AC_MSG_RESULT([-------------------------------------------------------------])
     AC_MSG_CHECKING([for DPS])
-    AC_MSG_NOTICE([])
+    AC_MSG_RESULT([])
     failed=0
     passed=0
     PERSIST_CPPFLAGS="$CPPFLAGS"
@@ -1655,18 +1735,18 @@ if test "$with_dps" != 'no' && test "$with_x" != 'no'; then
     AC_MSG_CHECKING([if DPS package is complete])
     if test $passed -gt 0; then
         if test $failed -gt 0; then
-            AC_MSG_NOTICE([no -- some components failed test])
+            AC_MSG_RESULT([no -- some components failed test])
             have_dps='no (failed tests)'
             CPPFLAGS="$PERSIST_CPPFLAGS"
         else
             DPS_LIBS="-ldpstk -ldps ${LIBDPS_XT}"
             LIBS="$DPS_LIBS $LIBS"
             AC_DEFINE(DPS_DELEGATE,1,Define if you have Display Postscript)
-            AC_MSG_NOTICE([yes])
+            AC_MSG_RESULT([yes])
             have_dps='yes'
         fi
     else
-        AC_MSG_NOTICE([no])
+        AC_MSG_RESULT([no])
         CPPFLAGS=$PERSIST_CPPFLAGS
     fi
 fi
@@ -1691,9 +1771,9 @@ fi
 have_djvu='no'
 DJVU_LIBS=''
 if test "$with_djvu" != 'no'; then
-    AC_MSG_NOTICE([-------------------------------------------------------------])
+    AC_MSG_RESULT([-------------------------------------------------------------])
     AC_MSG_CHECKING([for DJVU])
-    AC_MSG_NOTICE([])
+    AC_MSG_RESULT([])
     failed=0
     passed=0
     AC_CHECK_HEADER(libdjvu/ddjvuapi.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
@@ -1701,17 +1781,17 @@ if test "$with_djvu" != 'no'; then
     AC_MSG_CHECKING([if DJVU package is complete])
     if test $passed -gt 0; then
         if test $failed -gt 0; then
-            AC_MSG_NOTICE([no -- some components failed test])
+            AC_MSG_RESULT([no -- some components failed test])
             have_djvu='no (failed tests)'
         else
             DJVU_LIBS='-ldjvulibre'
             LIBS="$DJVU_LIBS $LIBS"
             AC_DEFINE(DJVU_DELEGATE,1,Define if you have DJVU library)
-            AC_MSG_NOTICE([yes])
+            AC_MSG_RESULT([yes])
             have_djvu='yes'
         fi
     else
-        AC_MSG_NOTICE([no])
+        AC_MSG_RESULT([no])
     fi
 fi
 AM_CONDITIONAL(DJVU_DELEGATE, test "$have_djvu" = 'yes')
@@ -1750,9 +1830,9 @@ fi
 have_fftw='no'
 FFTW_LIBS=''
 if test "$with_fftw" != 'no'; then
-    AC_MSG_NOTICE([-------------------------------------------------------------])
+    AC_MSG_RESULT([-------------------------------------------------------------])
     AC_MSG_CHECKING([for FFTW])
-    AC_MSG_NOTICE([])
+    AC_MSG_RESULT([])
     failed=0
     passed=0
     AC_CHECK_HEADER(fftw3.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
@@ -1760,17 +1840,17 @@ if test "$with_fftw" != 'no'; then
     AC_MSG_CHECKING([if FFTW package is complete])
     if test $passed -gt 0; then
         if test $failed -gt 0; then
-            AC_MSG_NOTICE([no -- some components failed test])
+            AC_MSG_RESULT([no -- some components failed test])
             have_fftw='no (failed tests)'
         else
             FFTW_LIBS='-lfftw3'
             LIBS="$FFTW_LIBS $LIBS"
             AC_DEFINE(FFTW_DELEGATE,1,Define if you have FFTW library)
-            AC_MSG_NOTICE([yes])
+            AC_MSG_RESULT([yes])
             have_fftw='yes'
         fi
     else
-        AC_MSG_NOTICE([no])
+        AC_MSG_RESULT([no])
     fi
 fi
 AM_CONDITIONAL(FFTW_DELEGATE, test "$have_fftw" = 'yes')
@@ -1794,9 +1874,9 @@ fi
 have_fpx='no'
 FPX_LIBS=''
 if test "$with_fpx" != 'no'; then
-    AC_MSG_NOTICE([-------------------------------------------------------------])
+    AC_MSG_RESULT([-------------------------------------------------------------])
     AC_MSG_CHECKING([for FlashPIX])
-    AC_MSG_NOTICE([])
+    AC_MSG_RESULT([])
     failed=0
     passed=0
     AC_LANG_PUSH(C++)
@@ -1806,17 +1886,17 @@ if test "$with_fpx" != 'no'; then
     AC_MSG_CHECKING([if FlashPIX package is complete])
     if test $passed -gt 0; then
         if test $failed -gt 0; then
-            AC_MSG_NOTICE([no -- some components failed test])
+            AC_MSG_RESULT([no -- some components failed test])
             have_fpx='no (failed tests)'
         else
             FPX_LIBS='-lfpx'
             AC_DEFINE(FPX_DELEGATE,1,Define if you have FlashPIX library)
-            AC_MSG_NOTICE([yes])
+            AC_MSG_RESULT([yes])
             have_fpx='yes'
             PERLMAINCC="$CXX"
         fi
     else
-        AC_MSG_NOTICE([no])
+        AC_MSG_RESULT([no])
     fi
 fi
 AM_CONDITIONAL(FPX_DELEGATE, test "$have_fpx" = 'yes')
@@ -1842,14 +1922,14 @@ FONTCONFIG_CFLAGS=""
 FONTCONFIG_LIBS=""
 FONTCONFIG_PKG=""
 if test "x$with_fontconfig" = "xyes"; then
-    AC_MSG_NOTICE([-------------------------------------------------------------])
+    AC_MSG_RESULT([-------------------------------------------------------------])
     PKG_CHECK_MODULES(FONTCONFIG,[fontconfig >= 2.1.0], have_fontconfig=yes, have_fontconfig=no)
-    AC_MSG_NOTICE([])
+    AC_MSG_RESULT([])
 fi
 
 if test "$have_fontconfig" = 'yes'; then
   AC_DEFINE(FONTCONFIG_DELEGATE,1,Define if you have FONTCONFIG library)
-  if test "$with_modules" = 'no'; then
+  if test "$build_modules" = 'no'; then
     CPPFLAGS="$FONTCONFIG_CFLAGS $CPPFLAGS"
   fi
 fi
@@ -1861,7 +1941,7 @@ AC_SUBST(FONTCONFIG_LIBS)
 dnl ===========================================================================
 
 #
-# Check for freetype delegate library.
+# Check for the Freetype delegate library.
 #
 AC_ARG_WITH([freetype],
     [AC_HELP_STRING([--without-freetype],
@@ -1869,81 +1949,27 @@ AC_ARG_WITH([freetype],
     [with_freetype=$withval],
     [with_freetype='yes'])
 
-
 if test "$with_freetype" != 'yes'; then
     DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-freetype=$with_freetype "
 fi
 
 have_freetype='no'
-FREETYPE_LIBS=''
-if test "$with_freetype" != 'no'; then
-    AC_MSG_NOTICE([-------------------------------------------------------------])
-    AC_MSG_CHECKING(for FreeType 2.0 )
-    AC_MSG_NOTICE()
-    failed=0
-    passed=0
-    PERSIST_LDFLAGS="$LDFLAGS"
-    PERSIST_CPPFLAGS="$CPPFLAGS"
-    freetype_config=''
-    # Allow the user to specify the location of freetype.
-    if test "$with_freetype" != 'yes'; then
-      if test -x "${with_freetype}/bin/freetype-config"; then
-        freetype_config="${with_freetype}/bin/freetype-config"
-      elif test -x "${with_freetype}"; then
-        freetype_config=${with_freetype}
-      fi
-    fi
-    if test -z "$freetype_config"; then
-      AC_PATH_PROG(freetype_config,freetype-config,)dnl
-    fi
-    if test -n "$freetype_config"; then
-      freetype_prefix=`${freetype_config} --prefix`
-      freetype_exec_prefix=`${freetype_config} --exec-prefix`
-      LDFLAGS="$LDFLAGS -L${freetype_exec_prefix}/lib"
-      CPPFLAGS="$CPPFLAGS -I${freetype_prefix}/include/freetype2"
-    fi
-
-dnl First see if there is a library
-    if test "$FREETYPE_LIBS" = ''; then
-      AC_CHECK_LIB(freetype,FT_Init_FreeType,FREETYPE_LIBS='-lfreetype',,)
-      if test "$FREETYPE_LIBS" != ''; then
-        passed=`expr $passed + 1`
-      else
-        failed=`expr $failed + 1`
-        LDFLAGS="$PERSIST_LDFLAGS"
-      fi
-    fi
-
-dnl Now test for the headers
-    AC_CHECK_HEADER([ft2build.h],[FT2BUILD_H='#include <ft2build.h>'],[ft2build=''],[])
-    AC_CHECK_HEADER(freetype/freetype.h,[have_freetype_h='yes'],[have_freetype_h='no'],[$FT2BUILD_H])
-    if test "$have_freetype_h" = 'yes'; then
-      passed=`expr $passed + 1`
-    else
-      failed=`expr $failed + 1`
-      CPPFLAGS="$PERSIST_CPPFLAGS"
-    fi
+FREETYPE_CFLAGS=""
+FREETYPE_LIBS=""
+FREETYPE_PKG=""
+if test "x$with_freetype" = "xyes"; then
+    AC_MSG_RESULT([-------------------------------------------------------------])
+    PKG_CHECK_MODULES(FREETYPE,[freetype2], have_freetype=yes, have_freetype=no)
+    AC_MSG_RESULT([])
+fi
 
-    AC_MSG_CHECKING(if FreeType package is complete)
-    if test $passed -gt 0; then
-      if test $failed -gt 0; then
-        FREETYPE_LIBS=''
-        AC_MSG_NOTICE(no -- some components failed test)
-        have_freetype='no (failed tests)'
-      else
-        LIBS="$FREETYPE_LIBS $LIBS"
-        AC_DEFINE(FREETYPE_DELEGATE,1,Define if you have FreeType (TrueType font) library)
-        if test "$ac_cv_header_ft2build_h" = 'yes'; then
-          AC_DEFINE([HAVE_FT2BUILD_H],[1],[Define to 1 if you have the <ft2build.h> header file.])
-        fi
-        AC_MSG_NOTICE(yes)
-        have_freetype='yes'
-      fi
-    else
-      AC_MSG_NOTICE(no)
-    fi
+if test "$have_freetype" = 'yes'; then
+    AC_DEFINE(FREETYPE_DELEGATE,1,Define if you have FREETYPE library)
+    CFLAGS="$FREETYPE_CFLAGS $CFLAGS"
 fi
+
 AM_CONDITIONAL(FREETYPE_DELEGATE, test "$have_freetype" = 'yes')
+AC_SUBST(FREETYPE_CFLAGS)
 AC_SUBST(FREETYPE_LIBS)
 
 dnl ===========================================================================
@@ -1955,7 +1981,7 @@ dnl ===========================================================================
 # or -framework Ghostscript
 
 AC_ARG_WITH([gslib],
-    [AC_HELP_STRING([--without-gslib],
+    [AC_HELP_STRING([--with-gslib],
                     [enable Ghostscript library support])],
     [with_gslib=$withval],
     [with_gslib='no'])
@@ -1968,9 +1994,9 @@ fi
 have_gslib='no'
 GS_LIBS=''
 if test "$with_gslib" != 'no'; then
-    AC_MSG_NOTICE([-------------------------------------------------------------])
+    AC_MSG_RESULT([-------------------------------------------------------------])
     AC_MSG_CHECKING([for Ghostscript])
-    AC_MSG_NOTICE([])
+    AC_MSG_RESULT([])
     framework=0
     failed=0
     passed=0
@@ -1983,15 +2009,15 @@ if test "$with_gslib" != 'no'; then
     AC_MSG_CHECKING([if Ghostscript package is complete])
     if test $passed -gt 0; then
         if test $failed -gt 0; then
-            AC_MSG_NOTICE([no -- some components failed test])
+            AC_MSG_RESULT([no -- some components failed test])
             have_gslib='no (failed tests)'
         else
             if test $framework -gt 0; then
                 GS_LIBS='-framework Ghostscript'
                 gslib_framework='yes'
-                AC_MSG_NOTICE([yes, using framework.])
+                AC_MSG_RESULT([yes, using framework.])
             else
-                AC_MSG_NOTICE([yes, using library.])
+                AC_MSG_RESULT([yes, using library.])
                 GS_LIBS='-lgs'
             fi
             LIBS="$GS_LIBS $LIBS"
@@ -1999,7 +2025,7 @@ if test "$with_gslib" != 'no'; then
             have_gslib='yes'
         fi
     else
-        AC_MSG_NOTICE([no])
+        AC_MSG_RESULT([no])
     fi
 fi
 AM_CONDITIONAL(GS_DELEGATE, test "$have_gslib" = 'yes')
@@ -2015,7 +2041,7 @@ AC_ARG_WITH([fontpath],
 if test "$with_fontpath" != "yes" && test -z "$with_fontpath"; then
     with_fontpath=''
 else
-    AC_DEFINE_UNQUOTED(MAGICK_FONT_PATH,"$with_fontpath",Define to prepend to default font search path.)
+    AC_DEFINE_UNQUOTED(MAGICK_FONT_PATH,"$with_fontpath",[Define to prepend to default font search path.])
 fi
 if test "$with_fontpath=" != ''; then
     DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fontpath=$with_fontpath "
@@ -2039,7 +2065,7 @@ dnl ===========================================================================
 #
 AC_ARG_WITH(gvc,
     [AC_HELP_STRING([--with-gvc],
-                    [disable GVC support])],
+                    [enable GVC support])],
     [with_gvc=$withval],
     [with_gvc='no'])
 
@@ -2049,14 +2075,14 @@ fi
 
 GVC_PKG=""
 if test "x$with_gvc" = "xyes"; then
-    AC_MSG_NOTICE([-------------------------------------------------------------])
+    AC_MSG_RESULT([-------------------------------------------------------------])
     PKG_CHECK_MODULES(GVC,[libgvc >= 2.9.0], have_gvc=yes, have_gvc=no)
-    AC_MSG_NOTICE([])
+    AC_MSG_RESULT([])
 fi
 
 if test "$have_gvc" = 'yes'; then
     AC_DEFINE(GVC_DELEGATE,1,Define if you have GVC library)
-    if test "$with_modules" = 'no'; then
+    if test "$build_modules" = 'no'; then
         CPPFLAGS="$GVC_CFLAGS $CPPFLAGS"
     fi
 fi
@@ -2080,9 +2106,9 @@ AC_ARG_WITH([jbig],
 have_jbig='no'
 JBIG_LIBS=''
 if test "$with_jbig" != 'no'; then
-    AC_MSG_NOTICE([-------------------------------------------------------------])
+    AC_MSG_RESULT([-------------------------------------------------------------])
     AC_MSG_CHECKING([for JBIG])
-    AC_MSG_NOTICE([])
+    AC_MSG_RESULT([])
     failed=0
     passed=0
     AC_CHECK_HEADER(jbig.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
@@ -2090,17 +2116,17 @@ if test "$with_jbig" != 'no'; then
     AC_MSG_CHECKING([if JBIG package is complete])
     if test $passed -gt 0; then
         if test $failed -gt 0; then
-            AC_MSG_NOTICE([no -- some components failed test])
+            AC_MSG_RESULT([no -- some components failed test])
             have_jbig='no (failed tests)'
         else
             JBIG_LIBS='-ljbig'
             LIBS="$JBIG_LIBS $LIBS"
             AC_DEFINE(JBIG_DELEGATE,1,Define if you have JBIG library)
-            AC_MSG_NOTICE([yes])
+            AC_MSG_RESULT([yes])
             have_jbig='yes'
         fi
     else
-        AC_MSG_NOTICE([no])
+        AC_MSG_RESULT([no])
     fi
 fi
 AM_CONDITIONAL(JBIG_DELEGATE, test "$have_jbig" = 'yes')
@@ -2124,9 +2150,9 @@ fi
 have_jpeg='no'
 JPEG_LIBS=''
 if test "$with_jpeg" != 'no'; then
-    AC_MSG_NOTICE([-------------------------------------------------------------])
+    AC_MSG_RESULT([-------------------------------------------------------------])
     AC_MSG_CHECKING([for JPEG])
-    AC_MSG_NOTICE([])
+    AC_MSG_RESULT([])
     failed=0
     passed=0
     AC_CHECK_HEADER(jconfig.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
@@ -2157,17 +2183,17 @@ fi
     AC_MSG_CHECKING([if JPEG package is complete])
     if test $passed -gt 0; then
         if test $failed -gt 0; then
-            AC_MSG_NOTICE([no -- some components failed test])
+            AC_MSG_RESULT([no -- some components failed test])
             have_jpeg='no (failed tests)'
         else
             JPEG_LIBS='-ljpeg'
             LIBS="$JPEG_LIBS $LIBS"
             AC_DEFINE(JPEG_DELEGATE,1,Define if you have JPEG library)
-            AC_MSG_NOTICE([yes])
+            AC_MSG_RESULT([yes])
             have_jpeg='yes'
         fi
     else
-        AC_MSG_NOTICE([no])
+        AC_MSG_RESULT([no])
     fi
 fi
 AM_CONDITIONAL(JPEG_DELEGATE, test "$have_jpeg" = 'yes')
@@ -2191,9 +2217,9 @@ fi
 have_jp2='no'
 JP2_LIBS=''
 if test "$with_jp2" != 'no'; then
-    AC_MSG_NOTICE([-------------------------------------------------------------])
+    AC_MSG_RESULT([-------------------------------------------------------------])
     AC_MSG_CHECKING([for JPEG Version 2])
-    AC_MSG_NOTICE([])
+    AC_MSG_RESULT([])
     failed=0
     passed=0
     AC_CHECK_HEADER(jasper/jasper.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
@@ -2201,17 +2227,17 @@ if test "$with_jp2" != 'no'; then
     AC_MSG_CHECKING([if JPEG version 2 support package is complete])
     if test $passed -gt 0; then
         if test $failed -gt 0; then
-            AC_MSG_NOTICE([no -- some components failed test])
+            AC_MSG_RESULT([no -- some components failed test])
             have_jp2='no (failed tests)'
         else
             JP2_LIBS='-ljasper'
             LIBS="$JP2_LIBS $LIBS"
             AC_DEFINE(JP2_DELEGATE,1,Define if you have JPEG version 2 "Jasper" library)
-            AC_MSG_NOTICE([yes])
+            AC_MSG_RESULT([yes])
             have_jp2='yes'
         fi
     else
-        AC_MSG_NOTICE([no])
+        AC_MSG_RESULT([no])
     fi
 fi
 AM_CONDITIONAL(JP2_DELEGATE, test "$have_jp2" = 'yes')
@@ -2243,9 +2269,9 @@ fi
 have_lcms2='no'
 LCMS_LIBS=''
 if test "$with_lcms2" != 'no'; then
-    AC_MSG_NOTICE([-------------------------------------------------------------])
+    AC_MSG_RESULT([-------------------------------------------------------------])
     AC_MSG_CHECKING([for LCMS v2])
-    AC_MSG_NOTICE()
+    AC_MSG_RESULT()
     failed=0
     passed=0
     have_lcms_header='no'
@@ -2275,16 +2301,16 @@ if test "$with_lcms2" != 'no'; then
     AC_MSG_CHECKING(if LCMS v2 package is complete)
     if test $passed -gt 0; then
       if test $failed -gt 0; then
-        AC_MSG_NOTICE(no -- some components failed test)
+        AC_MSG_RESULT(no -- some components failed test)
         have_lcms2='no (failed tests)'
       else
         LCMS_LIBS='-llcms2'
         LIBS="$LCMS_LIBS $LIBS"
-        AC_MSG_NOTICE(yes)
+        AC_MSG_RESULT(yes)
         have_lcms2='yes'
       fi
     else
-      AC_MSG_NOTICE(no)
+      AC_MSG_RESULT(no)
     fi
 fi
 
@@ -2297,9 +2323,9 @@ fi
 
 have_lcms='no'
 if test "$with_lcms" != 'no'; then
-    AC_MSG_NOTICE([-------------------------------------------------------------])
+    AC_MSG_RESULT([-------------------------------------------------------------])
     AC_MSG_CHECKING([for LCMS v1.1X])
-    AC_MSG_NOTICE()
+    AC_MSG_RESULT()
     failed=0
     passed=0
     have_lcms_header='no'
@@ -2331,16 +2357,16 @@ if test "$with_lcms" != 'no'; then
     AC_MSG_CHECKING(if LCMS package is complete)
     if test $passed -gt 0; then
       if test $failed -gt 0; then
-        AC_MSG_NOTICE(no -- some components failed test)
+        AC_MSG_RESULT(no -- some components failed test)
         have_lcms='no (failed tests)'
       else
         LCMS_LIBS='-llcms'
         LIBS="$LCMS_LIBS $LIBS"
-        AC_MSG_NOTICE(yes)
+        AC_MSG_RESULT(yes)
         have_lcms='yes'
       fi
     else
-      AC_MSG_NOTICE(no)
+      AC_MSG_RESULT(no)
     fi
 fi
 
@@ -2371,9 +2397,9 @@ LQR_CFLAGS=""
 LQR_LIBS=""
 LQR_PKG=""
 if test "x$with_lqr" = "xyes"; then
-    AC_MSG_NOTICE([-------------------------------------------------------------])
+    AC_MSG_RESULT([-------------------------------------------------------------])
     PKG_CHECK_MODULES(LQR,[lqr-1 >= 0.1.0], have_lqr=yes, have_lqr=no)
-    AC_MSG_NOTICE([])
+    AC_MSG_RESULT([])
 fi
 
 if test "$have_lqr" = 'yes'; then
@@ -2389,23 +2415,23 @@ dnl ===========================================================================
 
 # Disable LZMA (lzma library)
 AC_ARG_WITH(lzma,
-             [  --without-lzma          disable LZMA support],
-             [with_lzma=$withval],
-             [with_lzma='yes'])
+            [  --without-lzma          disable LZMA support],
+            [with_lzma=$withval],
+            [with_lzma='yes'])
 if test "$with_lzma" != 'yes' ; then
     DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-lzma=$with_lzma "
 fi
 
 LZMA_PKG=""
 if test "x$with_lzma" = "xyes"; then
-    AC_MSG_NOTICE([-------------------------------------------------------------])
+    AC_MSG_RESULT([-------------------------------------------------------------])
     PKG_CHECK_MODULES(LZMA,[liblzma >= 2.9.0], have_lzma=yes, have_lzma=no)
-    AC_MSG_NOTICE([])
+    AC_MSG_RESULT([])
 fi
 
 if test "$have_lzma" = 'yes'; then
     AC_DEFINE(LZMA_DELEGATE,1,Define if you have LZMA library)
-    if test "$with_modules" = 'no'; then
+    if test "$build_modules" = 'no'; then
         CPPFLAGS="$LZMA_CFLAGS $CPPFLAGS"
     fi
 fi
@@ -2434,14 +2460,14 @@ OPENEXR_CFLAGS=""
 OPENEXR_LIBS=""
 OPENEXR_PKG=""
 if test "x$with_openexr" = "xyes"; then
-    AC_MSG_NOTICE([-------------------------------------------------------------])
+    AC_MSG_RESULT([-------------------------------------------------------------])
     PKG_CHECK_MODULES(OPENEXR,[OpenEXR >= 1.0.6], have_openexr=yes, have_openexr=no)
-    AC_MSG_NOTICE([])
+    AC_MSG_RESULT([])
 fi
 
 if test "$have_openexr" = 'yes'; then
     AC_DEFINE(OPENEXR_DELEGATE,1,Define if you have OPENEXR library)
-    if test "$with_modules" = 'no'; then
+    if test "$build_modules" = 'no'; then
         CFLAGS="$OPENEXR_CFLAGS $CFLAGS"
     fi
 fi
@@ -2480,14 +2506,14 @@ fi
 
 if test "$have_pango" = 'yes'; then
     AC_DEFINE(PANGO_DELEGATE,1,Define if you have PANGO library)
-    if test "$with_modules" = 'no'; then
+    if test "$build_modules" = 'no'; then
         CPPFLAGS="$PANGO_CFLAGS $CPPFLAGS"
     fi
 fi
 
 if test "$have_pangocairo" = 'yes'; then
     AC_DEFINE(PANGOCAIRO_DELEGATE,1,Define if you have PANGOCAIRO library)
-    if test "$with_modules" = 'no'; then
+    if test "$build_modules" = 'no'; then
         CPPFLAGS="$PANGOCAIRO_CFLAGS $CPPFLAGS"
     fi
 fi
@@ -2516,16 +2542,16 @@ have_png='no'
 PNG_LIBS=''
 
 if test "$with_png" != 'no' -a  "$have_zlib" != 'no' ; then
-  AC_MSG_NOTICE([-------------------------------------------------------------])
+  AC_MSG_RESULT([-------------------------------------------------------------])
   AC_MSG_CHECKING(for PNG support )
-  AC_MSG_NOTICE()
+  AC_MSG_RESULT()
   failed=0
   passed=0
   AC_CHECK_HEADER(png.h,passed=`expr $passed + 1`,
      failed=`expr $failed + 1`,)
 
   if test $passed -gt 0; then
-    for var in 5 4 2 '' ; do
+    for var in 7 6 5 4 2 '' ; do
       if test "$have_png" = 'no' ; then
         if test "x${var}" = 'x' ; then
           pnglib='png'
@@ -2557,18 +2583,30 @@ return 0;
             ac_cv_libpng_ok='no')
             if test "$ac_cv_libpng_ok" = 'yes' ; then
               passed=`expr $passed + 1`
-              AC_MSG_NOTICE(yes)
+              AC_MSG_RESULT(yes)
             else
               failed=`expr $failed + 1`
-              AC_MSG_NOTICE(no)
+              AC_MSG_RESULT(no)
             fi
           else
             passed=`expr $passed + 1`
-            AC_MSG_NOTICE(yes)
+            AC_MSG_RESULT(yes)
           fi
         fi
 
         if test $passed -gt 0 -a $failed -le 0; then
+          if test "1${var}" = '17' ; then
+            AC_CHECK_LIB(png17,png_get_io_ptr,passed=`expr $passed + 1`,
+               failed=`expr $failed + 1`,)
+            AC_CHECK_LIB(png17,png_longjmp,passed=`expr $passed + 1`,
+               failed=`expr $failed + 1`,)
+          fi
+          if test "1${var}" = '16' ; then
+            AC_CHECK_LIB(png16,png_get_io_ptr,passed=`expr $passed + 1`,
+               failed=`expr $failed + 1`,)
+            AC_CHECK_LIB(png16,png_longjmp,passed=`expr $passed + 1`,
+               failed=`expr $failed + 1`,)
+          fi
           if test "1${var}" = '15' ; then
             AC_CHECK_LIB(png15,png_get_io_ptr,passed=`expr $passed + 1`,
                failed=`expr $failed + 1`,)
@@ -2593,13 +2631,13 @@ return 0;
             AC_MSG_CHECKING(if ${pnglib} package is complete)
             if test $passed -gt 0 ; then
               if test $failed -gt 0 ; then
-                  AC_MSG_NOTICE(no -- some components failed test)
+                  AC_MSG_RESULT(no -- some components failed test)
                   have_png='no (failed tests)'
               else
                   PNG_LIBS="-l${pnglib}"
                   LIBS="$PNG_LIBS $LIBS"
                   AC_DEFINE(PNG_DELEGATE,1,Define if you have PNG library)
-                  AC_MSG_NOTICE(yes)
+                  AC_MSG_RESULT(yes)
                   have_png='yes'
               fi
             fi
@@ -2635,23 +2673,23 @@ RSVG_CFLAGS=""
 RSVG_LIBS=""
 RSVG_PKG=""
 if test "x$with_rsvg" = "xyes"; then
-    AC_MSG_NOTICE([-------------------------------------------------------------])
+    AC_MSG_RESULT([-------------------------------------------------------------])
     PKG_CHECK_MODULES(RSVG,[librsvg-2.0 >= 2.9.0], have_rsvg=yes, have_rsvg=no)
-    AC_MSG_NOTICE([])
+    AC_MSG_RESULT([])
     PKG_CHECK_MODULES(CAIRO_SVG, cairo-svg, have_cairo=yes, have_cairo=no)
-    AC_MSG_NOTICE([])
+    AC_MSG_RESULT([])
 fi
 
 if test "$have_rsvg" = 'yes'; then
     AC_DEFINE(RSVG_DELEGATE,1,Define if you have RSVG library)
-    if test "$with_modules" = 'no'; then
+    if test "$build_modules" = 'no'; then
         CPPFLAGS="$RSVG_CFLAGS $CPPFLAGS"
     fi
 fi
 
 if test "$have_cairo" = 'yes'; then
     AC_DEFINE(CAIRO_DELEGATE,1,Define if you have CAIRO library)
-    if test "$with_modules" = 'no'; then
+    if test "$build_modules" = 'no'; then
         CPPFLAGS="$CAIRO_SVG_CFLAGS $CPPFLAGS"
     fi
 fi
@@ -2679,9 +2717,9 @@ fi
 have_tiff='no'
 TIFF_LIBS=''
 if test "$with_tiff" != 'no'; then
-    AC_MSG_NOTICE([-------------------------------------------------------------])
+    AC_MSG_RESULT([-------------------------------------------------------------])
     AC_MSG_CHECKING([for TIFF])
-    AC_MSG_NOTICE([])
+    AC_MSG_RESULT([])
     failed=0
     passed=0
     AC_CHECK_HEADER(tiff.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
@@ -2694,13 +2732,13 @@ if test "$with_tiff" != 'no'; then
     AC_MSG_CHECKING([if TIFF package is complete])
     if test $passed -gt 0; then
         if test $failed -gt 0; then
-            AC_MSG_NOTICE([no -- some components failed test])
+            AC_MSG_RESULT([no -- some components failed test])
             have_tiff='no (failed tests)'
         else
             TIFF_LIBS='-ltiff'
             LIBS="$TIFF_LIBS $LIBS"
             AC_DEFINE(TIFF_DELEGATE,1,Define if you have TIFF library)
-            AC_MSG_NOTICE([yes])
+            AC_MSG_RESULT([yes])
             have_tiff='yes'
             AC_CHECK_HEADERS(tiffconf.h)
             AC_CHECK_FUNCS([TIFFIsCODECConfigured TIFFMergeFieldInfo \
@@ -2709,7 +2747,7 @@ if test "$with_tiff" != 'no'; then
               TIFFSwabArrayOfTriples])
         fi
     else
-        AC_MSG_NOTICE([no])
+        AC_MSG_RESULT([no])
     fi
 fi
 AM_CONDITIONAL(TIFF_DELEGATE, test "$have_tiff" = 'yes')
@@ -2733,27 +2771,27 @@ fi
 have_webp='no'
 WEBP_LIBS=''
 if test "$with_webp" != 'no'; then
-    AC_MSG_NOTICE([-------------------------------------------------------------])
+    AC_MSG_RESULT([-------------------------------------------------------------])
     AC_MSG_CHECKING([for WEBP])
-    AC_MSG_NOTICE([])
+    AC_MSG_RESULT([])
     failed=0
     passed=0
     AC_CHECK_HEADER(webp/decode.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
-    AC_CHECK_LIB(webp,WebPDecodeRGB,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
+    AC_CHECK_LIB(webp,WebPPictureInitInternal,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
     AC_MSG_CHECKING([if WEBP package is complete])
     if test $passed -gt 0; then
         if test $failed -gt 0; then
-            AC_MSG_NOTICE([no -- some components failed test])
+            AC_MSG_RESULT([no -- some components failed test])
             have_webp='no (failed tests)'
         else
             WEBP_LIBS='-lwebp'
             LIBS="$WEBP_LIBS $LIBS"
             AC_DEFINE(WEBP_DELEGATE,1,Define if you have WEBP library)
-            AC_MSG_NOTICE([yes])
+            AC_MSG_RESULT([yes])
             have_webp='yes'
         fi
     else
-        AC_MSG_NOTICE([no])
+        AC_MSG_RESULT([no])
     fi
 fi
 AM_CONDITIONAL(WEBP_DELEGATE,test "$have_webp" = 'yes')
@@ -2860,9 +2898,9 @@ fi
 have_xml='no'
 XML_LIBS=''
 if test "$with_xml" != 'no'; then
-    AC_MSG_NOTICE([-------------------------------------------------------------])
+    AC_MSG_RESULT([-------------------------------------------------------------])
     AC_MSG_CHECKING([for XML])
-    AC_MSG_NOTICE([])
+    AC_MSG_RESULT([])
     PERSIST_LDFLAGS=$LDFLAGS
     PERSIST_CPPFLAGS=$CPPFLAGS
     xml2_config=''
@@ -2888,7 +2926,7 @@ if test "$with_xml" != 'no'; then
     AC_MSG_CHECKING([if XML package is complete])
     if test $passed -gt 0; then
         if test $failed -gt 0; then
-            AC_MSG_NOTICE([no -- some components failed test])
+            AC_MSG_RESULT([no -- some components failed test])
             have_xml='no (failed tests)'
             LDFLAGS="$PERSIST_LDFLAGS"
             CPPFLAGS="$PERSIST_CPPFLAGS"
@@ -2896,11 +2934,11 @@ if test "$with_xml" != 'no'; then
             XML_LIBS='-lxml2'
             LIBS="$XML_LIBS $LIBS"
             AC_DEFINE(XML_DELEGATE,1,Define if you have XML library)
-            AC_MSG_NOTICE([yes])
+            AC_MSG_RESULT([yes])
             have_xml='yes'
         fi
     else
-        AC_MSG_NOTICE([no])
+        AC_MSG_RESULT([no])
     fi
 fi
 AM_CONDITIONAL(XML_DELEGATE,test "$have_xml" = 'yes')
@@ -2917,20 +2955,31 @@ AC_SUBST(PERLMAINCC)
 #
 
 # Path to ImageMagick header files
-INCLUDE_RELATIVE_PATH="ImageMagick"
-INCLUDE_PATH="${INCLUDEARCH_DIR}/${INCLUDE_RELATIVE_PATH}"
-DEFINE_INCLUDE_PATH="${INCLUDEARCH_DIR}/${INCLUDE_RELATIVE_PATH}/"
+INCLUDE_RELATIVE_PATH="${PACKAGE_NAME}-${MAGICK_MAJOR_VERSION}"
+INCLUDE_PATH="${INCLUDE_DIR}/${INCLUDE_RELATIVE_PATH}"
+DEFINE_INCLUDE_PATH="${INCLUDE_DIR}/${INCLUDE_RELATIVE_PATH}/"
 case "${build_os}" in
   mingw* )
     DEFINE_INCLUDE_PATH=`$WinPathScript "$DEFINE_INCLUDE_PATH" 1`
     ;;
 esac
-AC_DEFINE_UNQUOTED(INCLUDE_PATH,"$DEFINE_INCLUDE_PATH",Directory where ImageMagick headers live.)
+AC_DEFINE_UNQUOTED(INCLUDE_PATH,"$DEFINE_INCLUDE_PATH",[Directory where ImageMagick headers live.])
 AC_SUBST(INCLUDE_PATH)
 
+# Path to ImageMagick header files (arch part)
+INCLUDEARCH_PATH="${INCLUDEARCH_DIR}/${INCLUDE_RELATIVE_PATH}"
+DEFINE_INCLUDEARCH_PATH="${INCLUDEARCH_DIR}/${INCLUDE_RELATIVE_PATH}/"
+case "${build_os}" in
+  mingw* )
+    DEFINE_INCLUDEARCH_PATH=`$WinPathScript "$DEFINE_INCLUDEARCH_PATH" 1`
+    ;;
+esac
+AC_DEFINE_UNQUOTED(INCLUDEARCH_PATH,"$DEFINE_INCLUDE_PATH",[Directory where ImageMagick architecture headers live.])
+AC_SUBST(INCLUDEARCH_PATH)
+
 # Subdirectory under lib to place ImageMagick lib files
 LIBRARY_RELATIVE_PATH="${PACKAGE_NAME}-${PACKAGE_VERSION}"
-AC_DEFINE_UNQUOTED(LIBRARY_RELATIVE_PATH,"$LIBRARY_RELATIVE_PATH",Subdirectory of lib where ImageMagick architecture dependent files are installed)
+AC_DEFINE_UNQUOTED(LIBRARY_RELATIVE_PATH,"$LIBRARY_RELATIVE_PATH",[Subdirectory of lib where ImageMagick architecture dependent files are installed.])
 
 # Path to ImageMagick bin directory
 EXECUTABLE_PATH="${BIN_DIR}"
@@ -2940,7 +2989,7 @@ case "${build_os}" in
     DEFINE_EXECUTABLE_PATH=`$WinPathScript "$DEFINE_EXECUTABLE_PATH" 1`
     ;;
 esac
-AC_DEFINE_UNQUOTED(EXECUTABLE_PATH,"$DEFINE_EXECUTABLE_PATH",Directory where executables are installed.)
+AC_DEFINE_UNQUOTED(EXECUTABLE_PATH,"$DEFINE_EXECUTABLE_PATH",[Directory where executables are installed.])
 AC_SUBST(EXECUTABLE_PATH)
 
 # Path to ImageMagick lib
@@ -2951,40 +3000,76 @@ case "${build_os}" in
     DEFINE_LIBRARY_PATH=`$WinPathScript "$DEFINE_LIBRARY_PATH" 1`
     ;;
 esac
-AC_DEFINE_UNQUOTED(LIBRARY_PATH,"$DEFINE_LIBRARY_PATH",Directory where architecture-dependent files live.)
+AC_DEFINE_UNQUOTED(LIBRARY_PATH,"$DEFINE_LIBRARY_PATH",[Directory where architecture-dependent files live.])
 AC_SUBST(LIBRARY_PATH)
 
 #
-# Subdirectory under lib to place ImageMagick coder module files
-CODER_RELATIVE_PATH="${LIBRARY_RELATIVE_PATH}/modules-Q${QUANTUM_DEPTH}/coders"
-AC_DEFINE_UNQUOTED(CODER_RELATIVE_PATH,"$CODER_RELATIVE_PATH",Subdirectory of lib where coder modules are installed)
-CODER_PATH="${LIB_DIR}/${CODER_RELATIVE_PATH}"
-DEFINE_CODER_PATH="${LIB_DIR}/${CODER_RELATIVE_PATH}/"
-case "${build_os}" in
-  mingw* )
-    DEFINE_CODER_PATH=`$WinPathScript "$DEFINE_CODER_PATH" 1`
-    ;;
-esac
-AC_DEFINE_UNQUOTED(CODER_PATH,"$DEFINE_CODER_PATH",Location of coder modules)
+# path to local binaries
+if test "x$LIB_BIN_BASEDIRNAME" = "x"; then
+   LIB_BIN_BASEDIRNAME="bin"
+fi
+AC_DEFINE_UNQUOTED(LIB_BIN_BASEDIRNAME,"$LIB_BIN_BASEDIRNAME",[Binaries in libraries path base name (will be during install linked to bin)])
+AC_SUBST(LIB_BIN_BASEDIRNAME)
+
+if test "x$LIB_BIN_DIR" = "x"; then
+   LIB_BIN_DIR=${LIB_BIN_BASEDIRNAME}-${MAGICK_ABI_SUFFIX}
+fi
+AC_SUBST(LIB_BIN_DIR)
+
+LIB_BIN_DIR_RELATIVE_PATH=$LIB_BIN_DIR
+AC_SUBST(LIB_BIN_DIR_RELATIVE_PATH)
+LIB_BIN_DIR_PATH="${LIBRARY_PATH}/${LIB_BIN_DIR_RELATIVE_PATH}"
+AC_SUBST(LIB_BIN_DIR_PATH)
+
+#
+# path to modules lib
+if test "x$MODULES_BASEDIRNAME" = "x"; then
+   MODULES_BASEDIRNAME="modules"
+fi
+AC_DEFINE_UNQUOTED(MODULES_BASEDIRNAME,"$MODULES_BASEDIRNAME",[Module directory name without ABI part.])
+AC_SUBST(MODULES_BASEDIRNAME)
+
+if test "x$MODULES_DIRNAME" = "x"; then
+  MODULES_DIRNAME=${MODULES_BASEDIRNAME}-${MAGICK_ABI_SUFFIX}
+else
+  AC_DEFINE_UNQUOTED(MODULES_DIRNAME,"$MODULES_DIRNAME",[Module directory dirname])
+fi
+AC_SUBST(MODULES_DIRNAME)
+
+MODULES_RELATIVE_PATH="${MODULES_DIRNAME}"
+AC_SUBST(MODULES_RELATIVE_PATH)
+MODULES_PATH="${LIBRARY_PATH}/${MODULES_RELATIVE_PATH}"
+AC_SUBST(MODULES_PATH)
+
+#
+# path to coders lib
+if test "x$CODER_DIRNAME" = "x"; then
+   CODER_DIRNAME="coders"
+fi
+AC_DEFINE_UNQUOTED(CODER_DIRNAME,"$CODER_DIRNAME",[coders subdirectory.])
+AC_SUBST(CODER_DIRNAME)
+
+CODER_RELATIVE_PATH="${CODER_DIRNAME}"
+CODER_PATH="${MODULES_PATH}/${CODER_DIRNAME}"
 AC_SUBST(CODER_PATH)
 
 #
 # Subdirectory under lib to place ImageMagick filter module files
-FILTER_RELATIVE_PATH="${LIBRARY_RELATIVE_PATH}/modules-Q${QUANTUM_DEPTH}/filters"
-AC_DEFINE_UNQUOTED(FILTER_RELATIVE_PATH,"$FILTER_RELATIVE_PATH",Subdirectory of lib where filter modules are installed)
-FILTER_PATH="${LIB_DIR}/${FILTER_RELATIVE_PATH}"
-DEFINE_FILTER_PATH="${LIB_DIR}/${FILTER_RELATIVE_PATH}/"
-case "${build_os}" in
-  mingw* )
-    DEFINE_FILTER_PATH=`$WinPathScript "$DEFINE_FILTER_PATH" 1`
-    ;;
-esac
-AC_DEFINE_UNQUOTED(FILTER_PATH,"$DEFINE_FILTER_PATH",Location of filter modules)
+#
+# path to coders lib
+if test "x$FILTER_DIRNAME" = "x"; then
+   FILTER_DIRNAME="filters"
+fi
+AC_DEFINE_UNQUOTED(FILTER_DIRNAME,"$FILTER_DIRNAME",[filter subdirectory.])
+AC_SUBST(FILTER_DIRNAME)
+
+FILTER_RELATIVE_PATH="${FILTER_DIRNAME}"
+FILTER_PATH="${MODULES_PATH}/${FILTER_DIRNAME}"
 AC_SUBST(FILTER_PATH)
 
 #
 # Path to ImageMagick documentation files
-DOCUMENTATION_RELATIVE_PATH="${PACKAGE_NAME}-${PACKAGE_VERSION}"
+DOCUMENTATION_RELATIVE_PATH="${PACKAGE_NAME}-${MAGICK_MAJOR_VERSION}"
 DOCUMENTATION_PATH="${DOC_DIR}/${DOCUMENTATION_RELATIVE_PATH}"
 DEFINE_DOCUMENTATION_PATH="${DOC_DIR}/${DOCUMENTATION_RELATIVE_PATH}/"
 case "${build_os}" in
@@ -2992,12 +3077,12 @@ case "${build_os}" in
     DEFINE_DOCUMENTATION_PATH=`$WinPathScript "$DEFINE_DOCUMENTATION_PATH" 1`
     ;;
 esac
-AC_DEFINE_UNQUOTED(DOCUMENTATION_PATH,"$DEFINE_DOCUMENTATION_PATH",Directory where ImageMagick documents live.)
+AC_DEFINE_UNQUOTED(DOCUMENTATION_PATH,"$DEFINE_DOCUMENTATION_PATH",[Directory where ImageMagick documents live.])
 AC_SUBST(DOCUMENTATION_PATH)
 
 # Subdirectory to place architecture-dependent configuration files
-CONFIGURE_RELATIVE_PATH="${PACKAGE_NAME}"
-AC_DEFINE_UNQUOTED(CONFIGURE_RELATIVE_PATH,"$CONFIGURE_RELATIVE_PATH",Subdirectory of lib where architecture-dependent configuration files live.)
+CONFIGURE_RELATIVE_PATH="${PACKAGE_NAME}-${MAGICK_MAJOR_VERSION}"
+AC_DEFINE_UNQUOTED(CONFIGURE_RELATIVE_PATH,"$CONFIGURE_RELATIVE_PATH",[Subdirectory of lib where architecture-dependent configuration files live.])
 CONFIGURE_PATH="${SYSCONF_DIR}/${CONFIGURE_RELATIVE_PATH}/"
 DEFINE_CONFIGURE_PATH="${SYSCONF_DIR}/${CONFIGURE_RELATIVE_PATH}/"
 case "${build_os}" in
@@ -3005,12 +3090,12 @@ case "${build_os}" in
     DEFINE_CONFIGURE_PATH=`$WinPathScript "$DEFINE_CONFIGURE_PATH" 1`
     ;;
 esac
-AC_DEFINE_UNQUOTED(CONFIGURE_PATH,"$DEFINE_CONFIGURE_PATH",Directory where architecture-dependent configuration files live.)
+AC_DEFINE_UNQUOTED(CONFIGURE_PATH,"$DEFINE_CONFIGURE_PATH",[Directory where architecture-dependent configuration files live.])
 AC_SUBST(CONFIGURE_PATH)
 
 # Subdirectory to place architecture-independent configuration files
-SHARE_RELATIVE_PATH="${LIBRARY_RELATIVE_PATH}"
-AC_DEFINE_UNQUOTED(SHARE_RELATIVE_PATH,"$SHARE_RELATIVE_PATH",Subdirectory of lib where architecture-independent configuration files live.)
+SHARE_RELATIVE_PATH="${PACKAGE_NAME}-${MAGICK_MAJOR_VERSION}"
+AC_DEFINE_UNQUOTED(SHARE_RELATIVE_PATH,"$SHARE_RELATIVE_PATH",[Subdirectory of lib where architecture-independent configuration files live.])
 SHARE_PATH="${DATA_DIR}/${SHARE_RELATIVE_PATH}"
 DEFINE_SHARE_PATH="${DATA_DIR}/${SHARE_RELATIVE_PATH}/"
 case "${build_os}" in
@@ -3018,20 +3103,27 @@ case "${build_os}" in
     DEFINE_SHARE_PATH=`$WinPathScript "$DEFINE_SHARE_PATH" 1`
     ;;
 esac
-AC_DEFINE_UNQUOTED(SHARE_PATH,"$DEFINE_SHARE_PATH",Directory where architecture-independent configuration files live.)
+AC_DEFINE_UNQUOTED(SHARE_PATH,"$DEFINE_SHARE_PATH",[Directory where architecture-independent configuration files live.])
 AC_SUBST(SHARE_PATH)
 
-# Subdirectory to place architecture-dependent configuration files
-SHAREARCH_RELATIVE_PATH="${LIBRARY_RELATIVE_PATH}/config"
-AC_DEFINE_UNQUOTED(SHAREARCH_RELATIVE_PATH,"$SHAREARCH_RELATIVE_PATH",Subdirectory of lib where architecture-independent configuration files live.)
-SHAREARCH_PATH="${SHAREARCH_DIR}/${SHAREARCH_RELATIVE_PATH}"
-DEFINE_SHAREARCH_PATH="${SHAREARCH_DIR}/${SHAREARCH_RELATIVE_PATH}/"
-case "${build_os}" in
-  mingw* )
-    DEFINE_SHAREARCH_PATH=`$WinPathScript "$DEFINE_SHAREARCH_PATH" 1`
-    ;;
-esac
-AC_DEFINE_UNQUOTED(SHAREARCH_PATH,"$DEFINE_SHAREARCH_PATH",Directory where architecture-independent configuration files live.)
+#
+# Subdirectory to place architecture-dependent configuration files.
+if test "x$SHAREARCH_BASEDIRNAME" = "x"; then
+   SHAREARCH_BASEDIRNAME="config"
+fi
+AC_DEFINE_UNQUOTED(SHAREARCH_BASEDIRNAME,"$SHAREARCH_BASEDIRNAME",[Sharearch directory name without ABI part.])
+AC_SUBST(SHAREARCH_BASEDIRNAME)
+
+if test "x$SHAREARCH_DIRNAME" = "x"; then
+  SHAREARCH_DIRNAME=${SHAREARCH_BASEDIRNAME}-${MAGICK_ABI_SUFFIX}
+else
+  AC_DEFINE_UNQUOTED(SHAREARCH_DIRNAME,"$SHAREARCH_DIRNAME",[Sharearch directory dirname])
+fi
+AC_SUBST(SHAREARCH_DIRNAME)
+
+SHAREARCH_RELATIVE_PATH="${SHAREARCH_DIRNAME}"
+AC_SUBST(SHAREARCH_RELATIVE_PATH)
+SHAREARCH_PATH="${LIBRARY_PATH}/${SHAREARCH_RELATIVE_PATH}"
 AC_SUBST(SHAREARCH_PATH)
 
 #
@@ -3040,9 +3132,9 @@ AC_SUBST(SHAREARCH_PATH)
 configure_transform_name=`echo ${program_transform_name} | sed 's,\\$\\$,$,'`
 
 # Default delegate definitions
-AC_MSG_NOTICE([-------------------------------------------------------------])
+AC_MSG_RESULT([-------------------------------------------------------------])
 AC_MSG_CHECKING([for ImageMagick delegate programs])
-AC_MSG_NOTICE([])
+AC_MSG_RESULT([])
 AutotraceDecodeDelegateDefault='autotrace'
 BlenderDecodeDelegateDefault='blender'
 BZIPDelegateDefault='bzip2'
@@ -3065,8 +3157,6 @@ ILBMDecodeDelegateDefault='ilbmtoppm'
 ILBMEncodeDelegateDefault='ppmtoilbm'
 LPDelegateDefault='lp'
 LPRDelegateDefault='lpr'
-LZWDecodeDelegateDefault='uncompress'
-LZWEncodeDelegateDefault='compress'
 LaunchDelegateDefault='gimp'
 MANDelegateDefault='groff'
 MPEGDecodeDelegateDefault='ffmpeg'
@@ -3099,7 +3189,7 @@ ZipDelegateDefault='gzip'
 AC_PATH_PROG(AutotraceDecodeDelegate, "$AutotraceDecodeDelegateDefault", "$AutotraceDecodeDelegateDefault")
 AC_PATH_PROG(BlenderDecodeDelegate, "$BlenderDecodeDelegateDefault", "$BlenderDecodeDelegateDefault")
 AC_PATH_PROG(BZIPDelegate, "$BZIPDelegateDefault", "$BZIPDelegateDefault")
-AC_PATH_PROG(BrowseDelegate, "$BrowseDelegateDefault" mozilla firefox netscape, "$BrowseDelegateDefault")
+AC_PATH_PROGS(BrowseDelegate, "$BrowseDelegateDefault" google-chrome firefox konqueror mozilla lynx, "$BrowseDelegateDefault")
 AC_PATH_PROG(CGMDecodeDelegate, "$CGMDecodeDelegateDefault", "$CGMDecodeDelegateDefault")
 AC_PATH_PROG(CatDelegate, "$CatDelegateDefault", "$CatDelegateDefault")
 AC_PATH_PROG(DNGDecodeDelegate, "$DNGDecodeDelegateDefault", "$DNGDecodeDelegateDefault")
@@ -3118,8 +3208,6 @@ AC_PATH_PROG(ILBMDecodeDelegate, "$ILBMDecodeDelegateDefault", "$ILBMDecodeDeleg
 AC_PATH_PROG(ILBMEncodeDelegate, "$ILBMEncodeDelegateDefault", "$ILBMEncodeDelegateDefault")
 AC_PATH_PROG(LPDelegate, "$LPDelegateDefault", no)
 AC_PATH_PROG(LPRDelegate, "$LPRDelegateDefault", "$LPRDelegateDefault")
-AC_PATH_PROG(LZWDecodeDelegate, "$LZWDecodeDelegateDefault", "$LZWDecodeDelegateDefault")
-AC_PATH_PROG(LZWEncodeDelegate, "$LZWEncodeDelegateDefault", "$LZWEncodeDelegateDefault")
 AC_PATH_PROG(LaunchDelegate, "$LaunchDelegateDefault", "$LaunchDelegateDefault")
 AC_PATH_PROG(MANDelegate, "$MANDelegateDefault", "$MANDelegateDefault")
 AC_PATH_PROG(MPEGDecodeDelegate, "$MPEGDecodeDelegateDefault", "$MPEGDecodeDelegateDefault")
@@ -3187,9 +3275,9 @@ else
 fi
 if test "${dejavu_font_dir}x" != 'x'; then
   type_include_files="${type_include_files} "'<include file="type-dejavu.xml" />'
-  AC_MSG_NOTICE([$dejavu_font_dir])
+  AC_MSG_RESULT([$dejavu_font_dir])
 else
-  AC_MSG_NOTICE([not found!]);
+  AC_MSG_RESULT([not found!]);
 fi
 AC_SUBST(dejavu_font_dir)
 
@@ -3248,9 +3336,9 @@ else
 fi
 if test "${ghostscript_font_dir}x" != 'x'; then
   type_include_files="${type_include_files} "'<include file="type-ghostscript.xml" />'
-  AC_MSG_NOTICE([$ghostscript_font_dir])
+  AC_MSG_RESULT([$ghostscript_font_dir])
 else
-  AC_MSG_NOTICE([not found!]);
+  AC_MSG_RESULT([not found!]);
 fi
 AC_SUBST(ghostscript_font_dir)
 case "${build_os}" in
@@ -3284,8 +3372,6 @@ if test "$with_frozenpaths" != 'yes'; then
   ILBMDecodeDelegate="$ILBMDecodeDelegateDefault"
   ILBMEncodeDelegate="$ILBMEncodeDelegateDefault"
   LPDelegate="$LPDelegateDefault"
-  LZWDecodeDelegate="$LZWDecodeDelegateDefault"
-  LZWEncodeDelegate="$LZWEncodeDelegateDefault"
   LaunchDelegate="$LaunchDelegateDefault"
   MANDelegate="$MANDelegateDefault"
   MPEGDecodeDelegate="$MPEGDecodeDelegateDefault"
@@ -3330,8 +3416,6 @@ AC_SUBST(HTMLDecodeDelegate)
 AC_SUBST(ILBMDecodeDelegate)
 AC_SUBST(ILBMEncodeDelegate)
 AC_SUBST(LPDelegate)
-AC_SUBST(LZWDecodeDelegate)
-AC_SUBST(LZWEncodeDelegate)
 AC_SUBST(LaunchDelegate)
 AC_SUBST(MANDelegate)
 AC_SUBST(MPEGDecodeDelegate)
@@ -3394,9 +3478,9 @@ if test -z "$PCLVersion"; then
     PCLVersion='unknown'
 fi
 if test $have_pcl = 'yes'; then
-    AC_MSG_NOTICE([-------------------------------------------------------------])
+    AC_MSG_RESULT([-------------------------------------------------------------])
     AC_MSG_CHECKING([for PCL])
-    AC_MSG_NOTICE([])
+    AC_MSG_RESULT([])
     # PCLColorDevice
     AC_MSG_CHECKING([for pcl color device])
     if $PCLDelegate -dBATCH -sDEVICE=$PCLColorDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
@@ -3404,7 +3488,7 @@ if test $have_pcl = 'yes'; then
     else
         PCLColorDevice=ppmraw
     fi
-    AC_MSG_NOTICE([$PCLColorDevice])
+    AC_MSG_RESULT([$PCLColorDevice])
 
     # PCLCMYKDevice
     AC_MSG_CHECKING([for pcl CMYK device])
@@ -3413,7 +3497,7 @@ if test $have_pcl = 'yes'; then
     else
         PCLCMYKDevice=$PCLColorDevice
     fi
-    AC_MSG_NOTICE([$PCLCMYKDevice])
+    AC_MSG_RESULT([$PCLCMYKDevice])
 
     # PCLMonoDevice
     AC_MSG_CHECKING([for pcl mono device])
@@ -3422,7 +3506,7 @@ if test $have_pcl = 'yes'; then
     else
         PCLMonoDevice=$PCLColorDevice
     fi
-    AC_MSG_NOTICE([$PCLMonoDevice])
+    AC_MSG_RESULT([$PCLMonoDevice])
 fi
 
 AC_SUBST(PCLMonoDevice)
@@ -3440,9 +3524,9 @@ if test -z "$XPSVersion"; then
     XPSVersion='unknown'
 fi
 if test $have_xps = 'yes'; then
-    AC_MSG_NOTICE([-------------------------------------------------------------])
+    AC_MSG_RESULT([-------------------------------------------------------------])
     AC_MSG_CHECKING([for XPS])
-    AC_MSG_NOTICE([])
+    AC_MSG_RESULT([])
     # XPSColorDevice
     AC_MSG_CHECKING([for xps color device])
     if $XPSDelegate -dBATCH -sDEVICE=$XPSColorDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
@@ -3450,7 +3534,7 @@ if test $have_xps = 'yes'; then
     else
         XPSColorDevice=ppmraw
     fi
-    AC_MSG_NOTICE([$XPSColorDevice])
+    AC_MSG_RESULT([$XPSColorDevice])
 
     # XPSCMYKDevice
     AC_MSG_CHECKING([for xps CMYK device])
@@ -3459,7 +3543,7 @@ if test $have_xps = 'yes'; then
     else
         XPSCMYKDevice=$XPSColorDevice
     fi
-    AC_MSG_NOTICE([$XPSCMYKDevice])
+    AC_MSG_RESULT([$XPSCMYKDevice])
 
     # XPSMonoDevice
     AC_MSG_CHECKING([for xps mono device])
@@ -3468,7 +3552,7 @@ if test $have_xps = 'yes'; then
     else
         XPSMonoDevice=$XPSColorDevice
     fi
-    AC_MSG_NOTICE([$XPSMonoDevice])
+    AC_MSG_RESULT([$XPSMonoDevice])
 fi
 
 AC_SUBST(XPSMonoDevice)
@@ -3488,16 +3572,16 @@ GSPSDevice=pswrite
 GSEPSDevice=epswrite
 GSVersion='unknown'
 if test $have_gs = 'yes'; then
-    AC_MSG_NOTICE([-------------------------------------------------------------])
+    AC_MSG_RESULT([-------------------------------------------------------------])
     AC_MSG_CHECKING([for Ghostscript])
-    AC_MSG_NOTICE([])
+    AC_MSG_RESULT([])
     AC_MSG_CHECKING([for Ghostscript version])
     if GSVersion=`$PSDelegate --version`; then
         :
     else
         GSVersion=`$PSDelegate --help | sed -e '1q' | awk '{ print $3 }'`
     fi
-    AC_MSG_NOTICE([$GSVersion])
+    AC_MSG_RESULT([$GSVersion])
 
     # GSAlphaDevice
     AC_MSG_CHECKING([for gs alpha device])
@@ -3506,7 +3590,7 @@ if test $have_gs = 'yes'; then
     else
         GSAlphaDevice=pnmraw
     fi
-    AC_MSG_NOTICE([$GSAlphaDevice])
+    AC_MSG_RESULT([$GSAlphaDevice])
 
     # GSColorDevice
     AC_MSG_CHECKING([for gs color device])
@@ -3515,7 +3599,7 @@ if test $have_gs = 'yes'; then
     else
         GSColorDevice=pnmraw
     fi
-    AC_MSG_NOTICE([$GSColorDevice])
+    AC_MSG_RESULT([$GSColorDevice])
 
     # GSCMYKDevice
     AC_MSG_CHECKING([for gs CMYK device])
@@ -3524,7 +3608,7 @@ if test $have_gs = 'yes'; then
     else
         GSCMYKDevice=bmpsep8
     fi
-    AC_MSG_NOTICE([$GSCMYKDevice])
+    AC_MSG_RESULT([$GSCMYKDevice])
 
     # GSMonoDevice
     AC_MSG_CHECKING([for gs mono device])
@@ -3533,7 +3617,7 @@ if test $have_gs = 'yes'; then
     else
         GSMonoDevice=$GSColorDevice
     fi
-    AC_MSG_NOTICE([$GSMonoDevice])
+    AC_MSG_RESULT([$GSMonoDevice])
 
     # GSPDFDevice
     AC_MSG_CHECKING([for gs PDF writing device])
@@ -3542,7 +3626,7 @@ if test $have_gs = 'yes'; then
     else
         GSPDFDevice=nodevice
     fi
-        AC_MSG_NOTICE([$GSPDFDevice])
+        AC_MSG_RESULT([$GSPDFDevice])
 
     # GSPSDevice
     AC_MSG_CHECKING([for gs PS writing device])
@@ -3551,7 +3635,7 @@ if test $have_gs = 'yes'; then
     else
         GSPSDevice=nodevice
     fi
-    AC_MSG_NOTICE([$GSPSDevice])
+    AC_MSG_RESULT([$GSPSDevice])
 
     # GSEPSDevice
     AC_MSG_CHECKING([for gs EPS writing device])
@@ -3560,7 +3644,7 @@ if test $have_gs = 'yes'; then
     else
         GSEPSDevice=nodevice
     fi
-    AC_MSG_NOTICE([$GSEPSDevice])
+    AC_MSG_RESULT([$GSEPSDevice])
 fi
 
 AC_SUBST(GSAlphaDevice)
@@ -3580,9 +3664,9 @@ AC_SUBST(GSVersion)
 # If name/path of desired PERL interpreter is specified, look for that one first
 have_perl='no'
 if test "$with_perl" != 'no'; then
-    AC_MSG_NOTICE([-------------------------------------------------------------])
+    AC_MSG_RESULT([-------------------------------------------------------------])
     AC_MSG_CHECKING([for Perl])
-    AC_MSG_NOTICE([])
+    AC_MSG_RESULT([])
     if test "$with_perl" != 'yes'; then
         AC_CACHE_CHECK(for perl,ac_cv_path_PERL,ac_cv_path_PERL="$with_perl");
         PERL=$ac_cv_path_PERL
@@ -3630,40 +3714,112 @@ if test $with_perl_static = 'yes'; then
 fi
 AC_SUBST(MAGICKCORE_PATH)
 
-# Create a simple string containing format names for all delegate libraries
-DELEGATES=''
-if test "$have_autotrace"  = 'yes'; then DELEGATES="$DELEGATES autotrace"; fi
-if test "$have_bzlib"      = 'yes'; then DELEGATES="$DELEGATES bzlib"; fi
-if test "$have_djvu"       = 'yes'; then DELEGATES="$DELEGATES djvu"; fi
-if test "$have_dps"        = 'yes'; then DELEGATES="$DELEGATES dps"; fi
-if test "$have_fftw"       = 'yes'; then DELEGATES="$DELEGATES fftw"; fi
-if test "$have_fpx"        = 'yes'; then DELEGATES="$DELEGATES fpx"; fi
-if test "$have_fontconfig" = 'yes'; then DELEGATES="$DELEGATES fontconfig"; fi
-if test "$have_freetype"   = 'yes'; then DELEGATES="$DELEGATES freetype"; fi
-if test "$have_gslib"      = 'yes'; then DELEGATES="$DELEGATES gs"; fi
-if test "$have_gvc"        = 'yes'; then DELEGATES="$DELEGATES gvc"; fi
-if test "$have_jbig"       = 'yes'; then DELEGATES="$DELEGATES jbig"; fi
-if test "$have_jpeg"       = 'yes'; then
-  DELEGATES="$DELEGATES jpeg";
-  if test "$have_png"      = 'yes'; then DELEGATES="$DELEGATES jng"; fi
-fi
-if test "$have_jp2"        = 'yes'; then DELEGATES="$DELEGATES jp2"; fi
-if test "$have_lcms2"      = 'yes'; then DELEGATES="$DELEGATES lcms2"; fi
-if test "$have_lcms"       = 'yes'; then DELEGATES="$DELEGATES lcms"; fi
-if test "$have_lqr"        = 'yes'; then DELEGATES="$DELEGATES lqr"; fi
-if test "$have_lzma"       = 'yes'; then DELEGATES="$DELEGATES lzma"; fi
-if test "$have_ffmpeg"     = 'yes'; then DELEGATES="$DELEGATES mpeg"; fi
-if test "$have_openexr"    = 'yes'; then DELEGATES="$DELEGATES openexr"; fi
-if test "$have_pango"      = 'yes'; then DELEGATES="$DELEGATES pango"; fi
-if test "$have_png"        = 'yes'; then DELEGATES="$DELEGATES png"; fi
-if test "$have_rsvg"       = 'yes'; then DELEGATES="$DELEGATES rsvg"; fi
-if test "$have_tiff"       = 'yes'; then DELEGATES="$DELEGATES tiff"; fi
-if test "$have_x"          = 'yes'; then DELEGATES="$DELEGATES x11"; fi
-if test "$have_xml"        = 'yes'; then DELEGATES="$DELEGATES xml"; fi
-if test "$have_wmf"        = 'yes'; then DELEGATES="$DELEGATES wmf"; fi
-if test "$have_zlib"       = 'yes'; then DELEGATES="$DELEGATES zlib"; fi
-
-AC_SUBST(DELEGATES)
+# Create a simple string containing format names for all delegate libraries.
+MAGICK_DELEGATES=''
+if test "$have_autotrace"  = 'yes' ; then
+   MAGICK_DELEGATES="$MAGICK_DELEGATES autotrace"
+fi
+if test "$have_bzlib"  = 'yes' ; then
+   MAGICK_DELEGATES="$MAGICK_DELEGATES bzlib"
+fi
+if test "$have_dps"    = 'yes' ; then
+   MAGICK_DELEGATES="$MAGICK_DELEGATES dps"
+fi
+if test "$have_djvu"    = 'yes' ; then
+   MAGICK_DELEGATES="$MAGICK_DELEGATES djvu"
+fi
+if test "$have_ffmpeg"   = 'yes' ; then
+   MAGICK_DELEGATES="$MAGICK_DELEGATES mpeg"
+fi
+if test "$have_fftw"    = 'yes' ; then
+   MAGICK_DELEGATES="$MAGICK_DELEGATES fftw"
+fi
+if test "$have_fig2dev" = 'yes' && test "$have_ps" = 'yes'  ; then
+   MAGICK_DELEGATES="$MAGICK_DELEGATES xfig"
+fi
+if test "$have_fpx"    = 'yes' ; then
+   MAGICK_DELEGATES="$MAGICK_DELEGATES fpx"
+fi
+if test "$have_fontconfig"    = 'yes' ; then
+   MAGICK_DELEGATES="$MAGICK_DELEGATES fontconfig"
+fi
+if test "$have_freetype"    = 'yes' ; then
+   MAGICK_DELEGATES="$MAGICK_DELEGATES freetype"
+fi
+if test "$have_gslib"    = 'yes' ; then
+   MAGICK_DELEGATES="$MAGICK_DELEGATES gslib"
+fi
+if test "$have_jbig"    = 'yes' ; then
+   MAGICK_DELEGATES="$MAGICK_DELEGATES jbig"
+fi
+if test "$have_png$have_jpeg" = 'yesyes' ; then
+   MAGICK_DELEGATES="$MAGICK_DELEGATES jng"
+fi
+if test "$have_jp2"   = 'yes' ; then
+   MAGICK_DELEGATES="$MAGICK_DELEGATES jp2"
+fi
+if test "$have_jpeg"   = 'yes' ; then
+   MAGICK_DELEGATES="$MAGICK_DELEGATES jpeg"
+fi
+if test "$have_lcms" = 'yes' || test "$have_lcms2" = 'yes' ; then
+   MAGICK_DELEGATES="$MAGICK_DELEGATES lcms"
+fi
+if test "$have_lqr"    = 'yes' ; then
+   MAGICK_DELEGATES="$MAGICK_DELEGATES lqr"
+fi
+if test "$have_lzma"    = 'yes' ; then
+   MAGICK_DELEGATES="$MAGICK_DELEGATES lzma"
+fi
+if test "$have_openexr"    = 'yes' ; then
+   MAGICK_DELEGATES="$MAGICK_DELEGATES openexr"
+fi
+if test "$have_pango"    = 'yes' ; then
+   MAGICK_DELEGATES="$MAGICK_DELEGATES pango"
+fi
+if test "$have_png"    = 'yes' ; then
+   MAGICK_DELEGATES="$MAGICK_DELEGATES png"
+fi
+have_ps='no'
+if test "$have_dps"    = 'yes' || \
+   test "$have_gs" = 'yes' || \
+   test "${native_win32_build}" = 'yes' ; then
+   have_ps='yes'
+fi
+if test "$have_ps"     = 'yes' ; then
+   MAGICK_DELEGATES="$MAGICK_DELEGATES ps"
+fi
+if test "$have_ralcgm" = 'yes' ; then
+   MAGICK_DELEGATES="$MAGICK_DELEGATES cgm"
+fi
+if test "$have_ra_ppm" = 'yes' ; then
+   MAGICK_DELEGATES="$MAGICK_DELEGATES rad"
+fi
+if test "$have_rsvg"   = 'yes' ; then
+   MAGICK_DELEGATES="$MAGICK_DELEGATES rsvg"
+fi
+if test "$have_tiff"   = 'yes' ; then
+   MAGICK_DELEGATES="$MAGICK_DELEGATES tiff"
+fi
+if test "$have_ttf"    = 'yes' ; then
+   MAGICK_DELEGATES="$MAGICK_DELEGATES ttf"
+fi
+if test "$have_wmf"    = 'yes' ; then
+   MAGICK_DELEGATES="$MAGICK_DELEGATES wmf"
+fi
+if test "$have_x"      = 'yes' ; then
+   MAGICK_DELEGATES="$MAGICK_DELEGATES x"
+fi
+if test "$have_xml"      = 'yes' ; then
+   MAGICK_DELEGATES="$MAGICK_DELEGATES xml"
+fi
+if test "$have_zlib"   = 'yes' ; then
+   MAGICK_DELEGATES="$MAGICK_DELEGATES zlib"
+fi
+# Remove extraneous spaces from output variables (asthetic)
+MAGICK_DELEGATES=`echo $MAGICK_DELEGATES | sed -e 's/  */ /g'`
+MAGICK_FEATURES=`echo $MAGICK_FEATURES | sed -e 's/  */ /g'`
+AC_SUBST(MAGICK_DELEGATES)
+AC_SUBST(MAGICK_FEATURES)
 
 #
 # Handle special compiler flags
@@ -3706,24 +3862,10 @@ fi
 # Build library dependency list for libMagickCore
 #
 
-MAGICK_LIBLTDL='' # Libltdl for build
-MAGICK_API_LIBLTDL=''   # libltdl for dependent application (API) build
-MAGICK_LTDLDEPS=''      # extra libltdl dependencies
-if test "$with_ltdl" != 'no'
-then
-  if test \( "$with_included_ltdl" = 'no' -o "$enable_ltdl_convenience" = 'no' \) -o "$enable_ltdl_install" = 'yes'; then
-    MAGICK_API_LIBLTDL='-lltdl'
-  fi
-  MAGICK_LIBLTDL=${LIBLTDL}
-  MAGICK_LTDLDEPS=${LTDLDEPS}
-fi
-AC_SUBST(MAGICK_LIBLTDL)
-AC_SUBST(MAGICK_LTDLDEPS)
-
-if test "$with_modules" != 'no'; then
-    MAGICK_DEP_LIBS="$LCMS_LIBS $TIFF_LIBS $FREETYPE_LIBS $JPEG_LIBS $LQR_LIBS $FFTW_LIBS $FONTCONFIG_LIBS $XEXT_LIBS $IPC_LIBS $X11_LIBS $XT_LIBS $LZMA_LIBS $BZLIB_LIBS $ZLIB_LIBS $GDI32_LIBS $MATH_LIBS $CCMALLOC_LIBS $EFENCE_LIBS $UMEM_LIBS $GOMP_LIBS $CL_LIBS $THREAD_LIBS"
+if test "$build_modules" != 'no'; then
+    MAGICK_DEP_LIBS="$LCMS_LIBS $FREETYPE_LIBS $LQR_LIBS $FFTW_LIBS $FONTCONFIG_LIBS $XEXT_LIBS $IPC_LIBS $X11_LIBS $XT_LIBS $LZMA_LIBS $BZLIB_LIBS $ZLIB_LIBS $LTDL_LIBS $GDI32_LIBS $MATH_LIBS $GOMP_LIBS $CL_LIBS $UMEM_LIBS $THREAD_LIBS"
 else
-    MAGICK_DEP_LIBS="$JBIG_LIBS $LCMS_LIBS $TIFF_LIBS $FREETYPE_LIBS $JP2_LIBS $JPEG_LIBS $GS_LIBS $LQR_LIBS $PNG_LIBS $AUTOTRACE_LIBS $DJVU_LIBS $FFTW_LIBS $FPX_LIBS $FONTCONFIG_LIBS $WEBP_LIBS $WMF_LIBS $DPS_LIBS $XEXT_LIBS $XT_LIBS $IPC_LIBS $X11_LIBS $LZMA_LIBS $BZLIB_LIBS $OPENEXR_LIBS $PANGO_LIBS $RSVG_LIBS $XML_LIBS $GVC_LIBS $ZLIB_LIBS $GDI32_LIBS $MATH_LIBS $CCMALLOC_LIBS $EFENCE_LIBS $UMEM_LIBS $GOMP_LIBS $CL_LIBS $THREAD_LIBS"
+    MAGICK_DEP_LIBS="$JBIG_LIBS $LCMS_LIBS $TIFF_LIBS $FREETYPE_LIBS $JP2_LIBS $JPEG_LIBS $GS_LIBS $LQR_LIBS $PNG_LIBS $AUTOTRACE_LIBS $DJVU_LIBS $FFTW_LIBS $FPX_LIBS $FONTCONFIG_LIBS $WEBP_LIBS $WMF_LIBS $DPS_LIBS $XEXT_LIBS $XT_LIBS $IPC_LIBS $X11_LIBS $LZMA_LIBS $BZLIB_LIBS $OPENEXR_LIBS $PANGO_LIBS $RSVG_LIBS $XML_LIBS $GVC_LIBS $ZLIB_LIBS $GDI32_LIBS $MATH_LIBS $GOMP_LIBS $CL_LIBS $UMEM_LIBS $THREAD_LIBS"
 fi
 AC_SUBST(MAGICK_DEP_LIBS)
 
@@ -3739,7 +3881,6 @@ CC=`echo $CC | sed -e 's/  */ /g'`
 CFLAGS=`echo $CFLAGS | sed -e 's/  */ /g'`
 CPPFLAGS=`echo $CPPFLAGS | sed -e 's/  */ /g'`
 CXXFLAGS=`echo $CXXFLAGS | sed -e 's/  */ /g'`
-DELEGATES=`echo $DELEGATES | sed -e 's/^ //g'`
 DISTCHECK_CONFIG_FLAGS=`echo $DISTCHECK_CONFIG_FLAGS | sed -e 's/  */ /g'`
 LDFLAGS=`echo $LDFLAGS | sed -e 's/  */ /g'`
 TESTED_LIBS=`echo $LIBS | sed -e 's/  */ /g'`
@@ -3761,7 +3902,7 @@ MAGICK_CXXFLAGS="$CXXFLAGS"
 MAGICK_CPPFLAGS=`echo $MAGICK_CPPFLAGS | sed -e 's/  */ /g'`
 MAGICK_PCFLAGS=`echo $MAGICK_PCFLAGS | sed -e 's/  */ /g'`
 MAGICK_LDFLAGS="-L$LIB_DIR $LDFLAGS"
-MAGICK_LIBS="-lMagickCore $MAGICK_DEP_LIBS $MAGICK_API_LIBLTDL"
+MAGICK_LIBS="-lMagickCore $MAGICK_DEP_LIBS"
 
 AC_SUBST(MAGICK_CFLAGS)
 AC_SUBST(MAGICK_CXXFLAGS)
@@ -3769,7 +3910,6 @@ AC_SUBST(MAGICK_CPPFLAGS)
 AC_SUBST(MAGICK_PCFLAGS)
 AC_SUBST(MAGICK_LDFLAGS)
 AC_SUBST(MAGICK_LIBS)
-AC_SUBST(MAGICK_FEATURES)
 
 # Set configured scripts to executable.
 AC_CONFIG_COMMANDS([default],[],[])
@@ -3779,8 +3919,8 @@ AC_CONFIG_COMMANDS([MagickWand-config.in],[chmod +x MagickWand/MagickWand-config
 AC_CONFIG_COMMANDS([Magick++-config.in],[chmod +x Magick++/bin/Magick++-config])
 AC_CONFIG_COMMANDS([PerlMagick/check.sh.in],[chmod +x PerlMagick/check.sh])
 
-AC_MSG_NOTICE([-------------------------------------------------------------])
-AC_MSG_NOTICE([Update ImageMagick configuration])
+AC_MSG_RESULT([-------------------------------------------------------------])
+AC_MSG_RESULT([Update ImageMagick configuration])
 AC_OUTPUT
 
 rm -f magick-version
@@ -3800,7 +3940,7 @@ if test "${windows_font_dir}x" != 'x'; then
     result_windows_font_dir=${windows_font_dir}
 fi
 
-AC_MSG_NOTICE([
+AC_MSG_RESULT([
 ImageMagick is configured as follows. Please verify that this configuration
 matches your expectations.
 
@@ -3811,7 +3951,7 @@ Build system type: $build
 -------------------------------------------------------------------------------
 Shared libraries  --enable-shared=$enable_shared               $libtool_build_shared_libs
 Static libraries  --enable-static=$enable_static               $libtool_build_static_libs
-Module support    --with-modules=$with_modules         $with_modules
+Module support    --with-modules=$build_modules                $build_modules
 GNU ld            --with-gnu-ld=$with_gnu_ld           $lt_cv_prog_gnu_ld
 Quantum depth     --with-quantum-depth=$with_quantum_depth     $with_quantum_depth
 High Dynamic Range Imagery
@@ -3839,6 +3979,7 @@ JPEG-2000         --with-jp2=$with_jp2            $have_jp2
 LCMS v1           --with-lcms=$with_lcms               $have_lcms
 LCMS v2           --with-lcms2=$with_lcms2             $have_lcms2
 LQR               --with-lqr=$with_lqr         $have_lqr
+LTDL              --with-ltdl=$with_ltdl               $have_ltdl
 LZMA              --with-lzma=$with_lzma               $have_lzma
 Magick++          --with-magick-plus-plus=$with_magick_plus_plus       $have_magick_plus_plus
 OpenEXR           --with-openexr=$with_openexr         $have_openexr
@@ -3875,4 +4016,5 @@ Options used to compile and link:
   CXX             = $CXX
   CXXFLAGS        = $CXXFLAGS
   FEATURES        = $MAGICK_FEATURES
+  DELEGATES       = $MAGICK_DELEGATES
 ])