Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Autotools and version control

I know, it must be a silly question. Assume I have a library using an autotools build system. I have all that configure, configure.ac, Makefile.am, config.h and may other files in my project root folder. Some of them wre written by a developer, others are generated by autotools.

The question is: if I use a version control system (in my case - hg) - which of all that autotools files should be tracked by a VCS and which shouldn't (hgignore'd)?

Thanks, Serge

like image 655
zserge Avatar asked Feb 02 '11 10:02

zserge


2 Answers

I think the best procedure is to only put files under version control that are not generated - people working with the VCS are developers and should have the autotools installed on their machines, checking in generated files will only cause trouble for them.

On the other hand you have to make sure that source-level distribution is done with all generated files in place, so that non-developers are able to build the software without the autotools installed.

like image 199
Tom Regner Avatar answered Nov 10 '22 19:11

Tom Regner


There are two schools of thought on this:

  1. "I want to see the project exactly as it was at time/version X"
  2. "I can always re-generate anything which was automatically generated later"

I generally fall into the latter group personally, but the former can be nice if there are/were problems with the build system in some specific version that you probably don't have installed any more.

In your example configure and config.h are both (probably) autogenerated, so if you're going to include them in version control I'd be inclined to include the Makefile.ins too.

In my projects this usually means having no more autotools related files than configure.ac, Makefile.am, the documentation if it's GNU and a directory called m4 which includes any custom/non-standard macros my configure.ac requires.

like image 5
Flexo Avatar answered Nov 10 '22 19:11

Flexo