bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gnulib] feature request: argp()


From: Simon Josefsson
Subject: Re: [Bug-gnulib] feature request: argp()
Date: Wed, 11 Jun 2003 20:14:48 +0200
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux)

Bruno Haible <address@hidden> writes:

> Simon Josefsson wrote:
>
>> > getopt has the same problem and uses the ELIDE_CODE macro which even
>> > supports major, incompatible changes to the API. Given the API change
>> > policy of glibc I'd suggest to use the same technique here.
>>
>> OK, then we are back at the following, which will compile the files
>> unconditionally.  If you think this is the right thing, I'll send a
>> ELIDE_CODE patch for lib/argp*.c later.
>
> I think it's the right thing if and only if the libc maintainers
> (libc-alpha at sources dot redhat dot com) want to provide a
> _GNU_ARGP_INTERFACE_VERSION macro in <gnu-versions.h>. If they say
> it's not needed, then let's assume for the moment that the argp
> API will not change, and then we compile the argp*.c file conditionally.

I've asked them.

>> AC_LIBOBJ does not seem to support adding *.h.
>
> Yes, the .h files can be added to lib_SOURCES or to EXTRA_DIST; it
> doesn't matter which one. I think it should work like this:
>
>      AC_LIBOBJ(argp-ba)
>      AC_LIBOBJ(argp-eexst)
>      AC_LIBOBJ(argp-fmtstream)
>      AC_LIBOBJ(argp-fs-xinl)
>      AC_LIBOBJ(argp-help)
>      AC_LIBOBJ(argp-parse)
>      AC_LIBOBJ(argp-pv)
>      AC_LIBOBJ(argp-pvh)
>      AC_LIBOBJ(argp-xinl)
>
> lib_SOURCES += argp.h argp-fmtstream.h argp-namefrob.h

I tried it and it works; but like you said if
_GNU_ARGP_INTERFACE_VERSION is added, it won't be needed.

>> Few lib/Makefile add -I- though
>
> I don't think -I- is portable. That's why we copy
>     alloca_.h to alloca.h
>     sysexit_.h to sysexits.h
> if the system doesn't have this include file.

Right, but will writing

#include <sysexits.h>

in your application code and having the sysexits.h file residing in
the application source tree work if the user uses -I-?  I'm not sure
how gnulib modules are (will be) integrated into applications, so
maybe that process takes care of this problem, either by disallowing
-I- or make sure the -I. is added again after any -I-.

>> > I guess what is needed here is another instance of the fnmatch_.h ->
>> > fnmatch.h idiom.
>>
>> That seems more complicated, and I don't understand what the gain is,
>> would you mind explain?
>
> It simplifies the use of the header file: Instead of having to write
>
>    #if HAVE_SYSEXITS_H
>    # include <sysexits.h>
>    #else
>    # include "gnulib-sysexits.h"
>    #endif
>
> the user of the module 'sysexits' just writes
>
>    #inclyde <sysexits.h>
>
> and the Makefile.am magic does the rest.
>
> For <stdbool.h> and <fnmatch.h> this has been a worthy simplification.

It is a worthy goal.  Perhaps my issue above isn't very realistic;
probably it is simplest to do this and see if someone ever encounter a
scenario where this is bad.

OK, so the conclusion here is that no patch to argp-eexst.c is
necessary (assuming the sysexits module works, which I assume for
now).  I'll look at the next argp problem now.

Thanks.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]