News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

Autotools and project dependencies

Started by thomas.moulard, June 26, 2007, 12:53:17 AM

Previous topic - Next topic

thomas.moulard

Hi!
I'm trying to generate a CodeBlocks workspace+projects from Autotools scripts.

It works fine for the "basic" cases, but if one have a more complex project, some Autotools "features" are quite difficult to translate:

1/ Autotools convenience libraries:

To simulate the convenience libraries (ie: non distributed static libraries used during the compilation process, for example to compile differents modules), I'm using the project's dependencies system of C::B.

For example, I've the following project:
myproject depends on libmyproject
libmyproject depends on core, graphic, audio

Each module is a project in C::B with dependencies.

Each subproject creates a static library.
The main project is linked against the static libraries which are produced by the sub-projects.

The problem is the following: when I modify a source file from a subproject, the static libraries are rebuilt but the main program is not relinked (ie: the binary is not updated).

I have to rebuilt the entire project to regenerate the binary which is very slow.

Is there a workaround to fix this problem?


2/ LIBADD

Autotools offers the possibility to merge several libraries with LIBADD.
With the previous example, it allows me to generate a libmyproject.a which contains the sublibraries.

This is a major issue because it solves a lot of problems due to mutual dependencies of the static libraries.

Is there a way to do it with CodeBlocks?


3/ Will be any effort to use Autotools instead of a simple Makefile in C::B?

It would be /IMHO/ a better solution to reuse the Autotools (libtool...) instead of developing yet-another-build-system. In my mind, a compilation chain and an IDE are two independant subjects.

Thank you!

dje

Hi !

QuoteI have to rebuilt the entire project to regenerate the binary which is very slow.

Isn't sufficient to type a space in the shortest cpp file to force the compilation of this single file and force the link instead of rebuilding the whole project ?
I have no answer for other questions.

Dje

mandrav

1) You have to add the library as an external dependency to the targets you want to be relinked when the library is changed ("Project->Properties->Build targets->[select target]->External dependencies" is the GUI dialog I mean).

2) Although I haven't tried this you could create a project (or a target, whatever) and add the sub-libraries to the project (so that they appear on the tree). Then for each library turn of the "compile" flag and turn on the "link" flag (right-click on a lib in the tree and click Properties).

Of course, it's possible to do the above stuff programmatically. The GUI dialogs were only mentioned as a visual aid for what I meant.
Be patient!
This bug will be fixed soon...