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 569957 - dasher fails to build outside source tree
dasher fails to build outside source tree
Status: RESOLVED FIXED
Product: dasher
Classification: Applications
Component: general
4.9.x
Other Linux
: Normal minor
: ---
Assigned To: Patrick Welche
dasher-maint
Depends on:
Blocks: 569778
 
 
Reported: 2009-01-31 10:00 UTC by Theppitak Karoonboonyanan
Modified: 2009-03-02 14:13 UTC
See Also:
GNOME target: ---
GNOME version: 2.25/2.26


Attachments
Fix #include's for config.h (2.30 KB, patch)
2009-01-31 10:02 UTC, Theppitak Karoonboonyanan
none Details | Review

Description Theppitak Karoonboonyanan 2009-01-31 10:00:26 UTC
When building dasher from outside source tree, this error was found:

---8<---
g++ -DHAVE_CONFIG_H -I. -I/home/thep/vcs/gnome_svn/dasher/Src/DasherCore/LanguageModelling -I../../..     -g -O2 -MT CTWLanguageModel.o -MD -MP -MF .deps/CTWLanguageModel.Tpo -c -o CTWLanguageModel.o /home/thep/vcs/gnome_svn/dasher/Src/DasherCore/LanguageModelling/CTWLanguageModel.cpp
In file included from /home/thep/vcs/gnome_svn/dasher/Src/DasherCore/LanguageModelling/../SettingsStore.h:14,
                 from /home/thep/vcs/gnome_svn/dasher/Src/DasherCore/LanguageModelling/../DasherComponent.h:4,
                 from /home/thep/vcs/gnome_svn/dasher/Src/DasherCore/LanguageModelling/LanguageModel.h:15,
                 from /home/thep/vcs/gnome_svn/dasher/Src/DasherCore/LanguageModelling/CTWLanguageModel.h:30,
                 from /home/thep/vcs/gnome_svn/dasher/Src/DasherCore/LanguageModelling/CTWLanguageModel.cpp:26:
/home/thep/vcs/gnome_svn/dasher/Src/DasherCore/LanguageModelling/../Parameters.h:27:26: error: ../../config.h: No such file or directory
---8<---

The '#include "../../config.h"' preprocessor in Src/DasherCore/Parameters.h relies on the fact that config.h is located under the same subtree as the other source. Unfortunately, this is not true for non-source-dir builds, where the config.h generated from config.h.in is located outside the source tree.

In fact, GNU autotools already supply "-I$(top_builddir)" to CFLAGS ("-I../../.." in above example) for this purpose, so that the generated config.h can be included with just '#include "config.h"' in every source file. So, I think all instances of such #include statement should be replaced, to allow non-source-dir builds.
Comment 1 Theppitak Karoonboonyanan 2009-01-31 10:02:52 UTC
Created attachment 127615 [details] [review]
Fix #include's for config.h

This patch allows non-source-tree build of dasher in my machine.
Comment 2 Patrick Welche 2009-03-02 11:45:33 UTC
- see that there are some #ifdef _WIN32, which probably should be #ifdef HAVE_CONFIG_H
- will fiddle the autotools, as this problem should appear with a make distcheck...
Thank you for pointing this out!
Comment 3 Patrick Welche 2009-03-02 14:13:56 UTC
Fixed. (Unsure why make distcheck doesn't pick this up...)