GNOME Bugzilla – Bug 156300
Generate *.types file, to avoid 'make dist' errors
Last modified: 2005-01-31 23:33:47 UTC
gtk-doc.make reads: EXTRA_DIST = \ ... $(DOC_MODULE).types \ But the file foo.types is not generate anywhere. Currently I store an empty file 'libidn.types' in GNU Libidn CVS to avoid the error, but it seems the tools could generate this file, as it does for many others. Thanks.
.types is not generated - it lists GObject types of your project. So an empty file is correct. gtk-doc.make could use a dist hook, I suppose, to allow no-GObject-type projects to avoid having this file.
Perhaps it would be possible to create the file, if missing, as a zero length file? Then it would exist during 'make dist', and there wouldn't be a warning. And I wouldn't have to store the zero length file in CVS. Thanks. --- gtk-doc.make 24 Oct 2004 17:11:01 +0200 1.9 +++ gtk-doc.make 31 Oct 2004 15:58:32 +0100 @@ -49,6 +49,7 @@ scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) @echo '*** Scanning header files ***' @-chmod -R u+w $(srcdir) + test -f $(DOC_MODULE).types || touch $(DOC_MODULE).types if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null ; then \ CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" CFLAGS="$(GTKDOC_CFLAGS)" LDFLAGS="$(GTKDOC_LIBS)" gtkdoc-scangobj $(SCANGOBJ_OPTIONS) --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \ else \
I'm using my patch in GNU Libidn/SASL/Shishi now, and with the following help in the example Makefile.am, it is working fine. Index: examples/Makefile.am =================================================================== RCS file: /cvs/gnome/gtk-doc/examples/Makefile.am,v retrieving revision 1.10 diff -u -p -r1.10 Makefile.am --- examples/Makefile.am 10 Sep 2004 14:10:15 -0000 1.10 +++ examples/Makefile.am 9 Nov 2004 18:53:20 -0000 @@ -67,3 +67,9 @@ include $(top_srcdir)/gtk-doc.make # Other files to distribute # e.g. EXTRA_DIST += version.xml.in EXTRA_DIST += + +# Files to remove for "make distclean". +# Only needed if you let the makefile create some files that are typically +# stored in CVS, such as $(DOC_MODULES).types. +# e.g. DISTCLEANFILES = libidn.types +DISTCLEANFILES =
This could be automated if gtk-doc had the ability to scan the library for get_type functions. For example: foo.types: ../foo/libfoo.so nm -D $< | grep 'get_type$' | sed -e 's/.*T \(.*\)/\1/' >$@ Perhaps there's a way to do this reliably within gtkdoc-scan[g]obj itself? Regards, Roger
The introspection work planned for GLib 2.8 will likely make this possible. It is probably not worth implementing unreliable heuristics before that.
Created attachment 36469 [details] [review] patch to use dist-hook rather than EXTRA_DIST Here's a patch to use dist-hook to copy the .types file only if it exists. Unless someone spots a problem I'll commit it tomorrow.
I've committed this, so everything should work without $(DOC_MODULE).types now. Reopen if it doesn't.
Thanks! There's a slight problem now, but it doesn't look serious. Part of gtk-doc.make reads as below. The problem is that it grep inside the *.types file even if the file doesn't exist. It generate a warning as below. If the warning is harmless, please close this again. ... make[4]: Entering directory `/home/jas/src/libidn/doc/reference' *** Scanning header files *** if grep -l '^..*$' ./libidn.types > /dev/null ; then \ CC="/bin/sh ../../libtool --mode=compile gcc -g -O2" LD="/bin/sh ../../libtool --mode=link gcc -g -O2 " CFLAGS="" LDFLAGS="" gtkdoc-scangobj --module=libidn --output-dir=. ; \ else \ cd . ; \ for i in libidn.args libidn.hierarchy libidn.interfaces libidn.prerequisites libidn.signals ; do \ test -f $i || touch $i ; \ done \ fi grep: ./libidn.types: No such file or directory cd . && \ gtkdoc-scan --module=libidn --source-dir=../../lib --ignore-headers="gunibreak.h gunicomp.h gunidecomp.h idn-int.h idn-free.h" touch scan-build.stamp *** Rebuilding template files *** ... scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) @echo '*** Scanning header files ***' @-chmod -R u+w $(srcdir) if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null ; then \ CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" CFLAGS="$(GTKDOC_CFLAGS)" LDFLAGS="$(GTKDOC_LIBS)" gtkdoc-scangobj $(SCANGOBJ_OPTIONS) --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \ else \ cd $(srcdir) ; \ for i in $(SCANOBJ_FILES) ; do \ test -f $$i || touch $$i ; \ done \ fi
The warning is harmless. But I've added a "2>&1" so the warning shouldn't appear any more.