GNOME Bugzilla – Bug 569806
Support non-source-dir build
Last modified: 2009-08-13 05:02:19 UTC
When building libsigc++ outside source tree, following errors are found: - In sigc++/ it fails to create functors/functor_trait.h because $(builddir)/functors/ was not created yet: ---8<--- Making all in sigc++ make[2]: Entering directory `/home/thep/build/gnome_svn/libsigc++2/sigc++' m4 -I /home/thep/vcs/gnome_svn/libsigc++2/sigc++/macros -I macros /home/thep/vcs/gnome_svn/libsigc++2/sigc++/functors/macros/functor_trait.h.m4 > functors/functor_trait.h make[2]: Leaving directory `/home/thep/build/gnome_svn/libsigc++2/sigc++' make[1]: Leaving directory `/home/thep/build/gnome_svn/libsigc++2' /bin/sh: functors/functor_trait.h: No such file or directory make[2]: *** [functors/functor_trait.h] Error 1 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2 ---8<--- - In docs/manual/ the 'all-local' target fails because there is no rule to build $(srcdir)/html/index.html. (Sorry, the log was lost after I patched it.) - In docs/reference/ the 'install-reference' target fails because it depends on $(srcdir)/html/index.html, rather than the generated $(builddir)/html/index.html: ---8<--- make[3]: *** No rule to make target `/home/thep/vcs/gnome_svn/libsigc++2/docs/reference/html/index.html', needed by `install-reference'. Stop. make[3]: Leaving directory `/home/thep/build/gnome_svn/libsigc++2/docs/reference' make[2]: *** [install-am] Error 2 make[2]: Leaving directory `/home/thep/build/gnome_svn/libsigc++2/docs/reference' make[1]: *** [install-recursive] Error 1 make[1]: Leaving directory `/home/thep/build/gnome_svn/libsigc++2/docs' make: *** [install-recursive] Error 1 ---8<---
That's surprising. A patch would be welcome.
Created attachment 127528 [details] [review] A fix For sigc++/Makefile.am, I find the uncalled 'build-subdirs-stamp' rule. My quick hack is to put it as a dependency of the abstract rule for building *.{h,cc} from *.m4. This may not be optimal, but it works. Feel free to suggest a better way. For docs/{manual,reference}/Makefile.am, I think the $(srcdir)/ prefixes are totally unnecessary. Just remove them and simply the build dir is meant instead.
(In reply to comment #2) > Created an attachment (id=127528) [edit] > A fix > > For sigc++/Makefile.am, I find the uncalled 'build-subdirs-stamp' rule. I don't understand what the problem is there, so I hesitate to commit this patch.
(In reply to comment #3) > (In reply to comment #2) > > Created an attachment (id=127528) [edit] > > A fix > > > > For sigc++/Makefile.am, I find the uncalled 'build-subdirs-stamp' rule. > > I don't understand what the problem is there, so I hesitate to commit this > patch. As said in the initial report, it fails to generate functors/functor_trait.h because $(builddir)/functors/ was not created. Under sigc++/, functors/functor_trait.h is to be generated from functors/macros/functor_trait.h.m4. However, as functors/ subdir is not handled by autotools (e.g. not listed as SUBDIRS in Makefile.am), the make rules must take care to prepare it under $(builddir). This appears to have already been prepared with the build-subdirs-stamp target, with the author's comment saying s/he's not sure where to invoke it. So, I just added it as a prerequisite to the generic rules, for one-time creation.
Resolved the bug as obsolete. After recent document building system revamp in the git tree, all relevant changes proposed here become obsolete, and it now builds fine outside source tree. Thanks for the work!