bug-gnulib
[Top][All Lists]
Advanced

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

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


From: Simon Josefsson
Subject: [Bug-gnulib] Re: Autoconf and differences between GNU getopt and OpenBSD getopt
Date: Fri, 15 Oct 2004 11:15:30 +0200
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux)

Derek Robert Price <address@hidden> writes:

> Glancing at the latest gl_GETOPT test, it appears to be only using the
> existance of the getopt.h header file to decide whether to use the
> substitute getopt() function or not:
>
> 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...

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

Thanks.





reply via email to

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