[Top][All Lists]

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

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

From: Bruno Haible
Subject: Re: [Bug-gnulib] feature request: argp()
Date: Tue, 10 Jun 2003 22:56:22 +0200
User-agent: KMail/1.5

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.

> 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:


lib_SOURCES += argp.h argp-fmtstream.h argp-namefrob.h

> 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.

> > 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

   # include <sysexits.h>
   # include "gnulib-sysexits.h"

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.


reply via email to

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