fix up introspect program

and test with --disable-introspection
This commit is contained in:
John Cupitt 2014-12-20 10:28:30 +00:00
parent e5b55a9398
commit da007b22e6
2 changed files with 25 additions and 5 deletions

View File

@ -81,14 +81,14 @@ INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir)
if HAVE_INTROSPECTION
AM_CPPFLAGS = \
`pkg-config gobject-introspection-1.0 --cflags` \
-I${top_srcdir}/libvips/include \
@VIPS_CFLAGS@ \
@VIPS_INCLUDES@
@VIPS_INCLUDES@ \
@INTROSPECTION_CFLAGS@
AM_LDFLAGS = \
`pkg-config gobject-introspection-1.0 --libs` \
@INTROSPECTION_LIBS@ \
@LDFLAGS@
LDADD = @VIPS_CFLAGS@ libvips.la @VIPS_LIBS@
LDADD = @INTROSPECTION_LIBS@ @VIPS_CFLAGS@ libvips.la @VIPS_LIBS@
if ENABLE_CXX
LDADD += @VIPS_CXX_LIBS@
endif

View File

@ -32,6 +32,10 @@
*/
/*
#define DEBUG
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif /*HAVE_CONFIG_H*/
@ -46,7 +50,7 @@ static char *main_option_introspect_dump = NULL;
static GOptionEntry main_option[] = {
{ "introspect-dump", 'i', 0,
G_OPTION_ARG_NONE, &main_option_introspect_dump,
G_OPTION_ARG_STRING, &main_option_introspect_dump,
N_( "dump introspection data" ), NULL },
{ NULL }
};
@ -60,6 +64,7 @@ main( int argc, char *argv[] )
if( VIPS_INIT( argv[0] ) )
vips_error_exit( "unable to start VIPS" );
textdomain( GETTEXT_PACKAGE );
setlocale( LC_ALL, "" );
@ -81,6 +86,21 @@ main( int argc, char *argv[] )
g_option_context_free( context );
#ifdef DEBUG
/* For debugging it's handy to have a copy of the input file.
*/
if( main_option_introspect_dump ) {
char **args;
char *cmd;
args = g_strsplit( main_option_introspect_dump, ",", 2 );
cmd = g_strdup_printf( "cp %s ~/functions.txt", args[0]);
printf( "introspect: running '%s'\n", cmd );
system( cmd );
g_free( cmd );
}
#endif /*DEBUG*/
if( main_option_introspect_dump &&
!g_irepository_dump( main_option_introspect_dump, &error ) ) {
if( error ) {