2013/8/9 Junio C Hamano <gitster@xxxxxxxxx>: > Elia Pinto <gitter.spiros@xxxxxxxxx> writes: > >> Git use, as many project that use autoconf, private m4 macros. >> >> When not using automake, and just relying on autoconf, the macro >> files are not picked up by default. >> >> A possibility, as git do today, is to put the private m4 macro >> in the configure.ac file, so they will copied over the final configure >> when calling autoreconf(that call also autocon). But this makes configure.ac difficult >> to read and maintain, especially if you want to introduce new macros later. >> >> Starting from version 2.58, autoconf provide the macro AC_CONFIG_MACRO_DIR >> to declare where additional macro files are to be put and found. >> The argument passed to this macro is commonly m4. >> >> This macro, for the longest time, has been used only by libtool >> starting from version 2.0, to identify where to copy its own macro files >> when using libtoolize --copy. >> >> Starting from version 1.13, automake augments autoconf with a macro >> called AC_CONFIG_MACRO_DIRS, that provides a space-separated list >> of directories to use for looking up m4 files. >> The same macro will be available as part of autoconf 2.70, >> actually in development. Anyway also this version permit >> to use AC_CONFIG_MACRO_DIR and not need automake. >> >> Signed-off-by: Elia Pinto <gitter.spiros@xxxxxxxxx> > > That explains why you created a separate directory to for the new > file and why you needed to use AC_CONFIG_MACRO_DIR while doing so. > > But in the above explanation, I fail to see the reason why we would > want to create that new file out of the existing file, only to > include it in the original file. Thanks. For those who use the gnu build tool is good practice to separate the private macros, very equilalent to an external library of C, from the main configure.ac file. Readability, maintainability are in general the reason in the same measure that everyone use external libraries or external includes in C to simplify the writing of a program. Just for a simple example, if I want to introduce new test macros for understeand in a portable way what are the C flags that a compiler understand - for QA, memory checker ecc - is much more readable and easy to update a separate file that to update the main configure.ac file that is not intended to contain the declaration of m4 macro and can grow larger. In fact from my experience it is difficult to find many program that not use a separate macro dir and use the gnu build tool. Sorry if I was not clear, perhaps it is due to the fact that i have the habit of using the gnu build tool always and i think that something is obvious but often it is not so obvious to everyone. Thanks and best regards > > Why is it needed? Why is it a good idea? > -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html