[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCHv2 2/9] getcwd-lgpl: new module
From: |
Eric Blake |
Subject: |
Re: [PATCHv2 2/9] getcwd-lgpl: new module |
Date: |
Wed, 27 Apr 2011 11:36:50 -0600 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.15) Gecko/20110307 Fedora/3.1.9-0.39.b3pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.9 |
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 address@hidden +1-801-349-2682
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [PATCHv2 1/9] getcwd: tweak comments, (continued)
[PATCHv2 2/9] getcwd-lgpl: new module, Eric Blake, 2011/04/26
[PATCHv2 5/9] dirent-safer: drop unused link dependency, Eric Blake, 2011/04/26
[PATCHv2 6/9] tests: reduce dependencies, Eric Blake, 2011/04/26
[PATCHv2 3/9] getcwd: enhance tests, Eric Blake, 2011/04/26
[PATCHv2 7/9] linkat, renameat: add missing dependency, Eric Blake, 2011/04/26
[PATCHv2 8/9] filenamecat-lgpl: fix licence, Eric Blake, 2011/04/26