|
From: Gilles C. <gil...@xe...> - 2014-04-19 15:54:07
|
Le 19/04/2014 17:40, Philippe Waroquiers a écrit : > On Sat, 2014-04-19 at 17:27 +0200, Gilles Chanteperdrix wrote: >> Hi, >> >> a minor modification is needed to allow building valgrind out of its >> source tree: >> >> --- orig.valgrind-3.9.0/Makefile.am 2013-10-23 12:50:02.000000000 +0200 >> +++ valgrind-3.9.0/Makefile.am 2014-03-15 00:35:27.044018414 +0100 >> @@ -64,7 +64,7 @@ CLEANFILES = default.supp >> default.supp: $(DEFAULT_SUPP_FILES) >> echo "# This is a generated file, composed of the following suppression rules:" > default.supp >> echo "# " $(DEFAULT_SUPP_FILES) >> default.supp >> - cat $(DEFAULT_SUPP_FILES) >> default.supp >> + cat $^ >> default.supp >> >> ## Preprend @PERL@ because tests/vg_regtest isn't executable >> ## Ensure make exits with error if PERL fails or post_regtest_checks fails. >> >> Regards. > 3.9.0 is available since 31 October 2013, and up to now, it seems > it could be build by most (or all?) people. > > Can you give more information about: > what do you mean exactly by "building valgrind out of its source tree" ? > why do you want to build it out of its source tree, if building it is > working ? > which OS ? > which distribution ? > what build error/error msg/... you have without the above change ? Building a project "out-of-tree" is a common feature for projects using the autotools, see for instance: http://www.gnu.org/software/automake/manual/html_node/VPATH-Builds.html In a nut shell, by running the configure script from a build directory different from the sources directory, the program gets built in this build directory instead of inside the source tree. The reason I use this is that it allows me to build valgrind for different platforms from the same source tree, without duplicating or symlinking the source tree. The out-of-tree builds relies on make's VPATH variable. Makefiles are run from a build tree, which does not contain the sources, but make looks for the dependencies in the directory mentioned in the VPATH variable, and passes the complete path to make rules when the dependency is found in the VPATH tree. So, for instance, if a foo.supp exists in /tmp/bar and /tmp/qux/Makefile contains: DEFAULT_SUPP_FILES=foo.supp VPATH = /tmp/bar default.supp: $(DEFAULT_SUPP_FILES) echo $< Running "make default.supp" in /tmp/qux will print /tmp/bar/foo.supp instead of just foo.supp, IOW, the rule gets passed the full path of the dependency. Without this change, cat $(DEFAULT_SUPP_FILES) fails because the files are not found in the build tree. I understand if you do not want to support that feature, but since the modification to get it working is a one-liner, I assumed that it was an already supported feature, and that the fact that it did not work in 3.9.0 was an oversight. Regards. -- Gilles. |