Coda
Coda

Reputation: 1

How to manage building a huge source code that uses gnu autotools?

I have multiple source codes which I have to cross-build and use together as one huge project. The building process of each source code is the same './configure-make-make install' commands with added parameters for cross compilation. So far I have been managing this by typing a really long configure command "./configure CC=....." in text editor and then copy pasting that on to terminal and running it. Then repeating the process for another source code. Taking care of multiple include paths, library paths, pkg-config paths etc. the process turns out to be very messy, error-prone and cumbersome. I have already used eclipse ide and have found no option for configuring the "./configure .." command to my need. Is there any elegant way to handle this problem? I would like a solution which will require me to write minimal amount of script/instruction.

Upvotes: 0

Views: 72

Answers (1)

Vicente Bolea
Vicente Bolea

Reputation: 1573

Is there any elegant way to handle this problem?

If you want to automatize the configuration and compilation of several sub-projects which are actually one project, I suggest you to use the GNU/Autotools canonical way to deal with it with is Nested Autotools project

In that way you can do a project which contains all the other projects in the following fashion:

./UmbrellaProject
   subproject1/
   subproject2/
   ...
   Makefile.am

Inside the parent project Makefile.am you will have a line at the beginning such as:

 SUBDIRS = subproject1 subproject2

More information at the GNU Automake docs

Upvotes: 2

Related Questions