Hi David, * David Byron wrote on Mon, May 08, 2006 at 11:49:50PM CEST: > Not sure if this is more automake or autoconf related.
Probably both. > I'm fairly early in the process of creating one top level > Makefile.am/configure.ac to get non-recursive Makefiles. I've got a few > directories already building with autoconf/automake. I'm using > AC_CONFIG_SUBDIRS at the moment so configure still runs for each > subdirectory. Wait.. you have a configure.ac for each directory? That is really rare. Usual setup is to have one configure.ac per software package, and a bunch of Makefile.am. More than one configure.ac is only necessary or useful to - bundle rather independent packages (also to remain rather independent) - work around some limitations that stem from having one only (e.g., essentially only one compiler, or compiler ABI flags setting, per tests). the configure.ac together with their AC_CONFIG_SUBDIRS() links form an acyclic directed graph (tree); each Makefile.am that stands on its own (i.e., is not included by another Makefile.am), should be listed (with name Makefile) in AC_CONFIG_FILES of exactly one configure.ac, otherwise havoc will ensue. > They all use m4 macros that they get access to with: > > ACLOCAL_AMFLAGS = -I <macro directory path> > > I added the same to my top level Makefile.am, although the path is > different... > > This happens to work, but I get warnings from autoreconf: > > util/libutils/src/Makefile.am:6: ACLOCAL_AMFLAGS multiply defined in > condition TRUE ... > Makefile.am:14: `util/libutils/src/Makefile.am' included from here > Makefile.am:7: ... `ACLOCAL_AMFLAGS' previously defined here > > If I remove the "second" assignment to ACLOCAL_AMFLAGS from the > sub-Makefile.am, the warning goes away, but configure fails in the > subdirectory since macros it needs aren't available. If you're going to merge the Makefile.am's, or include one into the other, be sure to do the configure.ac merge first. Also note that ACLOCAL_AMFLAGS needs to be a literal (i.e., no $(macros) or @substitutions@ in it) as it will be "parsed" by autoreconf; here, parsing is meant in the form of a grep, or similarly dumb. > I guess aclocal only copies macros that it needs to, but I use many more > macros in the subdirectories that aren't getting into aclocal.m4. Hmm. Do you use the same aclocal.m4 file for several configure.ac scripts? That would be new to me, too. Common is to have them one-to-one. > Do I need to switch things to only run configure once at the top? My > reflex is to avoid that at least for now. Anyone have any suggestions > for getting this to work without warnings? Maybe you can show more of your setup, so we can understand package specific constraints. Cheers, Ralf