On 04/26/2011 06:54 PM, Bruno Haible wrote: > Hi Eric, > > Now the code is clear enough that it can be understood :-) I have three > remarks:
The first two were trivial fixes. >> AC_DEFUN([gl_PREREQ_GETCWD], >> [ >> AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) >> AC_REQUIRE([gl_CHECK_TYPE_STRUCT_DIRENT_D_INO]) >> + AC_DEFINE([USE_GPL_GETCWD], [1], >> + [Define to 1 if GPL code should be used to attempt to work around >> + native getcwd failures.]) > > This will cause a link error if a package uses > "gnulib-tool --import --with-tests ... getcwd-lgpl ..." > and the module 'getcwd' occurs among the dependencies of the tests. Then > USE_GPL_GETCWD will be defined to 1, therefore lib/getcwd-lgpl.o will be > empty, > therefore lib/libgnu.a will have a missing link dependency. (Recall that > lib/getcwd.o is linked into the tests only, not into lib/libgnu.a, in this > case.) I couldn't reproduce it with 'gl_cv_func_getcwd_null=no ./gnulib-tool --with-tests --test getcwd-lgpl fchdir', which seems like it matches the setup you described (fchdir-tests pulls in getcwd). But my failure to reproduce may be because at this point in the series, fchdir still pulls in enough indirect dependencies to get getcwd into the main library and not just the test library. At any rate, your claim makes sense, so... > > The easiest fix is to use > gl_MODULE_INDICATOR([getcwd]) > and then in the C code you use > #if GNULIB_GETCWD That's what I ended up using. I've now pushed the amended commit; thanks for the careful review. -- Eric Blake ebl...@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature