Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to select the autoconf build directory?

Tags:

c++

autoconf

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

like image 841
Adam Magaluk Avatar asked Aug 22 '11 22:08

Adam Magaluk


People also ask

What is a build directory?

A build directory contains most of the information needed to diagnose build issues. There are different ways to collect it.

How do I setup a script autoconf?

To create a configure script with Autoconf, you need to write an Autoconf input file configure.ac (or configure.in ) and run autoconf on it. If you write your own feature tests to supplement those that come with Autoconf, you might also write files called aclocal. m4 and acsite. m4 .

What to do with configure ac file?

The configure.ac file is used to create the ./configure script. It consists of a series of macros which are processed and expanded by autoconf . These macros can check for packages and libraries, handle --enable and --with switches, and generate various files.

What is Autogen sh?

The autogen.sh script generates the configure script (from configure.ac , using autoconf) and any files it needs (like creating Makefile.in from Makefile.am using automake).


1 Answers

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.

like image 169
zwol Avatar answered Sep 28 '22 07:09

zwol