views:

74

answers:

1

I've got a C++ project which uses automake and autoconf. I'm new to both of these.

My home directory is network mounted -- the same on every server we have -- and I want to compile and run the project (and its executable) concurrently on separate machines.

Our servers are frequently different architectures. My desktop is 32-bit, but the server is 64-bit, etc.

What options do I use in configure.ac and Makefile.am to compile the object files in separate directories named for the machine architectures? It's relatively simple to do this in a regular Makefile, but I don't know how to set autotools.

+6  A: 

If you don't do anything "wrong" or unusual in your configure.ac and Makefile.am setup, this is supported automatically:

mkdir /some/where/build
cd /some/where/build
/else/where/source/configure --options...
make
make install

Basically, you create the build directory anywhere you want (in your case probably on a non-network mount), and call configure from there. This will then build the code in the build directory you have created.

Peter Eisentraut
For more info about this, see the "VPATH Builds" section of the Automake manual. http://sources.redhat.com/automake/automake.html#VPATH-Builds
adl
I have a `src` directory which contains my `.cpp` and `.h` files. When I run `./configure` in the parent directory, the binary ends up in the `src` dir. Perhaps this is the sort of "wrong" configuration to which you allude?
mohawkjohn
No, you need to create a completely separate directory for your build and then run configure from there.
Peter Eisentraut