Bruno Haible wrote: > Replying to Jim I wrote: >> > "_rpl_open", referenced from: >> > _grepfile in grep.o >> The situation in the 'grep' package is as follows: >> - The main part, in lib/, has the module 'fcntl' and therefore >> implicitly 'fcntl-h', but not the 'open' module. >> - The tests part, in gnulib-tests/, has the module 'open', as a >> dependency from 'dup2-tests'. >> - The presence of the 'open' module is indicated through an >> AC_SUBSTed variable GNULIB_OPEN. There is only one GNULIB_OPEN >> for the entire package, and it is set to 1. >> - Therefore the lib/fcntl.h replacement defines "#define open rpl_open". >> >> I wouldn't say that it's a bug in gnulib. >> It's a limitation of gnulib that you cannot decide to not use a module in >> the main part but use it in the tests. If you really wanted that, you >> would need a setup with two different configure.ac files, one for the >> main part and one for the tests. > > But the user may be using open() in the main part, in lib/, without wanting > to use gnulib's 'open' module. We document for each module the list of > problems that it fixes. It's not because that dup2-tests requires an open() > function with a special workaround that the main part, in lib/, would need > it as well. > > So I think it's a bug in gnulib. ...
Nice work. I'm glad you took the time to solve this properly.