How to select the autoconf build directory?
Asked Answered
P

1

11

Is there a way to set where autoconf generates the object files. I would like to have autoconf create all object files in a src/build/ instead of src/

I've tried setting VPATH but that doesn't seem to do anything. VPATH = build

Proudhon answered 22/8, 2011 at 22:35 Comment(1)
autoconf does not generate object files. Your question is probably about automake, and autoconf is often used without automake.Kali
B
16

You do this by running configure from the directory where you want the object files. For instance, if configure and all your code is in a directory named src, then starting from that directory, these commands should do what you want:

$ mkdir build
$ cd build
$ ../configure
$ make

If you're not using Automake, you have to write your Makefile.in to handle this case; there are instructions for that in the autoconf manual.

Burge answered 22/8, 2011 at 23:11 Comment(6)
I am using automake, but it fails on make. *** No rule to make target IfxDatabase.lo', needed by libifxapi.la'. Stop. Any suggestions?Proudhon
My bad, this does work just fine. I had VPATH set in my Makefile.am in the src dir when I was messing around earlier to get it to work.Proudhon
Keep in mind that you need to construct your Makefile.am correctly. It is very easy to write a Makefile.am for which a vpath build (a build outside the source directory) does not work. 'make distcheck' will catch such errors.Kali
What about placing the generated configure and other files in a separate directory, is that possible?Kissner
@CiroSantilli新疆改造中心六四事件法轮功 The generated configure needs to be at the top level of the source tree or it won't work correctly and also people won't be able to find it. AC_CONFIG_AUX_DIR can be used to move most of the other files. But you should really ask a new question and explain in more detail what you want.Burge
Thanks. Just want a full out of tree build, nothing generated in-tree. Lazy for new question now, will ping you if I do :-)Kissner

© 2022 - 2024 — McMap. All rights reserved.