Use an all-permissive copyright notice, recommended by RMS.
[pspp] / m4 / getopt.m4
1 # getopt.m4 serial 6
2 dnl Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
3 dnl This file is free software, distributed under the terms of the GNU
4 dnl General Public License.  As a special exception to the GNU General
5 dnl Public License, this file may be distributed as part of a program
6 dnl that contains a configuration script generated by Autoconf, under
7 dnl the same distribution terms as the rest of that program.
8
9 # The getopt module assume you want GNU getopt, with getopt_long etc,
10 # rather than vanilla POSIX getopt.  This means your your code should
11 # always include <getopt.h> for the getopt prototypes.
12
13 AC_DEFUN([gl_GETOPT_SUBSTITUTE],
14 [
15   GETOPT_H=getopt.h
16   AC_LIBOBJ([getopt])
17   AC_LIBOBJ([getopt1])
18   AC_DEFINE([__GETOPT_PREFIX], [[rpl_]],
19     [Define to rpl_ if the getopt replacement functions and variables
20      should be used.])
21   AC_SUBST([GETOPT_H])
22 ])
23
24 AC_DEFUN([gl_GETOPT],
25 [
26   gl_PREREQ_GETOPT
27
28   if test -z "$GETOPT_H"; then
29     GETOPT_H=
30     AC_CHECK_HEADERS([getopt.h], [], [GETOPT_H=getopt.h])
31     AC_CHECK_FUNCS([getopt_long_only], [], [GETOPT_H=getopt.h])
32
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     AC_CHECK_DECL([optreset], [GETOPT_H=getopt.h], [], [#include <getopt.h>])
36
37     if test -n "$GETOPT_H"; then
38       gl_GETOPT_SUBSTITUTE
39     fi
40   fi
41 ])
42
43 # Prerequisites of lib/getopt*.
44 AC_DEFUN([gl_PREREQ_GETOPT], [:])