2 dnl Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
7 # The getopt module assume you want GNU getopt, with getopt_long etc,
8 # rather than vanilla POSIX getopt. This means your your code should
9 # always include <getopt.h> for the getopt prototypes.
11 AC_DEFUN([gl_GETOPT_SUBSTITUTE],
16 AC_DEFINE([__GETOPT_PREFIX], [[rpl_]],
17 [Define to rpl_ if the getopt replacement functions and variables
26 if test -z "$GETOPT_H"; then
28 AC_CHECK_HEADERS([getopt.h], [], [GETOPT_H=getopt.h])
29 if test -z "$GETOPT_H"; then
30 AC_CHECK_FUNCS([getopt_long_only], [], [GETOPT_H=getopt.h])
33 dnl BSD getopt_long uses an incompatible method to reset option processing,
34 dnl and (as of 2004-10-15) mishandles optional option-arguments.
35 if test -z "$GETOPT_H"; then
36 AC_CHECK_DECL([optreset], [GETOPT_H=getopt.h], [], [#include <getopt.h>])
39 dnl Solaris 10 getopt doesn't handle `+' as a leading character in an
40 dnl option string (as of 2005-05-05).
41 if test -z "$GETOPT_H"; then
42 AC_CHECK_DECL([getopt_clip], [GETOPT_H=getopt.h], [],
43 [#include <getopt.h>])
46 if test -n "$GETOPT_H"; then
52 # Prerequisites of lib/getopt*.
53 AC_DEFUN([gl_PREREQ_GETOPT], [:])