GNOME Bugzilla – Bug 570327
gnome-utils fails to build outside source tree
Last modified: 2011-10-06 19:04:23 UTC
When building gnome-utils outside source tree, the following errors were found: - In gnome-dictionary/src/, gdict-app.c fails to build due to missing gdict-enum-types.h and gdict-version.h: ---8<--- make[3]: Entering directory `/home/thep/build/gnome_svn/gnome-utils/gnome-dictionary/src' gcc -DHAVE_CONFIG_H -I. -I/home/thep/vcs/gnome_svn/gnome-utils/gnome-dictionary/src -I../.. -DPREFIX=\""/home/gnome2"\" -DSYSCONFDIR=\""/home/gnome2/etc"\" -DLIBDIR=\""/home/gnome2/lib64"\" -DDATADIR=\""/home/gnome2/share"\" -DUIDATADIR=\""/home/gnome2/share/gnome-2.0/ui"\" -DPKGDATADIR=\""/home/gnome2/share/gnome-dictionary"\" -DGNOMELOCALEDIR=\""/home/gnome2/share/locale"\" -I../../gnome-dictionary -I/home/thep/vcs/gnome_svn/gnome-utils/gnome-dictionary -DORBIT2=1 -pthread -I/home/gnome2/include/glib-2.0 -I/home/gnome2/lib64/glib-2.0/include -I/home/gnome2/include/gconf/2 -I/home/gnome2/include/orbit-2.0 -I/home/gnome2/include/dbus-1.0 -I/home/gnome2/lib64/dbus-1.0/include -I/home/gnome2/include/gtk-2.0 -I/home/gnome2/lib64/gtk-2.0/include -I/home/gnome2/include/atk-1.0 -I/home/gnome2/include/cairo -I/home/gnome2/include/pango-1.0 -I/home/gnome2/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/home/gnome2/include/libglade-2.0 -I/home/gnome2/include/gtk-2.0 -I/home/gnome2/include/libxml2 -I/home/gnome2/lib64/gtk-2.0/include -I/home/gnome2/include/atk-1.0 -I/home/gnome2/include/cairo -I/home/gnome2/include/pango-1.0 -I/home/gnome2/include/glib-2.0 -I/home/gnome2/lib64/glib-2.0/include -I/home/gnome2/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -g -O2 -I/home/gnome2/include -MT gnome_dictionary-gdict-app.o -MD -MP -MF .deps/gnome_dictionary-gdict-app.Tpo -c -o gnome_dictionary-gdict-app.o `test -f 'gdict-app.c' || echo '/home/thep/vcs/gnome_svn/gnome-utils/gnome-dictionary/src/'`gdict-app.c In file included from /home/thep/vcs/gnome_svn/gnome-utils/gnome-dictionary/src/gdict-pref-dialog.h:27, from /home/thep/vcs/gnome_svn/gnome-utils/gnome-dictionary/src/gdict-app.c:38: /home/thep/vcs/gnome_svn/gnome-utils/gnome-dictionary/libgdict/gdict.h:33:30: error: gdict-enum-types.h: No such file or directory /home/thep/vcs/gnome_svn/gnome-utils/gnome-dictionary/libgdict/gdict.h:34:27: error: gdict-version.h: No such file or directory make[3]: *** [gnome_dictionary-gdict-app.o] Error 1 make[3]: Leaving directory `/home/thep/build/gnome_svn/gnome-utils/gnome-dictionary/src' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/home/thep/build/gnome_svn/gnome-utils/gnome-dictionary' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/thep/build/gnome_svn/gnome-utils' make: *** [all] Error 2 ---8<--- Both files are generated under $(top_builddir)/gnome-dictionary/libgdict/ So, libgdict/gdict.h cannot reach them with just #include "file.h" and '-I$(top_builddir)/gnome-dictionary' CFLAGS. - In gsearchtool/, 'make install' fails due to missing schemas file: ---8<--- if test -z "" ; then \ GCONF_CONFIG_SOURCE=xml:merged:/home/gnome2/etc/gconf/gconf.xml.defaults /home/gnome2/bin/gconftool-2 --makefile-install-rule /home/thep/vcs/gnome_svn/gnome-utils/gsearchtool/gnome-search-tool.schemas ; \ fi I/O warning : failed to load external entity "/home/thep/vcs/gnome_svn/gnome-utils/gsearchtool/gnome-search-tool.schemas" Failed to open `/home/thep/vcs/gnome_svn/gnome-utils/gsearchtool/gnome-search-tool.schemas': No such file or directory make[3]: *** [install-data-local] Error 1 make[3]: Leaving directory `/home/thep/build/gnome_svn/gnome-utils/gsearchtool' make[2]: *** [install-am] Error 2 make[2]: Leaving directory `/home/thep/build/gnome_svn/gnome-utils/gsearchtool' make[1]: *** [install-recursive] Error 1 make[1]: Leaving directory `/home/thep/build/gnome_svn/gnome-utils/gsearchtool' make: *** [install-recursive] Error 1 ---8<--- It tries to open the schemas file at $(srcdir), i.e. /home/thep/vcs/gnome_svn/... for my case, while the file is generated in $(builddir).
Created attachment 127818 [details] [review] Summarized patch This patch makes the build successful in my box. For the first error, I don't think it makes much sense to change gnome_dictionary_CFLAGS in gnome-dictionary/src/Makefile.am. The details of file inclusion should be hidden under the libgdict/ subdir. So, I fix the #include instead. Only generated files are included differently from static files.
Created attachment 127834 [details] [review] Updated patch, using $(top_builddir) instead of $(builddir) Use $(top_builddir), as some automake versions do not provide $(builddir), e.g. Bug #570357.
Btw, builddir is always equal to '.' , so you can just omit it.
(In reply to comment #3) > Btw, builddir is always equal to '.' , so you can just omit it. Not for non-source-tree builds.
Created attachment 127853 [details] [review] better yet, with $(builddir) totally omitted (In reply to comment #4) > (In reply to comment #3) > > Btw, builddir is always equal to '.' , so you can just omit it. > > Not for non-source-tree builds. Having a break and I just got what you said.. Yes, why bothering adding the path?
Anybody to review this fixed patch?
Index: gnome-dictionary/libgdict/gdict.h =================================================================== --- gnome-dictionary/libgdict/gdict.h (revision 8392) +++ gnome-dictionary/libgdict/gdict.h (working copy) @@ -30,7 +30,7 @@ #include "gdict-speller.h" #include "gdict-strategy-chooser.h" #include "gdict-utils.h" -#include "gdict-enum-types.h" -#include "gdict-version.h" +#include <libgdict/gdict-enum-types.h> +#include <libgdict/gdict-version.h> no, no, no. no. dear god, no. no. this is utterly stupid. you should change the include path when building gnome-dictionary, not *ever* the global include header of a publicly installed library. the second part of the patch looks all right, even though I would have used $(top_builddir)/gsearchtool instead.
Created attachment 133999 [details] [review] Fix the include flags instead (In reply to comment #7) > no, no, no. no. dear god, no. no. > > this is utterly stupid. you should change the include path when building > gnome-dictionary, not *ever* the global include header of a publicly installed > library. Silly me. I must be in a hurry to make my whole build pass, and to file bugs against several packages, so I did't notice that it's an installed header. > the second part of the patch looks all right, even though I would have used > $(top_builddir)/gsearchtool instead. Well, although it's not a practical benefit here, omitting the full path allows $(schema_DATA) to contain multiple files. I meaned, it's a safer form.
Created attachment 135546 [details] [review] Add fixes for libeggsmclient and libgnomeui-deprecated Update patch for recent build failures. Fixes for libeggsmclient and libgnomeui-deprecated are added. * Error for libeggsmclient: ---8<--- In file included from /home/thep/vcs/gnome_git/gnome-utils/gsearchtool/gsearchtool-support.c:42: /home/thep/vcs/gnome_git/gnome-utils/gsearchtool/gsearchtool-callbacks.h:36:25: error: eggsmclient.h: No such file or directory In file included from /home/thep/vcs/gnome_git/gnome-utils/gsearchtool/gsearchtool-support.c:42: /home/thep/vcs/gnome_git/gnome-utils/gsearchtool/gsearchtool-callbacks.h:39: error: expected ‘)’ before ‘*’ token /home/thep/vcs/gnome_git/gnome-utils/gsearchtool/gsearchtool-callbacks.h:121: error: expected ‘)’ before ‘*’ token ---8<--- Headers for libeggsmclient are in srcdir, not builddir. * Error for libgnomeui-deprecated ---8<--- make[3]: *** No rule to make target `/home/thep/vcs/gnome_git/gnome-utils/gsearchtool/libgnomeui-deprecated/libgnomeui-deprecated.la', needed by `gnome-search-tool'. Stop. ---8<--- libgnomeui-deprecated.la is under builddir, not srcdir.
Created attachment 136708 [details] [review] Updated patch, with autogen.sh change added Updated patch, with recent conflict resolved. Note that a fix for autogen.sh problem is also added. The error is: ---8<--- gnome-utils 2.27.3 configuration summary: Compiler flags : -g -O2 -I/home/gnome2/include -g Linker flags : -L/home/gnome2/lib64 Maintainer compiler flags : -Werror -Wall -Wshadow -Wcast-align -Wno-uninitialized -Wformat-security -Winit-self prefix : /home/gnome2 sysconf dir : ${prefix}/etc bin dir : ${exec_prefix}/bin sbin dir : ${exec_prefix}/sbin data dir : ${datarootdir} Debug messages (libgdict) : yes API Reference (libgdict) : no Logview built with ZLib support : yes Now type `make' to compile GNOME Utilities sed: can't read gtk-doc.make: No such file or directory sed: can't read gtk-doc.make: No such file or directory *** Error during phase configure of gnome-utils: ########## Error running /home/thep/vcs/gnome_git/gnome-utils/autogen.sh --prefix /home/gnome2 --libdir '/home/gnome2/lib64' --disable-static --disable-gtk-doc *** [1/1] ---8<--- In a clean builddir, gtk-doc.make is not available for the autogen.sh script. It needs to refer to $srcdir.
I don't think this is a problem anymore...anyway, gnome-utils as a meta-module is dissolving [1] now, so if it's still relevant for some of the split modules, should be filed as separate bugs. [1] https://mail.gnome.org/archives/desktop-devel-list/2011-September/msg00121.html