[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: autoconfiscating getopt_long()...
From: |
Akim Demaille |
Subject: |
Re: autoconfiscating getopt_long()... |
Date: |
07 Dec 2000 10:22:16 +0100 |
User-agent: |
Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands) |
>>>>> "Paul" == Paul Eggert <address@hidden> writes:
>> From: Matthew Whitworth <address@hidden> Date: Tue, 5 Dec
>> 2000 14:45:19 -0800 (PST)
>> I have examined several packages that use getopt_long(), including
>> several GNU packages, and none of them autoconfiscate this function
>> the same way. Actually, few of them even autoconfiscate it at all
>> -- most simply compile and link it unconditionally
Paul> I suspect that's just tradition dating back to when getopt_long
Paul> was invariably absent from the C library.
Well, maybe, but today that's the recommended way to do it since the
files themselves take care of being `empty' when getopt is already
installed.
/* Comment out all this code if we are using the GNU C Library, and are not
actually compiling the library itself. This code is part of the GNU C
Library, but also included in many other GNU distributions. Compiling
and linking in this code is a waste when using the GNU C library
(especially if it is a shared library). Rather than having every GNU
program understand `configure --with-gnu-libc' and omit the object files,
it is simpler to just do this in the source for each such file. */
#define GETOPT_INTERFACE_VERSION 2
#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2
# include <gnu-versions.h>
# if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
# define ELIDE_CODE
# endif
#endif
#ifndef ELIDE_CODE
/* THE IMPLEMENTATION OF GETOPT. */
#endif /* Not ELIDE_CODE. */