[Top][All Lists]

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

[bug-gnulib] Re: getopt and Solaris 10

From: Derek Price
Subject: [bug-gnulib] Re: getopt and Solaris 10
Date: Thu, 05 May 2005 14:55:42 -0400
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)

Derek Price wrote:

>Apparently Solaris 10 includes a getopt.h and appears to be GNU getopt
>by all the tests in getopt.m4.  Unfortunately, it doesn't support "+" as
>the first character of the option string.  The original report is here:

Matthias pointed me at the man page for Solaris 10's getopt_long:

Based on that man page, I see two alternatives:

1. Always use getopt_long() in CVS since the Solaris 10 version supports
"+" as the start of the option string even though its getopt() does not.
2. Check for the getopt_clip() function, which should be unique to
Solaris, and use the GNULIB getopt.c when it is found.

I prefer door #2.  Trivial patch attached:

2005-05-05  Derek Price  <address@hidden>

    * m4/getopt.m4 (gl_GETOPT): Use GNULIB getopt on Solaris 10.

Matthias, would you mind verifying that this patch fixes CVS on your
Solaris 10?


Index: m4/getopt.m4
RCS file: /cvsroot/gnulib/gnulib/m4/getopt.m4,v
retrieving revision 1.8
diff -u -p -r1.8 getopt.m4
--- m4/getopt.m4        23 Jan 2005 08:06:57 -0000      1.8
+++ m4/getopt.m4        5 May 2005 18:51:09 -0000
@@ -32,6 +32,10 @@ AC_DEFUN([gl_GETOPT],
     dnl and (as of 2004-10-15) mishandles optional option-arguments.
     AC_CHECK_DECL([optreset], [GETOPT_H=getopt.h], [], [#include <getopt.h>])
+    dnl Solaris 10 getopt doesn't handle `+' as a leading character in an
+    dnl option string (as of 2005-05-05).
+    AC_CHECK_FUNCS([getopt_clip], [GETOPT_H=getopt.h])
     if test -n "$GETOPT_H"; then

reply via email to

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