basmith / sparsehash

Automatically exported from code.google.com/p/sparsehash
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

sparsehash does not build in an alternate directory #14

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
sparsehash will not build in any directory other than the original source
directory.  autoconf/automake allows this, but the sparsehash
implementation breaks that support.

To reproduce:
1. Unpack the sparsehash source into its default directory "sparsehash-0.8".
2. Create a directory parallel to "sparsehash-0.8", for instance "build".
3. cd to the directory created in step 2.
4. Configure sparsehash from here as so: "../sparsehash-0.8/configure". 
The Makefile and src/config.h will be created as usual, in the local directory.
5. Attempt to make.  Make will fail with a message similar to "No rule to
make target `../sparsehash-0.8/src/config.h', needed by
`src/google/sparsehash/sparseconfig.h'."

To fix:
1. On lines 66 and 69 of Makefile.am, change "$(top_srcdir)/src/config.h"
to "src/config.h".  (Alternately, "$(top_builddir)/src/config.h".)
2. Add a new line 71 in the same file, just before the "mv" command: "mkdir
-p src/google/sparsehash".
3. Recreate the project files with aclocal -I m4, automake, and autoconf.
4. sparsehash can now be configured and built in a separate directory.

This capability is important for projects that build multiple target
architectures on a single host.  In this case, it is inefficient to build
libraries into their source directories, since the source will have to be
cleaned and rebuilt for each architecture on every build.

Original issue reported on code.google.com by roger.a....@gmail.com on 9 Oct 2007 at 8:34

GoogleCodeExporter commented 9 years ago
I'm sorry about that -- I indeed got srcdir and builddir confused (no surprise, 
since
I find it all rather confusing).  This will be fixed for the next release.

Original comment by csilv...@gmail.com on 9 Oct 2007 at 8:57

GoogleCodeExporter commented 9 years ago
No problem - autoconf/automake is definitely a lot to take in.

Original comment by roger.a....@gmail.com on 9 Oct 2007 at 9:22

GoogleCodeExporter commented 9 years ago
Sparsehash 0.9 was just released, which should fix this problem.

Original comment by csilv...@gmail.com on 9 Oct 2007 at 10:39

GoogleCodeExporter commented 9 years ago
Confirmed fixed.  Works great now, thanks!

Original comment by roger.a....@gmail.com on 10 Oct 2007 at 1:57