Mercurial > hg > octave-nkf > gnulib-hg
annotate m4/getopt.m4 @ 5819:16b0f8ffe787
* getopt.m4 (gl_GETOPT): Check for Solaris 10 getopt, and avoid
needless checks.
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Fri, 06 May 2005 01:04:20 +0000 |
parents | 87c42e194f4a |
children | dcdcb5e92aa2 |
rev | line source |
---|---|
5819
16b0f8ffe787
* getopt.m4 (gl_GETOPT): Check for Solaris 10 getopt, and avoid
Paul Eggert <eggert@cs.ucla.edu>
parents:
5611
diff
changeset
|
1 # getopt.m4 serial 8 |
16b0f8ffe787
* getopt.m4 (gl_GETOPT): Check for Solaris 10 getopt, and avoid
Paul Eggert <eggert@cs.ucla.edu>
parents:
5611
diff
changeset
|
2 dnl Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. |
5611
87c42e194f4a
Use an all-permissive copyright notice, recommended by RMS.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5478
diff
changeset
|
3 dnl This file is free software; the Free Software Foundation |
87c42e194f4a
Use an all-permissive copyright notice, recommended by RMS.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5478
diff
changeset
|
4 dnl gives unlimited permission to copy and/or distribute it, |
87c42e194f4a
Use an all-permissive copyright notice, recommended by RMS.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5478
diff
changeset
|
5 dnl with or without modifications, as long as this notice is preserved. |
4107
7c1a6b73f48e
An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6 |
5193
f9f7d9ea394a
(gl_GETOPT_SUBSTITUTE, gl_PREREQ_GETOPT): New macros.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4653
diff
changeset
|
7 # The getopt module assume you want GNU getopt, with getopt_long etc, |
f9f7d9ea394a
(gl_GETOPT_SUBSTITUTE, gl_PREREQ_GETOPT): New macros.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4653
diff
changeset
|
8 # rather than vanilla POSIX getopt. This means your your code should |
f9f7d9ea394a
(gl_GETOPT_SUBSTITUTE, gl_PREREQ_GETOPT): New macros.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4653
diff
changeset
|
9 # always include <getopt.h> for the getopt prototypes. |
f9f7d9ea394a
(gl_GETOPT_SUBSTITUTE, gl_PREREQ_GETOPT): New macros.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4653
diff
changeset
|
10 |
f9f7d9ea394a
(gl_GETOPT_SUBSTITUTE, gl_PREREQ_GETOPT): New macros.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4653
diff
changeset
|
11 AC_DEFUN([gl_GETOPT_SUBSTITUTE], |
f9f7d9ea394a
(gl_GETOPT_SUBSTITUTE, gl_PREREQ_GETOPT): New macros.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4653
diff
changeset
|
12 [ |
f9f7d9ea394a
(gl_GETOPT_SUBSTITUTE, gl_PREREQ_GETOPT): New macros.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4653
diff
changeset
|
13 GETOPT_H=getopt.h |
f9f7d9ea394a
(gl_GETOPT_SUBSTITUTE, gl_PREREQ_GETOPT): New macros.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4653
diff
changeset
|
14 AC_LIBOBJ([getopt]) |
f9f7d9ea394a
(gl_GETOPT_SUBSTITUTE, gl_PREREQ_GETOPT): New macros.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4653
diff
changeset
|
15 AC_LIBOBJ([getopt1]) |
5427
e314bbc551bf
(gl_GETOPT_SUBSTITUTE): Define __GETOPT_PREFIX instead
Paul Eggert <eggert@cs.ucla.edu>
parents:
5423
diff
changeset
|
16 AC_DEFINE([__GETOPT_PREFIX], [[rpl_]], |
e314bbc551bf
(gl_GETOPT_SUBSTITUTE): Define __GETOPT_PREFIX instead
Paul Eggert <eggert@cs.ucla.edu>
parents:
5423
diff
changeset
|
17 [Define to rpl_ if the getopt replacement functions and variables |
e314bbc551bf
(gl_GETOPT_SUBSTITUTE): Define __GETOPT_PREFIX instead
Paul Eggert <eggert@cs.ucla.edu>
parents:
5423
diff
changeset
|
18 should be used.]) |
5193
f9f7d9ea394a
(gl_GETOPT_SUBSTITUTE, gl_PREREQ_GETOPT): New macros.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4653
diff
changeset
|
19 AC_SUBST([GETOPT_H]) |
f9f7d9ea394a
(gl_GETOPT_SUBSTITUTE, gl_PREREQ_GETOPT): New macros.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4653
diff
changeset
|
20 ]) |
f9f7d9ea394a
(gl_GETOPT_SUBSTITUTE, gl_PREREQ_GETOPT): New macros.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4653
diff
changeset
|
21 |
4107
7c1a6b73f48e
An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
22 AC_DEFUN([gl_GETOPT], |
7c1a6b73f48e
An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
23 [ |
5193
f9f7d9ea394a
(gl_GETOPT_SUBSTITUTE, gl_PREREQ_GETOPT): New macros.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4653
diff
changeset
|
24 gl_PREREQ_GETOPT |
f9f7d9ea394a
(gl_GETOPT_SUBSTITUTE, gl_PREREQ_GETOPT): New macros.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4653
diff
changeset
|
25 |
5478
fca5a7f08a72
(gl_GETOPT): Check if GETOPT_H is already set, in
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
5427
diff
changeset
|
26 if test -z "$GETOPT_H"; then |
fca5a7f08a72
(gl_GETOPT): Check if GETOPT_H is already set, in
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
5427
diff
changeset
|
27 GETOPT_H= |
fca5a7f08a72
(gl_GETOPT): Check if GETOPT_H is already set, in
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
5427
diff
changeset
|
28 AC_CHECK_HEADERS([getopt.h], [], [GETOPT_H=getopt.h]) |
5819
16b0f8ffe787
* getopt.m4 (gl_GETOPT): Check for Solaris 10 getopt, and avoid
Paul Eggert <eggert@cs.ucla.edu>
parents:
5611
diff
changeset
|
29 if test -z "$GETOPT_H"; then |
16b0f8ffe787
* getopt.m4 (gl_GETOPT): Check for Solaris 10 getopt, and avoid
Paul Eggert <eggert@cs.ucla.edu>
parents:
5611
diff
changeset
|
30 AC_CHECK_FUNCS([getopt_long_only], [], [GETOPT_H=getopt.h]) |
16b0f8ffe787
* getopt.m4 (gl_GETOPT): Check for Solaris 10 getopt, and avoid
Paul Eggert <eggert@cs.ucla.edu>
parents:
5611
diff
changeset
|
31 fi |
5193
f9f7d9ea394a
(gl_GETOPT_SUBSTITUTE, gl_PREREQ_GETOPT): New macros.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4653
diff
changeset
|
32 |
5478
fca5a7f08a72
(gl_GETOPT): Check if GETOPT_H is already set, in
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
5427
diff
changeset
|
33 dnl BSD getopt_long uses an incompatible method to reset option processing, |
fca5a7f08a72
(gl_GETOPT): Check if GETOPT_H is already set, in
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
5427
diff
changeset
|
34 dnl and (as of 2004-10-15) mishandles optional option-arguments. |
5819
16b0f8ffe787
* getopt.m4 (gl_GETOPT): Check for Solaris 10 getopt, and avoid
Paul Eggert <eggert@cs.ucla.edu>
parents:
5611
diff
changeset
|
35 if test -z "$GETOPT_H"; then |
16b0f8ffe787
* getopt.m4 (gl_GETOPT): Check for Solaris 10 getopt, and avoid
Paul Eggert <eggert@cs.ucla.edu>
parents:
5611
diff
changeset
|
36 AC_CHECK_DECL([optreset], [GETOPT_H=getopt.h], [], [#include <getopt.h>]) |
16b0f8ffe787
* getopt.m4 (gl_GETOPT): Check for Solaris 10 getopt, and avoid
Paul Eggert <eggert@cs.ucla.edu>
parents:
5611
diff
changeset
|
37 fi |
16b0f8ffe787
* getopt.m4 (gl_GETOPT): Check for Solaris 10 getopt, and avoid
Paul Eggert <eggert@cs.ucla.edu>
parents:
5611
diff
changeset
|
38 |
16b0f8ffe787
* getopt.m4 (gl_GETOPT): Check for Solaris 10 getopt, and avoid
Paul Eggert <eggert@cs.ucla.edu>
parents:
5611
diff
changeset
|
39 dnl Solaris 10 getopt doesn't handle `+' as a leading character in an |
16b0f8ffe787
* getopt.m4 (gl_GETOPT): Check for Solaris 10 getopt, and avoid
Paul Eggert <eggert@cs.ucla.edu>
parents:
5611
diff
changeset
|
40 dnl option string (as of 2005-05-05). |
16b0f8ffe787
* getopt.m4 (gl_GETOPT): Check for Solaris 10 getopt, and avoid
Paul Eggert <eggert@cs.ucla.edu>
parents:
5611
diff
changeset
|
41 if test -z "$GETOPT_H"; then |
16b0f8ffe787
* getopt.m4 (gl_GETOPT): Check for Solaris 10 getopt, and avoid
Paul Eggert <eggert@cs.ucla.edu>
parents:
5611
diff
changeset
|
42 AC_CHECK_DECL([getopt_clip], [GETOPT_H=getopt.h], [], |
16b0f8ffe787
* getopt.m4 (gl_GETOPT): Check for Solaris 10 getopt, and avoid
Paul Eggert <eggert@cs.ucla.edu>
parents:
5611
diff
changeset
|
43 [#include <getopt.h>]) |
16b0f8ffe787
* getopt.m4 (gl_GETOPT): Check for Solaris 10 getopt, and avoid
Paul Eggert <eggert@cs.ucla.edu>
parents:
5611
diff
changeset
|
44 fi |
5354
4456e7b1cfcd
(gl_GETOPT): Detect and reject the incompatible BSD
Paul Eggert <eggert@cs.ucla.edu>
parents:
5193
diff
changeset
|
45 |
5478
fca5a7f08a72
(gl_GETOPT): Check if GETOPT_H is already set, in
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
5427
diff
changeset
|
46 if test -n "$GETOPT_H"; then |
fca5a7f08a72
(gl_GETOPT): Check if GETOPT_H is already set, in
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
5427
diff
changeset
|
47 gl_GETOPT_SUBSTITUTE |
fca5a7f08a72
(gl_GETOPT): Check if GETOPT_H is already set, in
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
5427
diff
changeset
|
48 fi |
5193
f9f7d9ea394a
(gl_GETOPT_SUBSTITUTE, gl_PREREQ_GETOPT): New macros.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4653
diff
changeset
|
49 fi |
4107
7c1a6b73f48e
An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
50 ]) |
5193
f9f7d9ea394a
(gl_GETOPT_SUBSTITUTE, gl_PREREQ_GETOPT): New macros.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4653
diff
changeset
|
51 |
f9f7d9ea394a
(gl_GETOPT_SUBSTITUTE, gl_PREREQ_GETOPT): New macros.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4653
diff
changeset
|
52 # Prerequisites of lib/getopt*. |
f9f7d9ea394a
(gl_GETOPT_SUBSTITUTE, gl_PREREQ_GETOPT): New macros.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4653
diff
changeset
|
53 AC_DEFUN([gl_PREREQ_GETOPT], [:]) |