Bug 309783 - Valgrind does not support separate source and build directories
Summary: Valgrind does not support separate source and build directories
Status: RESOLVED DUPLICATE of bug 445211
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (show other bugs)
Version: 3.9.0.SVN
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-09 00:20 UTC by Patrick J. LoPresti
Modified: 2022-12-23 16:04 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Fix configure + make in build directory distinct from source (1.80 KB, patch)
2012-11-09 00:22 UTC, Patrick J. LoPresti
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick J. LoPresti 2012-11-09 00:20:37 UTC
Most packages using "autoconf" allow separate source and build directories.  Like so:

  mkdir valgrind-build
  cd valgrind-build
  /path/to/valgrind-3.8.1/configure --prefix=...
  make && make install

This is useful for many reasons, like building one source tree in different ways (e.g. different platforms).

I am attaching a patch that fixes this for the basic "make + make install".  (Of course you still have to run "autogen.sh" from the source tree if you are building from SVN.)

Reproducible: Always

Steps to Reproduce:
1. cd /path/to/build/dir
2. /path/to/valgrind/source/configure
3. make
Actual Results:  
Build failure because some files are not found.

Expected Results:  
Successful build.

Simple patch attached.
Comment 1 Patrick J. LoPresti 2012-11-09 00:22:52 UTC
Created attachment 75116 [details]
Fix configure + make in build directory distinct from source

Simple patch to allow configure + make + make install to work from a separate build directory.  I am also working on a follow-up patch for "make check" and "make regtest", but this seems a natural way to break it up.
Comment 2 Tom Hughes 2012-11-09 00:29:33 UTC
Well "does not support" is a bit strong.

It is meant to, it's just that it often breaks because it's a feature that none of the core developers uses so we usually only find out we've broken it after we release it...
Comment 3 Patrick J. LoPresti 2012-11-09 00:49:14 UTC
I apologize if I titled the bug poorly.  I only meant to report an issue and provide a patch, not to insult anybody.

Fixing this for "make regtest" appears harder, since the Perl and shell scripts seem not to distinguish the source and build trees.  I am willing to do the work, but only if the maintainers agree this is worth having.  Do they?
Comment 4 Florian Krohm 2012-11-24 21:37:14 UTC
(In reply to comment #3)
> 
> Fixing this for "make regtest" appears harder, since the Perl and shell
> scripts seem not to distinguish the source and build trees.  I am willing to
> do the work, but only if the maintainers agree this is worth having.  Do
> they?

I think it's worth doing as being able to build out of tree is a reasonable expectation for many people.
Will your patch also work for a cross-build?  I'm not a autotool-wiz so am not able to say off-hand.
Comment 5 Paul Floyd 2022-12-23 16:04:47 UTC
This was fixed a while back.

*** This bug has been marked as a duplicate of bug 445211 ***