bug-gnulib
[Top][All Lists]
Advanced

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

Re: [Bug-gnulib] Re: Autoconf and differences between GNU getopt and


From: Derek Robert Price
Subject: Re: [Bug-gnulib] Re: Autoconf and differences between GNU getopt and OpenBSD getopt
Date: Fri, 15 Oct 2004 13:04:35 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040616

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Simon Josefsson wrote:

>Derek Robert Price <address@hidden> writes:
>
>>AC_DEFUN([gl_GETOPT],
>>[
>>  gl_PREREQ_GETOPT
>>                                                                          
 
>>
>>
>>  GETOPT_H=
>>  AC_CHECK_HEADERS([getopt.h], [], [GETOPT_H=getopt.h])
>>  AC_CHECK_FUNCS([getopt_long_only], [], [GETOPT_H=getopt.h])
>>                                                                          
 
>>
>>
>>  if test -n "$GETOPT_H"; then
>>     gl_GETOPT_SUBSTITUTE
>>  fi
>>])
>>
>>
>>So, it does make sense that, if Alex's version of BSD comes packaged
>>with a getopt.h header but an incompatible getopt() function, then the
>>latest gl_GETOPT would incorrectly choose to use the system getopt()
>>function rather than the GNULIB substitute.
>
>
>Do BSD really have getopt_long_only?  If so, then the getopt.m4 need
>to be improved...


According to Alex, yes, it does.  A quick google search on "bsd
getopt_long_only" brings up a patch submission from February and a bug
report from March, so I presume the patch was accepted.  Here's a link
to an email that claims getopt_long_only first appeared in OpenBSD 3.3
and FreeBSD 5.2:
<http://mailman.fastxs.net/pipermail/dbmail-dev/2004-July/004085.html>.

A more focused search of the FreeBSD site brings up a lot more bug
reports from March and the getopt_long.c file itself containing
getopt_long_only():
<http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/libc/stdlib/getopt_long.c?rev=1.12&content-type=text/x-cvsweb-markup>.

A search of openbsd.org brings up similar results.  Here's the
getopt.h from the CVS repo there, also showing a getopt_long_only():
<http://www.openbsd.org/cgi-bin/cvsweb/src/include/getopt.h?rev=1.1&content-type=text/x-cvsweb-markup>.

>>Something like Alex's test program should probably be added to
>>gl_GETOPT, unless someone can suggest a better way to detect or work
>>around the problem.
>
>
>...however, if BSD does not have getopt_long_only, it seems to me that
>the above test should work.


Yes, it should.

Cheers,

Derek

- --
                *8^)

Email: address@hidden

Get CVS support at <http://ximbiot.com>!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFBcAMiLD1OTBfyMaQRApPyAKDmlpIh3GsHQAtygBXobJbcWgpeZACgtt8D
dTluhn9OI/zt47t9n7oKNEc=
=CnR7
-----END PGP SIGNATURE-----





reply via email to

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