scanner: Don't link to -lgirepository when dumping

This helps us avoid a problematic case where in say jhbuild, using
a system (/usr/lib) glib, adding in -l girepository-1.0 will inject
-L /path/to/builddir, when we don't want that.

https://bugzilla.gnome.org/show_bug.cgi?id=630342
This commit is contained in:
Colin Walters 2010-09-30 10:44:12 -04:00
parent 9468bd36c9
commit 26841c0b51
2 changed files with 11 additions and 2 deletions

View File

@ -53,7 +53,7 @@ libgirepository_1_0_la_SOURCES = \
giunioninfo.c \ giunioninfo.c \
givfuncinfo.c givfuncinfo.c
libgirepository_1_0_la_CPPFLAGS = $(GIREPO_CFLAGS) libgirepository_1_0_la_CPPFLAGS = $(GIREPO_CFLAGS) -DG_IREPOSITORY_COMPILATION
libgirepository_1_0_la_LIBADD = $(GIREPO_LIBS) libgirepository_1_0_la_LIBADD = $(GIREPO_LIBS)
libgirepository_1_0_la_LDFLAGS = -no-undefined -version-number 1:0:0 libgirepository_1_0_la_LDFLAGS = -no-undefined -version-number 1:0:0
@ -69,3 +69,5 @@ libgirepository_parser_la_SOURCES = \
girwriter.h girwriter.h
libgirepository_parser_la_CFLAGS = $(GIREPO_CFLAGS) libgirepository_parser_la_CFLAGS = $(GIREPO_CFLAGS)
gdumpdir = $(datadir)/gobject-introspection-1.0/
gdump_DATA = gdump.c

View File

@ -24,8 +24,15 @@
#include <glib-object.h> #include <glib-object.h>
#include <gio/gio.h> #include <gio/gio.h>
#include "girepository.h" /* This file is both compiled into libgirepository.so, and installed
* on the filesystem. But for the dumper, we want to avoid linking
* to libgirepository; see
* https://bugzilla.gnome.org/show_bug.cgi?id=630342
*/
#ifdef G_IREPOSITORY_COMPILATION
#include "config.h" #include "config.h"
#include "girepository.h"
#endif
#include <string.h> #include <string.h>