From 8c19e07ae332201725078cfab4c06a0518534d3b Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Fri, 12 Jun 2020 17:30:57 +0100 Subject: [PATCH] add --vips-config flag so "vips --vips-config" now displays: ``` $ vips --vips-config native win32: no, native OS X: no, open files in binary mode: no, ... ``` --- ChangeLog | 1 + configure.ac | 6 +++++- libvips/include/vips/version.h.in | 2 ++ libvips/iofuncs/init.c | 12 ++++++++++++ 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index f4245704..4176ca9b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -28,6 +28,7 @@ vips_autorot_get_angle() [Elad-Laufer] - deprecate heifload autorotate -- it's now always on - revised resize improves accuracy [kleisauke] +- add --vips-config flag to show configuration info 24/4/20 started 8.9.3 - better iiif tile naming [IllyaMoskvin] diff --git a/configure.ac b/configure.ac index 0c1e5c76..97a82b50 100644 --- a/configure.ac +++ b/configure.ac @@ -1307,11 +1307,15 @@ VIPS_CFLAGS="$VIPS_DEBUG_FLAGS $VIPS_CFLAGS" VIPS_INCLUDES="$ZLIB_INCLUDES $PNG_INCLUDES $TIFF_INCLUDES $JPEG_INCLUDES $NIFTI_INCLUDES" VIPS_LIBS="$ZLIB_LIBS $HEIF_LIBS $MAGICK_LIBS $PNG_LIBS $IMAGEQUANT_LIBS $TIFF_LIBS $JPEG_LIBS $GTHREAD_LIBS $GIO_LIBS $REQUIRED_LIBS $EXPAT_LIBS $PANGOFT2_LIBS $GSF_LIBS $FFTW_LIBS $ORC_LIBS $LCMS_LIBS $GIFLIB_LIBS $RSVG_LIBS $NIFTI_LIBS $PDFIUM_LIBS $POPPLER_LIBS $OPENEXR_LIBS $OPENSLIDE_LIBS $CFITSIO_LIBS $LIBWEBP_LIBS $LIBWEBPMUX_LIBS $MATIO_LIBS $EXIF_LIBS -lm" +# autoconf hates multi-line AC_SUBST +VIPS_CONFIG="native win32: $vips_os_win32, native OS X: $vips_os_darwin, open files in binary mode: $vips_binary_open, enable debug: $enable_debug, enable deprecated library components: $enable_deprecated, enable docs with gtkdoc: $enable_gtk_doc, gobject introspection: $found_introspection, enable radiance support: $with_radiance, enable analyze support: $with_analyze, enable PPM support: $with_ppm, use fftw3 for FFT: $with_fftw, Magick package: $with_magickpackage, Magick API version: $magick_version, load with libMagick: $enable_magickload, save with libMagick: $enable_magicksave, accelerate loops with orc: $with_orc, ICC profile support with lcms: $with_lcms, file import with niftiio: $with_nifti, file import with libheif: $with_heif, file import with OpenEXR: $with_OpenEXR, file import with OpenSlide: $with_openslide, file import with matio: $with_matio, PDF import with PDFium: $with_pdfium, PDF import with poppler-glib: $with_poppler, SVG import with librsvg-2.0: $with_rsvg, zlib: $with_zlib, file import with cfitsio: $with_cfitsio, file import/export with libwebp: $with_libwebp, text rendering with pangoft2: $with_pangoft2, file import/export with libpng: $with_png, support 8bpp PNG quantisation: $with_imagequant, file import/export with libtiff: $with_tiff, file import/export with giflib: $with_giflib, file import/export with libjpeg: $with_jpeg, image pyramid export: $with_gsf, use libexif to load/save JPEG metadata: $with_libexif" + AC_SUBST(VIPS_LIBDIR) AC_SUBST(VIPS_CFLAGS) AC_SUBST(VIPS_INCLUDES) AC_SUBST(VIPS_LIBS) +AC_SUBST(VIPS_CONFIG) AC_SUBST(PACKAGES_USED) AC_SUBST(EXTRA_LIBS_USED) @@ -1391,7 +1395,7 @@ file import with OpenEXR: $with_OpenEXR file import with OpenSlide: $with_openslide (requires openslide-3.3.0 or later) file import with matio: $with_matio -PDF import with PDFium $with_pdfium +PDF import with PDFium: $with_pdfium PDF import with poppler-glib: $with_poppler (requires poppler-glib 0.16.0 or later) SVG import with librsvg-2.0: $with_rsvg diff --git a/libvips/include/vips/version.h.in b/libvips/include/vips/version.h.in index 465f3f8e..1732ff96 100644 --- a/libvips/include/vips/version.h.in +++ b/libvips/include/vips/version.h.in @@ -16,6 +16,8 @@ #define VIPS_LIBRARY_REVISION (@LIBRARY_REVISION@) #define VIPS_LIBRARY_AGE (@LIBRARY_AGE@) +#define VIPS_CONFIG "@VIPS_CONFIG@" + /** * VIPS_SONAME: * diff --git a/libvips/iofuncs/init.c b/libvips/iofuncs/init.c index db931cb8..610aec1e 100644 --- a/libvips/iofuncs/init.c +++ b/libvips/iofuncs/init.c @@ -741,6 +741,15 @@ vips_lib_version_cb( const gchar *option_name, const gchar *value, exit( 0 ); } +static gboolean +vips_lib_config_cb( const gchar *option_name, const gchar *value, + gpointer data, GError **error ) +{ + printf( "%s\n", VIPS_CONFIG ); + vips_shutdown(); + exit( 0 ); +} + static gboolean vips_cache_max_cb( const gchar *option_name, const gchar *value, gpointer data, GError **error ) @@ -823,6 +832,9 @@ static GOptionEntry option_entries[] = { { "vips-version", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, (gpointer) &vips_lib_version_cb, N_( "print libvips version" ), NULL }, + { "vips-config", 0, G_OPTION_FLAG_NO_ARG, + G_OPTION_ARG_CALLBACK, (gpointer) &vips_lib_config_cb, + N_( "print libvips config" ), NULL }, { "vips-pipe-read-limit", 0, 0, G_OPTION_ARG_INT64, (gpointer) &vips_pipe_read_limit, N_( "read at most this many bytes from a pipe" ), NULL },