annotate m4/argp.m4 @ 273:88bbffa404ea 2.5 2.5

Updated version for release
author lost
date Sun, 16 Aug 2009 17:18:11 +0000
parents d5392bb5da3c
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
272
d5392bb5da3c Added generated files
lost
parents:
diff changeset
1 # argp.m4 serial 8
d5392bb5da3c Added generated files
lost
parents:
diff changeset
2 dnl Copyright (C) 2003-2007 Free Software Foundation, Inc.
d5392bb5da3c Added generated files
lost
parents:
diff changeset
3 dnl This file is free software; the Free Software Foundation
d5392bb5da3c Added generated files
lost
parents:
diff changeset
4 dnl gives unlimited permission to copy and/or distribute it,
d5392bb5da3c Added generated files
lost
parents:
diff changeset
5 dnl with or without modifications, as long as this notice is preserved.
d5392bb5da3c Added generated files
lost
parents:
diff changeset
6
d5392bb5da3c Added generated files
lost
parents:
diff changeset
7 AC_DEFUN([gl_ARGP],
d5392bb5da3c Added generated files
lost
parents:
diff changeset
8 [
d5392bb5da3c Added generated files
lost
parents:
diff changeset
9 AC_REQUIRE([AC_C_INLINE])
d5392bb5da3c Added generated files
lost
parents:
diff changeset
10 AC_REQUIRE([AC_C_RESTRICT])
d5392bb5da3c Added generated files
lost
parents:
diff changeset
11 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
d5392bb5da3c Added generated files
lost
parents:
diff changeset
12 dnl argp-parse.c depends on GNU getopt internals, therefore use GNU getopt
d5392bb5da3c Added generated files
lost
parents:
diff changeset
13 dnl always.
d5392bb5da3c Added generated files
lost
parents:
diff changeset
14 gl_GETOPT_SUBSTITUTE
d5392bb5da3c Added generated files
lost
parents:
diff changeset
15 dnl Note: gl_GETOPT_SUBSTITUTE does AC_LIBOBJ(getopt), AC_LIBOBJ(getopt1).
d5392bb5da3c Added generated files
lost
parents:
diff changeset
16
d5392bb5da3c Added generated files
lost
parents:
diff changeset
17 AC_CHECK_DECL([program_invocation_name],
d5392bb5da3c Added generated files
lost
parents:
diff changeset
18 [AC_DEFINE(HAVE_DECL_PROGRAM_INVOCATION_NAME, 1,
d5392bb5da3c Added generated files
lost
parents:
diff changeset
19 [Define if program_invocation_name is declared])],
d5392bb5da3c Added generated files
lost
parents:
diff changeset
20 [AC_DEFINE(GNULIB_PROGRAM_INVOCATION_NAME, 1,
d5392bb5da3c Added generated files
lost
parents:
diff changeset
21 [Define to 1 to add extern declaration of program_invocation_name to argp.h])],
d5392bb5da3c Added generated files
lost
parents:
diff changeset
22 [#include <errno.h>])
d5392bb5da3c Added generated files
lost
parents:
diff changeset
23 AC_CHECK_DECL([program_invocation_short_name],
d5392bb5da3c Added generated files
lost
parents:
diff changeset
24 [AC_DEFINE(HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME, 1,
d5392bb5da3c Added generated files
lost
parents:
diff changeset
25 [Define if program_invocation_short_name is declared])],
d5392bb5da3c Added generated files
lost
parents:
diff changeset
26 [AC_DEFINE(GNULIB_PROGRAM_INVOCATION_SHORT_NAME, 1,
d5392bb5da3c Added generated files
lost
parents:
diff changeset
27 [Define to 1 to add extern declaration of program_invocation_short_name to argp.h])],
d5392bb5da3c Added generated files
lost
parents:
diff changeset
28 [#include <errno.h>])
d5392bb5da3c Added generated files
lost
parents:
diff changeset
29
d5392bb5da3c Added generated files
lost
parents:
diff changeset
30 # Check if program_invocation_name and program_invocation_short_name
d5392bb5da3c Added generated files
lost
parents:
diff changeset
31 # are defined elsewhere. It is improbable that only one of them will
d5392bb5da3c Added generated files
lost
parents:
diff changeset
32 # be defined and other not, I prefer to stay on the safe side and to
d5392bb5da3c Added generated files
lost
parents:
diff changeset
33 # test each one separately.
d5392bb5da3c Added generated files
lost
parents:
diff changeset
34 AC_MSG_CHECKING(whether program_invocation_name is defined)
d5392bb5da3c Added generated files
lost
parents:
diff changeset
35 AC_TRY_LINK([#include <argp.h>],
d5392bb5da3c Added generated files
lost
parents:
diff changeset
36 [ program_invocation_name = "test"; ],
d5392bb5da3c Added generated files
lost
parents:
diff changeset
37 [ AC_DEFINE(HAVE_PROGRAM_INVOCATION_NAME,1,
d5392bb5da3c Added generated files
lost
parents:
diff changeset
38 [Define if program_invocation_name is defined])
d5392bb5da3c Added generated files
lost
parents:
diff changeset
39 AC_MSG_RESULT(yes)],
d5392bb5da3c Added generated files
lost
parents:
diff changeset
40 [ AC_MSG_RESULT(no)] )
d5392bb5da3c Added generated files
lost
parents:
diff changeset
41
d5392bb5da3c Added generated files
lost
parents:
diff changeset
42 AC_MSG_CHECKING(whether program_invocation_short_name is defined)
d5392bb5da3c Added generated files
lost
parents:
diff changeset
43 AC_TRY_LINK([#include <argp.h>],
d5392bb5da3c Added generated files
lost
parents:
diff changeset
44 [ program_invocation_short_name = "test"; ],
d5392bb5da3c Added generated files
lost
parents:
diff changeset
45 [ AC_DEFINE(HAVE_PROGRAM_INVOCATION_SHORT_NAME,1,
d5392bb5da3c Added generated files
lost
parents:
diff changeset
46 [Define if program_invocation_short_name is defined])
d5392bb5da3c Added generated files
lost
parents:
diff changeset
47 AC_MSG_RESULT(yes)],
d5392bb5da3c Added generated files
lost
parents:
diff changeset
48 [ AC_MSG_RESULT(no)] )
d5392bb5da3c Added generated files
lost
parents:
diff changeset
49
d5392bb5da3c Added generated files
lost
parents:
diff changeset
50 AC_CHECK_DECLS_ONCE([clearerr_unlocked])
d5392bb5da3c Added generated files
lost
parents:
diff changeset
51 AC_CHECK_DECLS_ONCE([feof_unlocked])
d5392bb5da3c Added generated files
lost
parents:
diff changeset
52 AC_CHECK_DECLS_ONCE([ferror_unlocked])
d5392bb5da3c Added generated files
lost
parents:
diff changeset
53 AC_CHECK_DECLS_ONCE([fflush_unlocked])
d5392bb5da3c Added generated files
lost
parents:
diff changeset
54 AC_CHECK_DECLS_ONCE([fgets_unlocked])
d5392bb5da3c Added generated files
lost
parents:
diff changeset
55 AC_CHECK_DECLS_ONCE([fputc_unlocked])
d5392bb5da3c Added generated files
lost
parents:
diff changeset
56 AC_CHECK_DECLS_ONCE([fputs_unlocked])
d5392bb5da3c Added generated files
lost
parents:
diff changeset
57 AC_CHECK_DECLS_ONCE([fread_unlocked])
d5392bb5da3c Added generated files
lost
parents:
diff changeset
58 AC_CHECK_DECLS_ONCE([fwrite_unlocked])
d5392bb5da3c Added generated files
lost
parents:
diff changeset
59 AC_CHECK_DECLS_ONCE([getc_unlocked])
d5392bb5da3c Added generated files
lost
parents:
diff changeset
60 AC_CHECK_DECLS_ONCE([getchar_unlocked])
d5392bb5da3c Added generated files
lost
parents:
diff changeset
61 AC_CHECK_DECLS_ONCE([putc_unlocked])
d5392bb5da3c Added generated files
lost
parents:
diff changeset
62 AC_CHECK_DECLS_ONCE([putchar_unlocked])
d5392bb5da3c Added generated files
lost
parents:
diff changeset
63 AC_CHECK_FUNCS_ONCE([flockfile funlockfile])
d5392bb5da3c Added generated files
lost
parents:
diff changeset
64 AC_CHECK_HEADERS_ONCE([features.h linewrap.h])
d5392bb5da3c Added generated files
lost
parents:
diff changeset
65 ])