Define ENABLE_DEPRECATED in config.h

Do not check for VIPS_ENABLE_DEPRECATED as it could
come from an earlier version of libvips.
This commit is contained in:
Kleis Auke Wolthuizen 2020-07-06 17:28:18 +02:00
parent 6329d35048
commit fb61f0fa44
6 changed files with 23 additions and 22 deletions

View File

@ -129,6 +129,7 @@ if test x"$enable_deprecated" != x"no"; then
VIPS_ENABLE_DEPRECATED=1 VIPS_ENABLE_DEPRECATED=1
enable_deprecated=yes enable_deprecated=yes
fi fi
AC_DEFINE_UNQUOTED(ENABLE_DEPRECATED,$VIPS_ENABLE_DEPRECATED,[define to build deprecated components])
AM_CONDITIONAL(ENABLE_DEPRECATED, [test x"$enable_deprecated" = x"yes"]) AM_CONDITIONAL(ENABLE_DEPRECATED, [test x"$enable_deprecated" = x"yes"])
# this gets pasted into version.h as a #define # this gets pasted into version.h as a #define

View File

@ -801,7 +801,7 @@ static void
vips_image_add_progress( VipsImage *image ) vips_image_add_progress( VipsImage *image )
{ {
if( vips__progress || if( vips__progress ||
#if VIPS_ENABLE_DEPRECATED #if ENABLE_DEPRECATED
g_getenv( "VIPS_PROGRESS" ) || g_getenv( "VIPS_PROGRESS" ) ||
g_getenv( "IM_PROGRESS" ) ) { g_getenv( "IM_PROGRESS" ) ) {
#else #else
@ -2517,7 +2517,7 @@ vips_get_disc_threshold( void )
*/ */
threshold = 100 * 1024 * 1024; threshold = 100 * 1024 * 1024;
#if VIPS_ENABLE_DEPRECATED #if ENABLE_DEPRECATED
if( (env = g_getenv( "VIPS_DISC_THRESHOLD" )) || if( (env = g_getenv( "VIPS_DISC_THRESHOLD" )) ||
(env = g_getenv( "IM_DISC_THRESHOLD" )) ) (env = g_getenv( "IM_DISC_THRESHOLD" )) )
#else #else

View File

@ -99,7 +99,7 @@
#include <vips/internal.h> #include <vips/internal.h>
#include <vips/vector.h> #include <vips/vector.h>
#if VIPS_ENABLE_DEPRECATED #if ENABLE_DEPRECATED
#include <vips/vips7compat.h> #include <vips/vips7compat.h>
#endif #endif
@ -463,7 +463,7 @@ vips_init( const char *argv0 )
g_free( locale ); g_free( locale );
bind_textdomain_codeset( GETTEXT_PACKAGE, "UTF-8" ); bind_textdomain_codeset( GETTEXT_PACKAGE, "UTF-8" );
#if VIPS_ENABLE_DEPRECATED #if ENABLE_DEPRECATED
if( g_getenv( "VIPS_INFO" ) || if( g_getenv( "VIPS_INFO" ) ||
g_getenv( "IM_INFO" ) ) g_getenv( "IM_INFO" ) )
#else #else
@ -496,7 +496,7 @@ vips_init( const char *argv0 )
vips__meta_init_types(); vips__meta_init_types();
vips__interpolate_init(); vips__interpolate_init();
#if VIPS_ENABLE_DEPRECATED #if ENABLE_DEPRECATED
im__format_init(); im__format_init();
#endif #endif
@ -531,7 +531,7 @@ vips_init( const char *argv0 )
(void) vips_load_plugins( "%s/vips-plugins-%d.%d", (void) vips_load_plugins( "%s/vips-plugins-%d.%d",
libdir, VIPS_MAJOR_VERSION, VIPS_MINOR_VERSION ); libdir, VIPS_MAJOR_VERSION, VIPS_MINOR_VERSION );
#if VIPS_ENABLE_DEPRECATED #if ENABLE_DEPRECATED
/* Load up any vips7 plugins in the vips libdir. We don't error on /* Load up any vips7 plugins in the vips libdir. We don't error on
* failure, it's too annoying to have VIPS refuse to start because of * failure, it's too annoying to have VIPS refuse to start because of
* a broken plugin. * a broken plugin.
@ -582,7 +582,7 @@ vips_init( const char *argv0 )
* set up if you are using libvips from something like Ruby. Allow this * set up if you are using libvips from something like Ruby. Allow this
* env var hack as a workaround. * env var hack as a workaround.
*/ */
#if VIPS_ENABLE_DEPRECATED #if ENABLE_DEPRECATED
if( g_getenv( "VIPS_WARNING" ) || if( g_getenv( "VIPS_WARNING" ) ||
g_getenv( "IM_WARNING" ) ) g_getenv( "IM_WARNING" ) )
#else #else
@ -693,7 +693,7 @@ vips_shutdown( void )
vips_cache_drop_all(); vips_cache_drop_all();
#if VIPS_ENABLE_DEPRECATED #if ENABLE_DEPRECATED
im_close_plugins(); im_close_plugins();
#endif #endif

View File

@ -426,7 +426,7 @@ vips_concurrency_get( void )
*/ */
if( vips__concurrency > 0 ) if( vips__concurrency > 0 )
nthr = vips__concurrency; nthr = vips__concurrency;
#if VIPS_ENABLE_DEPRECATED #if ENABLE_DEPRECATED
else if( ((str = g_getenv( "VIPS_CONCURRENCY" )) || else if( ((str = g_getenv( "VIPS_CONCURRENCY" )) ||
(str = g_getenv( "IM_CONCURRENCY" ))) && (str = g_getenv( "IM_CONCURRENCY" ))) &&
#else #else

View File

@ -102,7 +102,7 @@ vips_vector_init( void )
/* Look for the environment variable VIPS_NOVECTOR and use that to turn /* Look for the environment variable VIPS_NOVECTOR and use that to turn
* off as well. * off as well.
*/ */
#if VIPS_ENABLE_DEPRECATED #if ENABLE_DEPRECATED
if( g_getenv( "VIPS_NOVECTOR" ) || if( g_getenv( "VIPS_NOVECTOR" ) ||
g_getenv( "IM_NOVECTOR" ) ) g_getenv( "IM_NOVECTOR" ) )
#else #else

View File

@ -97,7 +97,7 @@
#include <vips/vips.h> #include <vips/vips.h>
#include <vips/internal.h> #include <vips/internal.h>
#if VIPS_ENABLE_DEPRECATED #if ENABLE_DEPRECATED
#include <vips/vips7compat.h> #include <vips/vips7compat.h>
#endif #endif
@ -186,7 +186,7 @@ static GOptionEntry main_option[] = {
{ NULL } { NULL }
}; };
#if VIPS_ENABLE_DEPRECATED #if ENABLE_DEPRECATED
typedef void *(*map_name_fn)( im_function * ); typedef void *(*map_name_fn)( im_function * );
/* Loop over a package. /* Loop over a package.
@ -253,7 +253,7 @@ list_function( im_function *func )
static int static int
print_list( int argc, char **argv ) print_list( int argc, char **argv )
{ {
#if VIPS_ENABLE_DEPRECATED #if ENABLE_DEPRECATED
if( !argv[0] || strcmp( argv[0], "packages" ) == 0 ) if( !argv[0] || strcmp( argv[0], "packages" ) == 0 )
im_map_packages( (VSListMap2Fn) list_package, NULL ); im_map_packages( (VSListMap2Fn) list_package, NULL );
else if( strcmp( argv[0], "classes" ) == 0 ) else if( strcmp( argv[0], "classes" ) == 0 )
@ -268,7 +268,7 @@ print_list( int argc, char **argv )
(VipsTypeMapFn) list_class, NULL ); (VipsTypeMapFn) list_class, NULL );
} }
else { else {
#if VIPS_ENABLE_DEPRECATED #if ENABLE_DEPRECATED
if( map_name( argv[0], list_function ) ) if( map_name( argv[0], list_function ) )
vips_error_exit( "unknown package \"%s\"", argv[0] ); vips_error_exit( "unknown package \"%s\"", argv[0] );
#else #else
@ -279,7 +279,7 @@ print_list( int argc, char **argv )
return( 0 ); return( 0 );
} }
#if VIPS_ENABLE_DEPRECATED #if ENABLE_DEPRECATED
/* Print "ln -s" lines for this package. /* Print "ln -s" lines for this package.
*/ */
static void * static void *
@ -331,7 +331,7 @@ isvips( const char *name )
return( vips_isprefix( "vips", name ) ); return( vips_isprefix( "vips", name ) );
} }
#if VIPS_ENABLE_DEPRECATED #if ENABLE_DEPRECATED
/* Print a usage string from an im_function descriptor. /* Print a usage string from an im_function descriptor.
*/ */
static void static void
@ -426,13 +426,13 @@ static GOptionEntry empty_options[] = {
}; };
static ActionEntry actions[] = { static ActionEntry actions[] = {
#if VIPS_ENABLE_DEPRECATED #if ENABLE_DEPRECATED
{ "list", N_( "list classes|packages|all|package-name|operation-name" ), { "list", N_( "list classes|packages|all|package-name|operation-name" ),
#else #else
{ "list", N_( "list classes|all|operation-name" ), { "list", N_( "list classes|all|operation-name" ),
#endif #endif
&empty_options[0], print_list }, &empty_options[0], print_list },
#if VIPS_ENABLE_DEPRECATED #if ENABLE_DEPRECATED
{ "links", N_( "generate links for vips/bin" ), { "links", N_( "generate links for vips/bin" ),
&empty_options[0], print_links }, &empty_options[0], print_links },
#endif #endif
@ -515,7 +515,7 @@ main( int argc, char **argv )
GOptionGroup *main_group; GOptionGroup *main_group;
GOptionGroup *group; GOptionGroup *group;
VipsOperation *operation; VipsOperation *operation;
#if VIPS_ENABLE_DEPRECATED #if ENABLE_DEPRECATED
im_function *fn; im_function *fn;
#endif #endif
int i, j; int i, j;
@ -603,10 +603,10 @@ main( int argc, char **argv )
; ;
if( main_option_plugin ) { if( main_option_plugin ) {
#if VIPS_ENABLE_DEPRECATED #if ENABLE_DEPRECATED
if( !im_load_plugin( main_option_plugin ) ) if( !im_load_plugin( main_option_plugin ) )
vips_error_exit( NULL ); vips_error_exit( NULL );
#else /*!VIPS_ENABLE_DEPRECATED*/ #else /*!ENABLE_DEPRECATED*/
GModule *module; GModule *module;
module = g_module_open( main_option_plugin, G_MODULE_BIND_LAZY ); module = g_module_open( main_option_plugin, G_MODULE_BIND_LAZY );
@ -672,7 +672,7 @@ main( int argc, char **argv )
break; break;
} }
#if VIPS_ENABLE_DEPRECATED #if ENABLE_DEPRECATED
/* Could be a vips7 im_function. We need to test for vips7 first, /* Could be a vips7 im_function. We need to test for vips7 first,
* since we don't want to use the vips7 compat wrappers in vips8 * since we don't want to use the vips7 compat wrappers in vips8
* unless we have to. They don't support all args types. * unless we have to. They don't support all args types.