On Sun, Oct 16, 2016 at 5:13 AM, Bruno Haible <br...@clisp.org> wrote: > Hi Jim, all, > > When I try to use the gnulib-tool --create-testdir option to produce a testdir > for all modules, it encounters errors and produces no toplevel Makefile.in: > > $ ./gnulib-tool --create-testdir --with-tests --dir=/tmp/testdir1 > gnulib-tool: warning: module euidaccess depends on a module with an > incompatible license: group-member > gnulib-tool: warning: module strtod-obsolete depends on a module with an > incompatible license: strtod > ... > executing aclocal -I glm4 > executing autoconf > executing autoheader > executing automake --add-missing --copy > configure.ac:3601: error: required directory ./lib does not exist > configure.ac:23: installing 'build-aux/ar-lib' > configure.ac:4: installing 'build-aux/install-sh' > configure.ac:4: installing 'build-aux/missing' > Makefile.am:5: warning: AM_GNU_GETTEXT used but 'po' not in SUBDIRS > gllib/Makefile.am:47: error: required file 'lib/alloca.c' not found > gllib/Makefile.am: installing 'build-aux/depcomp' > configure.ac: installing 'build-aux/ylwrap' > > I've tracked it down to the module 'non-recursive-gnulib-prefix-hack': > > $ ./gnulib-tool --create-testdir --with-tests --dir=/tmp/testdir3 nocrash > non-recursive-gnulib-prefix-hack > ... > executing aclocal -I glm4 > executing autoconf > executing autoheader > executing automake --add-missing --copy > configure.ac:109: error: required directory ./lib does not exist > ... > > $ ./gnulib-tool --create-testdir --with-tests --dir=/tmp/testdir3 alloca > non-recursive-gnulib-prefix-hack > ... > executing aclocal -I glm4 > executing autoconf > executing autoheader > executing automake --add-missing --copy > configure.ac:110: error: required directory ./lib does not exist > configure.ac:22: installing 'build-aux/ar-lib' > configure.ac:8: installing 'build-aux/compile' > configure.ac:4: installing 'build-aux/install-sh' > configure.ac:4: installing 'build-aux/missing' > automake: error: '$(ALLOCA)' cannot be used outside 'lib' if 'subdir-objects' > is not set > gllib/Makefile.am:46: error: required file 'lib/alloca.c' not found > gllib/Makefile.am: installing 'build-aux/depcomp' > > Here are the problems that I see: > > 1) Both modules/non-recursive-gnulib-prefix-hack and > m4/non-recursive-gnulib-prefix-hack.m4 hardcode the subdirectory name > 'lib'. > (Why does m4/non-recursive-gnulib-prefix-hack.m4 use 'lib' in one place > and $1 > in another place??)
That's a bug, but inconsequential. Thank you. I've just pushed a fix for it. > 2) This is a different way of using Automake; it should not be used in > gnulib-tool's > testdirs. Thanks for working around it. > 3) Why has this feature been implemented as a module that hacks around in > undocumented Autoconf internals (ac_subst_vars is undocumented, no?, and > gl_LIBOBJS is undocumented as well), rather than as a command-line option > to gnulib-tool? It is all a big hack, as the name suggests. Bison found a way to use automake that way, and since it was nontrivial to get right and I wanted to do the same for coreutils, I encapsulated the ugliness in this macro. > 4) This module was added in September 2012. Does this mean that no one has > used > gnulib-tool --create-testdir option to produce a testdir for all modules, > in four years?! Probably true. Recently I tried to do something similar, but got side-tracked. I'm glad you're fixing all of this. > For problem 2), I propose the remedy below. > > Bruno > > > 2016-10-16 Bruno Haible <br...@clisp.org> > > gnulib-tool: Make --create-testdir on all modules work again. > * gnulib-tool (func_create_testdir): Don't include the > non-recursive-gnulib-prefix-hack module. > > diff --git a/gnulib-tool b/gnulib-tool > index 12ee19f..666057a 100755 > --- a/gnulib-tool > +++ b/gnulib-tool > @@ -5811,10 +5811,12 @@ func_create_testdir () > if test -z "$modules"; then > # All modules together. > # Except config-h, which breaks all modules which use HAVE_CONFIG_H. > + # Except non-recursive-gnulib-prefix-hack, which represents a nonstandard > + # way of using Automake. > # Except ftruncate, mountlist, which abort the configuration on mingw. > FIXME. > # Except lib-ignore, which leads to link errors when Sun C++ is used. > FIXME. > modules=`func_all_modules` > - modules=`for m in $modules; do case $m in config-h | ftruncate | > mountlist | lib-ignore) ;; *) echo $m;; esac; done` > + modules=`for m in $modules; do case $m in config-h | > non-recursive-gnulib-prefix-hack | ftruncate | mountlist | lib-ignore) ;; *) > echo $m;; esac; done` > fi > specified_modules="$modules" That looks fine. Thanks again.