Re: [PATCH] configure.ac: move the private git m4 macro to a dedicated directory
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:58:22
Elia Pinto [off-list ref] 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 <redacted>
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. Why is it needed? Why is it a good idea?