GNOME Bugzilla – Bug 569957
dasher fails to build outside source tree
Last modified: 2009-03-02 14:13:56 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.
Created attachment 127615 [details] [review] Fix #include's for config.h This patch allows non-source-tree build of dasher in my machine.
- 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!
Fixed. (Unsure why make distcheck doesn't pick this up...)