I'm interested in reducing the number of checks done in a configure script: one way could be to make more use of conditional dependencies between modules. gnulib-tool --add-import lists the modules which were used and which were brought in as dependencies. However, there are some things I'd like to do that I couldn't find options for. One is to see which modules brought in a module. The way I was doing this was by going into the "gnulib/modules" directory in the Gnulib checkout and grepping for the name of the module. It would be nice to be able to get this information automatically, and in a way that takes into account indirect dependencies. Maybe there should be an option for gnulib-tool that can list the modules that have been brought in, and for each of them, list the modules that have been explicitly asked for that depend on the module, directly or indirectly, and also list the modules that depend on the module conditionally.
For example I wondered why the checks for the unistd module were being run. I found that getopt-posix had a dependency on it. I edited the module file to make this a conditional dependency, reran gnulib-tool --add-import, ran "make configure" to remake the configure script: but when I ran "configure" again, the tests were still run. I expected that there was another module also depending on unistd, but it wasn't immediately obvious which one, because several modules that could have been imported depended on unistd. That's as far as I got investigating the matter. Is there an easier way to investigate this kind of thing, that I've been missing? Or would gnulib-tool benefit from the extra functionality I've suggested?