diff --git a/ChangeLog b/ChangeLog index 8ea20633..8d6bd198 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ 14/8/20 started 8.11.2 - better libdir guessing [remi] +- don't load modules if we're built without modules 14/8/20 started 8.11.1 - add more example code to C docs diff --git a/configure.ac b/configure.ac index e5f2cc86..6e7815c7 100644 --- a/configure.ac +++ b/configure.ac @@ -459,6 +459,7 @@ else if test x"$gmodule_supported" = x"true"; then gmodule_supported_flag=yes gmodule_with_flag='module' + AC_DEFINE(ENABLE_MODULES,1,[define to enable loadable module support.]) AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) diff --git a/libvips/iofuncs/init.c b/libvips/iofuncs/init.c index a07c87d6..768c635b 100644 --- a/libvips/iofuncs/init.c +++ b/libvips/iofuncs/init.c @@ -536,11 +536,17 @@ vips_init( const char *argv0 ) vips_mosaicing_operation_init(); vips_g_input_stream_get_type(); +#ifdef ENABLE_MODULES /* Load any vips8 modules from the vips libdir. Keep going, even if * some modules fail to load. + * + * Only do this if we have been built as a set of loadable + * modules, or we might try loading an operation into a library that + * already has that operation built in. */ (void) vips_load_plugins( "%s/vips-modules-%d.%d", libdir, VIPS_MAJOR_VERSION, VIPS_MINOR_VERSION ); +#endif /*ENABLE_MODULES*/ #if ENABLE_DEPRECATED /* Load any vips8 plugins from the vips libdir.