add configure flags for magick load and save

so you can turn load and save on and off independently
This commit is contained in:
John Cupitt 2017-12-23 16:57:36 +00:00
parent 140a3b3ed0
commit 585469b192
6 changed files with 50 additions and 40 deletions

View File

@ -551,6 +551,7 @@ fi
# ImageMagick
AC_ARG_WITH([magick],
AS_HELP_STRING([--without-magick], [build without libMagic (default: test)]))
AC_ARG_WITH([magickpackage],
AS_HELP_STRING([--with-magickpackage],
[magickpackage to use (default: MagickCore; try GraphicsMagick to build against gm instead)]))
@ -575,17 +576,20 @@ fi
# we have a separate loader for magick7 with fewer ifdef
# options; only test for features on the magick6 case
magick_version=
if test x"$with_magick" != x"no"; then
PKG_CHECK_MODULES(MAGICK, $with_magickpackage >= 7.0,
[AC_DEFINE(HAVE_MAGICK7,1,[define if you have libMagick7 installed.])
with_magick="yes (magick7)"
with_magick=yes
magick7=yes
magick_version=magick7
PACKAGES_USED="$PACKAGES_USED $with_magickpackage"
],
[PKG_CHECK_MODULES(MAGICK, $with_magickpackage,
[AC_DEFINE(HAVE_MAGICK,1,[define if you have libMagick installed.])
with_magick="yes (magick6)"
with_magick=yes
magick6=yes
magick_version=magick6
PACKAGES_USED="$PACKAGES_USED $with_magickpackage"
],
[AC_MSG_WARN([$with_magickpackage not found; disabling Magick support])
@ -661,6 +665,24 @@ if test x"$magick6" = x"yes"; then
CFLAGS="$save_CFLAGS"
fi
# have flags to turn load and save off independently ... some people will want
# save but not load, for example
AC_ARG_ENABLE([magickload],
AS_HELP_STRING([--disable-magickload],
[disable libMagic load (default: enabled)]))
if test x"$enable_magickload" != x"no"; then
AC_DEFINE(ENABLE_MAGICKLOAD,1,[define to enable load with libMagick])
enable_magickload=yes
fi
AC_ARG_ENABLE([magicksave],
AS_HELP_STRING([--disable-magicksave],
[disable libMagic save (default: enabled)]))
if test x"$enable_magicksave" != x"no"; then
AC_DEFINE(ENABLE_MAGICKSAVE,1,[define to enable save with libMagick])
enable_magicksave=yes
fi
# orc
AC_ARG_WITH([orc],
AS_HELP_STRING([--without-orc], [build without orc (default: test)]))
@ -1191,7 +1213,9 @@ build PPM support: $with_ppm
* optional dependencies
use fftw3 for FFT: $with_fftw
Magick package: $with_magickpackage
file import with libMagick: $with_magick
Magick API version: $magick_version
load with libMagick: $enable_magickload
save with libMagick: $enable_magicksave
accelerate loops with orc: $with_orc
(requires orc-0.4.11 or later)
ICC profile support with lcms: $with_lcms

View File

@ -1879,27 +1879,22 @@ vips_foreign_operation_init( void )
vips_foreign_load_openslide_get_type();
#endif /*HAVE_OPENSLIDE*/
/* Should be removed and added as a configure option */
#define HAVE_MAGICKLOAD 1
#define HAVE_MAGICKSAVE 1
/* Should be removed and added as a configure option */
#ifdef ENABLE_MAGICKLOAD
#ifdef HAVE_MAGICK
vips_foreign_load_magick_file_get_type();
vips_foreign_load_magick_buffer_get_type();
#endif /*HAVE_MAGICK*/
#ifdef HAVE_MAGICKLOAD
#ifdef HAVE_MAGICK
vips_foreign_load_magick_file_get_type();
vips_foreign_load_magick_buffer_get_type();
#endif /*HAVE_MAGICK*/
#ifdef HAVE_MAGICK7
vips_foreign_load_magick7_file_get_type();
vips_foreign_load_magick7_buffer_get_type();
#endif /*HAVE_MAGICK7*/
#endif /*ENABLE_MAGICKLOAD*/
#ifdef HAVE_MAGICK7
vips_foreign_load_magick7_file_get_type();
vips_foreign_load_magick7_buffer_get_type();
#endif /*HAVE_MAGICK7*/
#endif /*HAVE_MAGICKLOAD*/
#ifdef HAVE_MAGICKSAVE
#ifdef ENABLE_MAGICKSAVE
vips_foreign_save_magick_file_get_type();
vips_foreign_save_magick_buffer_get_type();
#endif /*HAVE_MAGICKSAVE*/
#endif /*ENABLE_MAGICKSAVE*/
#ifdef HAVE_CFITSIO
vips_foreign_load_fits_get_type();

View File

@ -93,11 +93,8 @@
#endif /*HAVE_CONFIG_H*/
#include <vips/intl.h>
/* Should be removed and added as a configure option */
#define HAVE_MAGICKLOAD 1
/* Should be removed and added as a configure option */
#ifdef ENABLE_MAGICKLOAD
#ifdef HAVE_MAGICKLOAD
#ifdef HAVE_MAGICK
#include <stdio.h>
@ -898,4 +895,5 @@ vips__magick_read_buffer_header( const void *buf, const size_t len,
}
#endif /*HAVE_MAGICK*/
#endif /*HAVE_MAGICKLOAD*/
#endif /*ENABLE_MAGICKLOAD*/

View File

@ -50,11 +50,8 @@
#include <vips/buf.h>
#include <vips/internal.h>
/* Should be removed and added as a configure option */
#define HAVE_MAGICKLOAD 1
/* Should be removed and added as a configure option */
#ifdef ENABLE_MAGICKLOAD
#ifdef HAVE_MAGICKLOAD
#ifdef HAVE_MAGICK7
#include <MagickCore/MagickCore.h>
@ -916,4 +913,5 @@ vips_foreign_load_magick7_buffer_init( VipsForeignLoadMagick7Buffer *buffer )
}
#endif /*HAVE_MAGICK7*/
#endif /*HAVE_MAGICKLOAD*/
#endif /*ENABLE_MAGICKLOAD*/

View File

@ -58,11 +58,8 @@
#include <vips/buf.h>
#include <vips/internal.h>
/* Should be removed and added as a configure option */
#define HAVE_MAGICKLOAD 1
/* Should be removed and added as a configure option */
#ifdef ENABLE_MAGICKLOAD
#ifdef HAVE_MAGICKLOAD
#ifdef HAVE_MAGICK
#include "pforeign.h"
@ -330,7 +327,8 @@ vips_foreign_load_magick_buffer_init( VipsForeignLoadMagickBuffer *buffer )
}
#endif /*HAVE_MAGICK*/
#endif /*HAVE_MAGICKLOAD*/
#endif /*ENABLE_MAGICKLOAD*/
/**
* vips_magickload:

View File

@ -35,10 +35,7 @@
#endif /*HAVE_CONFIG_H*/
#include <vips/intl.h>
/* Should be removed and added as a configure option */
#define HAVE_MAGICKSAVE 1
#ifdef HAVE_MAGICKSAVE
#ifdef ENABLE_MAGICKSAVE
#include <stdio.h>
#include <stdlib.h>
@ -503,4 +500,4 @@ vips_foreign_save_magick_buffer_init( VipsForeignSaveMagickBuffer *buffer )
{
}
#endif /*HAVE_MAGICKSAVE*/
#endif /*ENABLE_MAGICKSAVE*/