> From: "Mark D. Roth" <[EMAIL PROTECTED]> > Date: Sat, 18 May 2002 09:11:55 -0500 > > The main reason for giving it a different name is that we want to > avoid conflicts between autoconf and aclocal. If autoconf reads the > files in the subdirectory by default, and aclocal also reads them to > generate aclocal.m4, then the macros get defined twice.
Yes, but the cure of having two subdirectories is worse than the disease. It will complicate the explanations to users, and will complicate source directory structures, and will lead to lots of confusion. I think it would be better to stick to m4 as the subdirectory, and to come up with a transition strategy. Basically, the problem here is that an auxiliary tool (aclocal) is being used to do a function that you think should be done by autoconf itself, and you need to come up with an upgrade path that won't break anything while people are upgrading to new Autoconf and Automake releases. Here is one way to do this; perhaps you can think of improvements. The end result of this upgrade path will be a situation where aclocal no longer copies m4/*.m4 into aclocal.m4. The first step of the upgrade path is to modify Autoconf to support AC_INCLUDE. The second step is to modify aclocal to put AC_INCLUDE(foo.m4) into aclocal.m4 instead of bodily copying m4/foo.m4. People like you who don't want to use aclocal can put AC_INCLUDE(foo.m4) into their configure.ac file or aclocal.m4 by hand, and use the new version of Autoconf. People who use Automake and do not modify their source files will not be affected by either step (1) or step (2), except that their aclocal.m4 files will get smaller and easier-to-read after step (2). > It seems that the old AC_INCLUDE macro just did the same thing as > m4_include, which isn't really the same thing as what > AC_SITE_INCLUDE will do. Sorry, I'm a bit lost. What are the differences between m4_include, AC_SITE_INCLUDE, and the old AC_INCLUDE? Is it merely that AC_SITE_INCLUDE looks only in the site directory, and not in the m4/* subdirectory? > * In addition to aclocal.m4, autoconf will also read all m4 files in > the `ac-package' subdirectory. This sounds too aggressive to me. It's a bit like saying that you'll have a C include directory, and the C compiler will automatically include every .h file under that directory. Under the counterproposal mentioned above, autoconf would read the m4 file only if explicitly requested with an AC_INCLUDE. An advantage of this method is that sometimes (unfortunately) there are dependencies among .m4 files (one must be included before another), and the user can handle this by including the .m4 files in the proper order. It might also help to have an AC_SITE_INCLUDE versus an AC_INCLUDE (similar to the distinction between `#include <foo.h>' and `#include "foo.h"' in C), but I don't yet see this. In practice, the <foo.h>/"foo.h" distinction is fairly confusing in C, and I'm not sure that I'd like to see this confusion replicated in Autoconf.