>> I've invoked gnulib-tool as follows: >> >> gnulib-tool --import \ >> --m4-base=gnulib/m4 \ >> --source-base=gnulib/src \ >> --aux-dir=gnulib getopt-gnu >> >> and the recommendations emitted say this: >> >> Don't forget to >> - add "lib/Makefile" to AC_CONFIG_FILES in ./configure.ac, >> - mention "lib" in SUBDIRS in Makefile.am, >> - mention "-I m4" in ACLOCAL_AMFLAGS in Makefile.am, >> - mention "m4/gnulib-cache.m4" in EXTRA_DIST in Makefile.am, >> - invoke gl_EARLY in ./configure.ac, right after AC_PROG_CC, >> - invoke gl_INIT in ./configure.ac. >> >> However, this should rather be >> >> Don't forget to >> - add "gnulib/src/Makefile" to AC_CONFIG_FILES in ./configure.ac, >> - mention "gnulib/src" in SUBDIRS in Makefile.am, >> - mention "-I gnulib/m4" in ACLOCAL_AMFLAGS in Makefile.am, >> - mention "gnulib/m4/gnulib-cache.m4" in EXTRA_DIST in Makefile.am, >> - invoke gl_EARLY in ./configure.ac, right after AC_PROG_CC, >> - invoke gl_INIT in ./configure.ac. > > Indeed, this is surprising. Maybe you had a gnulib-cache.m4 file in > the package's directory, that specified different settings?
Apparently yes. I've just retried the above command with a clean git clone (not containing any stuff related to gnulib), and now I get this: Don't forget to - add "gnulib/src/Makefile" to AC_CONFIG_FILES in ./configure.ac, - mention "src" in SUBDIRS in gnulib/Makefile.am, - mention "-I gnulib/m4" in ACLOCAL_AMFLAGS in Makefile.am, - mention "gnulib/m4/gnulib-cache.m4" in EXTRA_DIST in Makefile.am, - invoke gl_EARLY in ./configure.ac, right after AC_PROG_CC, - invoke gl_INIT in ./configure.ac. So it's just a single error (in the SUBDIRS line). >> Actually, I suggest two additions so that we have >> >> - add "gnulib/m4" to AC_CONFIG_MACRO_DIR in ./configure.ac > > There is no need to recommend this, because > - gnulib's parameters are cached in gnulib-cache.m4, a different > file than configure.ac, > - it does neither help nor hurt if the macro directories into > which 'aclocal' and 'libtoolize' add their macros is the same or > a different directory than the one you specified for gnulib. Hmm. For me, `autoreconf --force --install' fails later on if I don't add `gnulib/m4' to AC_CONFIG_MACRO_DIR... >> - mention "-I gnulib/m4" in ACLOCAL_AMFLAGS in Makefile.am >> (use a single line for all include directives), > > Why "use a single line"? Continuing the line with backslash-newline > does not work? No. From autoconf's info file: If you want `autoreconf' to pass flags that are not listed here on to `aclocal', set `ACLOCAL_AMFLAGS' in your `Makefile.am'. Due to a limitation in the Autoconf implementation these flags currently must be set on a single line in `Makefile.am', without any backslash-newlines. Werner