diff options
author | Stefan Kost <ensonic@users.sf.net> | 2011-05-18 15:58:48 +0300 |
---|---|---|
committer | Stefan Kost <ensonic@users.sf.net> | 2011-05-18 16:06:05 +0300 |
commit | 9e5bbd508588961696e70c38e764492e0312ec4c (patch) | |
tree | dcad3eb8825ae317654d9f08414c8db74659e23a | |
parent | 8e7c77f6a8891ecdb5514a7a391371e0d3f4d8c9 (diff) |
scangobj, make: behave according to build verbosity
Add --verbose parameter to scangobj (like upstream gtk-doc). Check the flags in
the makefile and pass them to the gtkdoc tools.
-rwxr-xr-x | gstdoc-scangobj | 43 | ||||
-rw-r--r-- | gtk-doc-plugins.mak | 13 |
2 files changed, 38 insertions, 18 deletions
diff --git a/gstdoc-scangobj b/gstdoc-scangobj index 74748fa..fa7532a 100755 --- a/gstdoc-scangobj +++ b/gstdoc-scangobj @@ -43,6 +43,7 @@ require "gtkdoc-common.pl"; my $MODULE; my $OUTPUT_DIR; my $INSPECT_DIR; +my $VERBOSE; my $PRINT_VERSION; my $PRINT_HELP; my $TYPE_INIT_FUNC="g_type_init ()"; @@ -55,10 +56,11 @@ my $TYPE_INIT_FUNC="g_type_init ()"; 'type-init-func' => \$TYPE_INIT_FUNC, 'output-dir' => \$OUTPUT_DIR, 'inspect-dir' => \$INSPECT_DIR, + 'verbose' => \$VERBOSE, 'version' => \$PRINT_VERSION, 'help' => \$PRINT_HELP); -GetOptions(\%optctl, "module=s", "source=s", "types:s", "output-dir:s", "inspect-dir:s", "nogtkinit", "type-init-func:s", "version", "help"); +GetOptions(\%optctl, "module=s", "source=s", "types:s", "output-dir:s", "inspect-dir:s", "nogtkinit", "type-init-func:s", "verbose", "version", "help"); if ($NO_GTK_INIT) { # Do nothing. This just avoids a warning. @@ -75,15 +77,19 @@ if (!$MODULE) { } if ($PRINT_HELP) { - print "gstdoc-scangobj version 1.5\n"; - print "\n--module=MODULE_NAME Name of the doc module being parsed"; - print "\n--source=SOURCE_NAME Name of the source module for plugins"; - print "\n--types=FILE The name of the file to store the types in"; - print "\n--type-init-func=FUNC The init function to call instead of g_type_init ()"; - print "\n--output-dir=DIRNAME The directory where the results are stored"; - print "\n--inspect-dir=DIRNAME The directory where the plugin inspect data is stored"; - print "\n--version Print the version of this program"; - print "\n--help Print this help\n"; + print <<EOF; +gstdoc-scangobj version 1.5 - introspect gstreamer-plugins + +--module=MODULE_NAME Name of the doc module being parsed +--source=SOURCE_NAME Name of the source module for plugins +--types=FILE The name of the file to store the types in +--type-init-func=FUNC The init function to call instead of g_type_init() +--output-dir=DIRNAME The directory where the results are stored +--inspect-dir=DIRNAME The directory where the plugin inspect data is stored +--verbose Print extra output while processing +--version Print the version of this program +--help Print this help +EOF exit 0; } @@ -1546,15 +1552,20 @@ if ($CC =~ /libtool/) { $o_file = "$MODULE-scan.o" } -print "gtk-doc: Compiling scanner\n"; -$command = "$CC $CFLAGS -c -o $o_file $MODULE-scan.c"; -system($command) == 0 or die "Compilation of scanner failed: $!\n"; +my $stdout=""; +if (!defined($VERBOSE) or $VERBOSE eq "0") { + $stdout=">/dev/null"; +} + +# Compiling scanner +$command = "$CC $stdout $CFLAGS -c -o $o_file $MODULE-scan.c"; +system("($command)") == 0 or die "Compilation of scanner failed: $!\n"; -print "gtk-doc: Linking scanner\n"; -$command = "$LD -o $MODULE-scan $o_file $LDFLAGS"; +# Linking scanner +$command = "$LD $stdout -o $MODULE-scan $o_file $LDFLAGS"; system($command) == 0 or die "Linking of scanner failed: $!\n"; -print "gtk-doc: Running scanner $MODULE-scan\n"; +# Running scanner $MODULE-scan "; system("sh -c ./$MODULE-scan") == 0 or die "Scan failed: $!\n"; if (!defined($ENV{"GTK_DOC_KEEP_INTERMEDIATE"})) { diff --git a/gtk-doc-plugins.mak b/gtk-doc-plugins.mak index 766d1d5..0a6a83a 100644 --- a/gtk-doc-plugins.mak +++ b/gtk-doc-plugins.mak @@ -124,12 +124,17 @@ scanobj-build.stamp: $(SCANOBJ_DEPS) $(basefiles) inspect if test -e $(srcdir)/$$f; then cp -u $(srcdir)/$$f . ; fi; \ done; \ fi; \ + scanobj_options=""; \ + if test "x$(V)" = "x1"; then \ + scanobj_options="--verbose"; \ + fi; \ $(INSPECT_ENVIRONMENT) \ CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" \ CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS) $(WARNING_CFLAGS)" \ LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \ - $(GST_DOC_SCANOBJ) --type-init-func="gst_init(NULL,NULL)" \ + $(GST_DOC_SCANOBJ) $$scanobj_options --type-init-func="gst_init(NULL,NULL)" \ --module=$(DOC_MODULE) --source=$(PACKAGE) --inspect-dir=$(INSPECT_DIR) && \ + echo " DOC Merging introspection data" && \ $(PYTHON) \ $(top_srcdir)/common/scangobj-merge.py $(DOC_MODULE); \ if test x"$(srcdir)" != x. ; then \ @@ -209,7 +214,11 @@ html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) @for f in $(content_files); do cp $(srcdir)/$$f html; done @cp -pr xml html @cp ../version.entities html - @cd html && gtkdoc-mkhtml $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) + @mkhtml_options=""; \ + if test "x$(V)" = "x1"; then \ + mkhtml_options="--verbose"; \ + fi; \ + cd html && gtkdoc-mkhtml $$mkhtml_options $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) @mv html/index.sgml html/index.sgml.bak @$(SED) "s/ href=\"$(DOC_MODULE)\// href=\"$(DOC_MODULE)-@GST_MAJORMINOR@\//g" html/index.sgml.bak >html/index.sgml @rm -f html/index.sgml.bak |