2008-11-25 Colin Walters <walters@verbum.org>
+ * tools/g-ir-scanner: Add --libtool option which we expect Automake-using
+ people to pass.
+ * giscanner/dumper.py: Implement it.
+ * gir/Makefile.am, tests/**/Makefile.am: Use it.
+
+2008-11-25 Colin Walters <walters@verbum.org>
+
* tests/scanner/Makefile.am: Remove hand-rolled generation of .tgir; easier
to just use a Makefile rule and dependencies. This corresponds with a change
made to gir-repository to fix srcdir != builddir issues.
Disable usage of libtool for compiling stub introspection binary. Use this
if your build system does not require libtool.
.TP
+.B \---libtool
+Full path to libtool executable. Typically used for Automake systems.
+.TP
.B ---nsversion=VERSION
The namespace version. For instance 1.0. This is usually the platform version,
eg 2.0 for Gtk+, not 2.12.7.
--noclosure \
--output $@ \
--strip-prefix=g \
+ --libtool="$(LIBTOOL)" \
--library=$(GLIB_LIBRARY) \
$(CPPFLAGS) \
-I$(GLIB_INCLUDEDIR) \
--noclosure \
--output $@ \
--strip-prefix=g \
+ --libtool="$(LIBTOOL)" \
--include=GLib-2.0 \
--library=$(GOBJECT_LIBRARY) \
-I$(GOBJECT_INCLUDEDIR) \
--noclosure \
--output $@ \
--strip-prefix=g \
+ --libtool="$(LIBTOOL)" \
--include=GLib-2.0 \
--library=$(GMODULE_LIBRARY) \
-I$(GMODULE_INCLUDEDIR) \
--noclosure \
--output $@ \
--strip-prefix=g \
+ --libtool="$(LIBTOOL)" \
--include=GObject-2.0 \
--library=$(GIO_LIBRARY) \
-I$(GIO_INCLUDEDIR) \
--noclosure \
--output $@ \
--strip-prefix=g \
+ --libtool="$(LIBTOOL)" \
--include=GObject-2.0 \
--library=girepository \
-I$(srcdir)/girepository \
def _use_libtool_infection(self):
libtool_infection = not self._options.nolibtool
if not libtool_infection:
- return False
+ return None
+
+ if self._options.libtool_path:
+ # Automake by default sets:
+ # LIBTOOL = $(SHELL) $(top_builddir)/libtool
+ # To be strictly correct we would have to parse shell. For now
+ # we simply split().
+ return self._options.libtool_path.split()
try:
subprocess.check_call(['libtool', '--version'])
except subprocess.CalledProcessError, e:
# If libtool's not installed, assume we don't need it
- return False
+ return None
- return True
+ return ['libtool']
def _compile(self, output, *sources):
args = [self._compiler_cmd]
def _link(self, output, *sources):
args = []
- if self._use_libtool_infection():
- args.extend(['libtool', '--mode=link'])
+ libtool = self._use_libtool_infection()
+ if libtool:
+ args.extend(libtool)
+ args.append('--mode=link')
args.extend([self._linker_cmd, '-o', output])
Everything-$(TYPELIB_VERSION).gir: libgirepository-everything.la everything.c everything.h $(SCANNER_BIN) $(SCANNER_LIBS)
$(CHECK_DEBUG) $(SCANNER) \
--include=GObject-2.0 \
+ --libtool="$(LIBTOOL)" \
--library=girepository-everything \
--namespace=Everything --nsversion=$(TYPELIB_VERSION) \
--pkg gobject-2.0 \
offsets-1.0.gir: liboffsets.la offsets.h $(SCANNER_BIN) $(SCANNER_LIBS) Makefile
$(CHECK_DEBUG) $(SCANNER) \
+ --libtool="$(LIBTOOL)" \
--library=offsets \
--namespace=offsets \
--nsversion=1.0 \
$(CHECK_DEBUG) $(SCANNER) \
--include=GObject-2.0 \
--include=utility-1.0 \
+ --libtool="$(LIBTOOL)" \
--library=annotation \
--namespace=annotation \
--nsversion=1.0 \
$(CHECK_DEBUG) $(SCANNER) \
--include=GObject-2.0 \
--include=utility-1.0 \
+ --libtool="$(LIBTOOL)" \
--library=drawable \
--namespace=drawable \
--nsversion=1.0 \
$(CHECK_DEBUG) $(SCANNER) \
--include=GObject-2.0 \
--include=utility-1.0 \
+ --libtool="$(LIBTOOL)" \
--library=foo \
--namespace=foo \
--nsversion=1.0 \
utility-1.0.gir: libutility.la utility.h $(SCANNER_BIN) $(SCANNER_LIBS) Makefile
$(CHECK_DEBUG) $(SCANNER) \
--include=GObject-2.0 \
+ --libtool="$(LIBTOOL)" \
--library=utility \
--namespace=utility \
--nsversion=1.0 \
GtkFrob-1.0.gir: libgtkfrob.la gtkfrob.h $(SCANNER_BIN) $(SCANNER_LIBS) Makefile
$(CHECK_DEBUG) $(SCANNER) \
--include=GObject-2.0 \
+ --libtool="$(LIBTOOL)" \
--library=gtkfrob \
--namespace=GtkFrob \
--strip-prefix=Gtk \
BarApp-1.0.gir: barapp $(SCANNER_BIN) $(SCANNER_LIBS) Makefile
$(SCANNER) \
--include=GObject-2.0 \
+ --libtool="$(LIBTOOL)" \
--program=./barapp \
--namespace=BarApp \
--strip-prefix=Bar \
parser.add_option("", "--program-arg",
action="append", dest="program_args", default=[],
help="extra arguments to program")
+ parser.add_option("", "--libtool",
+ action="store", dest="libtool_path", default=None,
+ help="full path to libtool")
parser.add_option("", "--no-libtool",
action="store_true", dest="nolibtool", default=False,
help="use libtool")