diff --git a/ChangeLog b/ChangeLog index 9f19380f..ab5930cb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -14,6 +14,8 @@ - add VIPS_META_PAGE_HEIGHT metadata - IM6/IM7 magickload supports page/n/page-height, all_frames deprecated - gifload supports n/page-height +- added #defines for VIPS_SONAME, VIPS_LIBRARY_CURRENT, VIPS_LIBRARY_REVISION, + VIPS_LIBRARY_AGE 8/12/16 started 8.4.5 - allow libgsf-1.14.26 to help centos, thanks tdiprima diff --git a/libvips/Makefile.am b/libvips/Makefile.am index 015ac722..fa678ff6 100644 --- a/libvips/Makefile.am +++ b/libvips/Makefile.am @@ -64,6 +64,10 @@ EXTRA_DIST = \ CLEANFILES = +all-local: + echo '/* This file is autogenerated, do not edit. */' > include/vips/soname.h; \ + source libvips.la; echo "#define VIPS_SONAME \"$$dlname\"" >> include/vips/soname.h; + -include $(INTROSPECTION_MAKEFILE) INTROSPECTION_GIRS = INTROSPECTION_SCANNER_ARGS = --add-include-path=$(srcdir) diff --git a/libvips/include/vips/Makefile.am b/libvips/include/vips/Makefile.am index 33630384..69f51b28 100644 --- a/libvips/include/vips/Makefile.am +++ b/libvips/include/vips/Makefile.am @@ -37,6 +37,7 @@ pkginclude_HEADERS = \ region.h \ resample.h \ semaphore.h \ + soname.h \ threadpool.h \ thread.h \ transform.h \ @@ -70,6 +71,7 @@ vips_scan_headers = \ ${top_srcdir}/libvips/include/vips/morphology.h \ ${top_srcdir}/libvips/include/vips/draw.h \ ${top_srcdir}/libvips/include/vips/basic.h \ + ${top_srcdir}/libvips/include/vips/version.h \ ${top_srcdir}/libvips/include/vips/object.h enumtypes.h: $(vips_scan_headers) Makefile diff --git a/libvips/include/vips/private.h b/libvips/include/vips/private.h index d9648190..6e3bd497 100644 --- a/libvips/include/vips/private.h +++ b/libvips/include/vips/private.h @@ -56,11 +56,6 @@ extern "C" { */ #define VIPS_SIZEOF_HEADER (64) -/* Startup ABI check. - */ -int vips__init( const char *argv0 ); -size_t vips__get_sizeof_vipsobject( void ); - /* What we track for each mmap window. Have a list of these on an openin * VipsImage. */ @@ -183,6 +178,11 @@ void vips__demand_hint_array( struct _VipsImage *image, int vips__image_copy_fields_array( struct _VipsImage *out, struct _VipsImage *in[] ); +/* Deprecated. + */ +int vips__init( const char *argv0 ); +size_t vips__get_sizeof_vipsobject( void ); + #ifdef __cplusplus } #endif /*__cplusplus*/ diff --git a/libvips/include/vips/soname.h b/libvips/include/vips/soname.h new file mode 100644 index 00000000..7fd6c91d --- /dev/null +++ b/libvips/include/vips/soname.h @@ -0,0 +1,2 @@ +/* This file is autogenerated, do not edit. */ +#define VIPS_SONAME "libvips.so.42" diff --git a/libvips/include/vips/version.h.in b/libvips/include/vips/version.h.in index 85a2a5ae..465f3f8e 100644 --- a/libvips/include/vips/version.h.in +++ b/libvips/include/vips/version.h.in @@ -10,6 +10,21 @@ #define VIPS_MINOR_VERSION (@VIPS_MINOR_VERSION@) #define VIPS_MICRO_VERSION (@VIPS_MICRO_VERSION@) +/* The ABI version, as used for library versioning. + */ +#define VIPS_LIBRARY_CURRENT (@LIBRARY_CURRENT@) +#define VIPS_LIBRARY_REVISION (@LIBRARY_REVISION@) +#define VIPS_LIBRARY_AGE (@LIBRARY_AGE@) + +/** + * VIPS_SONAME: + * + * The name of the shared object containing the vips library, for example + * "libvips.so.42", or "libvips-42.dll". + */ + +#include "soname.h" + /* Not really anything to do with versions, but this is a handy place to put * it. */ diff --git a/libvips/include/vips/vips.h b/libvips/include/vips/vips.h index 174eeb3e..cb21d52d 100644 --- a/libvips/include/vips/vips.h +++ b/libvips/include/vips/vips.h @@ -164,14 +164,15 @@ extern "C" { * not have _(). */ #define VIPS_INIT( ARGV0 ) \ - (sizeof( VipsObject ) != vips__get_sizeof_vipsobject() ? ( \ + (vips_version( 3 ) - vips_version( 5 ) != \ + VIPS_LIBRARY_CURRENT - VIPS_LIBRARY_AGE ? ( \ vips_info( "vips_init", "ABI mismatch" ), \ vips_info( "vips_init", \ - "library has sizeof(VipsObject) == %zd", \ - vips__get_sizeof_vipsobject() ), \ + "library has ABI version %d", \ + vips_version( 3 ) - vips_version( 5 ) ), \ vips_info( "vips_init", \ - "application has sizeof(VipsObject) == %zd", \ - sizeof( VipsObject ) ), \ + "application needs ABI version %d", \ + VIPS_LIBRARY_CURRENT - VIPS_LIBRARY_AGE ), \ vips_error( "vips_init", "ABI mismatch" ), \ -1 ) : \ vips_init( ARGV0 )) diff --git a/libvips/iofuncs/Makefile.am b/libvips/iofuncs/Makefile.am index eff85d1b..0a7807dc 100644 --- a/libvips/iofuncs/Makefile.am +++ b/libvips/iofuncs/Makefile.am @@ -68,6 +68,7 @@ vips_scan_headers = \ ${top_srcdir}/libvips/include/vips/morphology.h \ ${top_srcdir}/libvips/include/vips/draw.h \ ${top_srcdir}/libvips/include/vips/basic.h \ + ${top_srcdir}/libvips/include/vips/version.h \ ${top_srcdir}/libvips/include/vips/object.h enumtypes.c: $(vips_scan_headers) Makefile diff --git a/libvips/iofuncs/init.c b/libvips/iofuncs/init.c index 5650be42..3aa7a4c4 100644 --- a/libvips/iofuncs/init.c +++ b/libvips/iofuncs/init.c @@ -432,20 +432,6 @@ vips_init( const char *argv0 ) return( 0 ); } -/* Return the sizeof() various important data structures. These are checked - * against the headers used to build our caller by vips_init(). - * - * We allow direct access to members of VipsImage and VipsRegion (mostly for - * reasons of history), so any change to a superclass of either of these - * objects will break our ABI. - */ - -size_t -vips__get_sizeof_vipsobject( void ) -{ - return( sizeof( VipsObject ) ); -} - /* Call this before vips stuff that uses stuff we need to have inited. */ void @@ -1029,6 +1015,9 @@ vips_version_string( void ) * Get the major, minor or micro library version, with @flag values 0, 1 and * 2. * + * Get the ABI current, revision and age (as used by libtool) with @flag + * values 3, 4, 5. + * * Returns: library version number */ int @@ -1037,15 +1026,24 @@ vips_version( int flag ) switch( flag ) { case 0: return( VIPS_MAJOR_VERSION ); - + case 1: return( VIPS_MINOR_VERSION ); - + case 2: return( VIPS_MICRO_VERSION ); + case 3: + return( VIPS_LIBRARY_CURRENT ); + + case 4: + return( VIPS_LIBRARY_REVISION ); + + case 5: + return( VIPS_LIBRARY_AGE ); + default: - vips_error( "vips_version", "%s", _( "flag not 0, 1, 2" ) ); + vips_error( "vips_version", "%s", _( "flag not in [0, 5]" ) ); return( -1 ); } } @@ -1064,3 +1062,12 @@ vips_leak_set( gboolean leak ) { vips__leak = leak; } + +/* Deprecated. + */ +size_t +vips__get_sizeof_vipsobject( void ) +{ + return( sizeof( VipsObject ) ); +} +