After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 156300 - Generate *.types file, to avoid 'make dist' errors
Generate *.types file, to avoid 'make dist' errors
Status: RESOLVED FIXED
Product: gtk-doc
Classification: Platform
Component: general
unspecified
Other Linux
: Low enhancement
: ---
Assigned To: gtk-doc maintainers
gtk-doc maintainers
Depends on: 139486
Blocks:
 
 
Reported: 2004-10-24 16:03 UTC by Simon Josefsson
Modified: 2005-01-31 23:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch to use dist-hook rather than EXTRA_DIST (750 bytes, patch)
2005-01-24 16:22 UTC, Damon Chaplin
none Details | Review

Description Simon Josefsson 2004-10-24 16:03:39 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.
Comment 1 Owen Taylor 2004-10-24 17:51:43 UTC
.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.
Comment 2 Simon Josefsson 2004-10-31 15:00:05 UTC
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 \
Comment 3 Simon Josefsson 2004-11-09 18:54:34 UTC
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 =
Comment 4 Roger Leigh 2005-01-24 10:29:24 UTC
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
Comment 5 Matthias Clasen 2005-01-24 14:24:46 UTC
The introspection work planned for GLib 2.8 will likely make this possible.
It is probably not worth implementing unreliable heuristics before that.
Comment 6 Damon Chaplin 2005-01-24 16:22:32 UTC
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.
Comment 7 Damon Chaplin 2005-01-28 11:18:02 UTC
I've committed this, so everything should work without $(DOC_MODULE).types now.
Reopen if it doesn't.
Comment 8 Simon Josefsson 2005-01-29 23:28:24 UTC
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
Comment 9 Damon Chaplin 2005-01-31 23:33:47 UTC
The warning is harmless. But I've added a "2>&1" so the warning shouldn't appear
any more.