annotate m4/wctype.m4 @ 10010:d26ac8a528f7

Enable gnulib's <arpa/inet.h> replacement also when inet_ntop or inet_pton need to be declared.
author Bruno Haible <bruno@clisp.org>
date Tue, 29 Apr 2008 13:37:51 +0200
parents 9f9682a4b630
children cf56ba0ab47b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7733
9d60f39f35c1 * MODULES.html.sh: New module wctype.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1 dnl A placeholder for ISO C99 <wctype.h>, for platforms that lack it.
9d60f39f35c1 * MODULES.html.sh: New module wctype.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
2
9960
9f9682a4b630 Replace the isw* functions on Linux libc5.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
3 dnl Copyright (C) 2006-2008 Free Software Foundation, Inc.
7733
9d60f39f35c1 * MODULES.html.sh: New module wctype.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
4 dnl This file is free software; the Free Software Foundation
9d60f39f35c1 * MODULES.html.sh: New module wctype.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
5 dnl gives unlimited permission to copy and/or distribute it,
9d60f39f35c1 * MODULES.html.sh: New module wctype.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
6 dnl with or without modifications, as long as this notice is preserved.
9d60f39f35c1 * MODULES.html.sh: New module wctype.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
7
9d60f39f35c1 * MODULES.html.sh: New module wctype.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
8 dnl Written by Paul Eggert.
9d60f39f35c1 * MODULES.html.sh: New module wctype.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
9
9d60f39f35c1 * MODULES.html.sh: New module wctype.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
10 AC_DEFUN([gl_WCTYPE_H],
9d60f39f35c1 * MODULES.html.sh: New module wctype.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
11 [
9960
9f9682a4b630 Replace the isw* functions on Linux libc5.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
12 AC_REQUIRE([AC_PROG_CC])
7733
9d60f39f35c1 * MODULES.html.sh: New module wctype.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
13 AC_CHECK_FUNCS_ONCE([iswcntrl])
8781
ef37a3689142 Make the generated wctype.h more self-contained.
Bruno Haible <bruno@clisp.org>
parents: 7856
diff changeset
14 if test $ac_cv_func_iswcntrl = yes; then
ef37a3689142 Make the generated wctype.h more self-contained.
Bruno Haible <bruno@clisp.org>
parents: 7856
diff changeset
15 HAVE_ISWCNTRL=1
ef37a3689142 Make the generated wctype.h more self-contained.
Bruno Haible <bruno@clisp.org>
parents: 7856
diff changeset
16 else
ef37a3689142 Make the generated wctype.h more self-contained.
Bruno Haible <bruno@clisp.org>
parents: 7856
diff changeset
17 HAVE_ISWCNTRL=0
ef37a3689142 Make the generated wctype.h more self-contained.
Bruno Haible <bruno@clisp.org>
parents: 7856
diff changeset
18 fi
ef37a3689142 Make the generated wctype.h more self-contained.
Bruno Haible <bruno@clisp.org>
parents: 7856
diff changeset
19 AC_SUBST([HAVE_ISWCNTRL])
7733
9d60f39f35c1 * MODULES.html.sh: New module wctype.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
20 AC_CHECK_HEADERS_ONCE([wctype.h])
9d60f39f35c1 * MODULES.html.sh: New module wctype.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
21 AC_REQUIRE([AC_C_INLINE])
9d60f39f35c1 * MODULES.html.sh: New module wctype.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
22
7747
c847540b5de5 Fix bug reported by Bruno Haible in
Paul Eggert <eggert@cs.ucla.edu>
parents: 7739
diff changeset
23 AC_REQUIRE([gt_TYPE_WINT_T])
7856
af1b7566f067 Use @...@ consistently in lib/wctype_.h.
Paul Eggert <eggert@cs.ucla.edu>
parents: 7854
diff changeset
24 if test $gt_cv_c_wint_t = yes; then
af1b7566f067 Use @...@ consistently in lib/wctype_.h.
Paul Eggert <eggert@cs.ucla.edu>
parents: 7854
diff changeset
25 HAVE_WINT_T=1
af1b7566f067 Use @...@ consistently in lib/wctype_.h.
Paul Eggert <eggert@cs.ucla.edu>
parents: 7854
diff changeset
26 else
af1b7566f067 Use @...@ consistently in lib/wctype_.h.
Paul Eggert <eggert@cs.ucla.edu>
parents: 7854
diff changeset
27 HAVE_WINT_T=0
af1b7566f067 Use @...@ consistently in lib/wctype_.h.
Paul Eggert <eggert@cs.ucla.edu>
parents: 7854
diff changeset
28 fi
af1b7566f067 Use @...@ consistently in lib/wctype_.h.
Paul Eggert <eggert@cs.ucla.edu>
parents: 7854
diff changeset
29 AC_SUBST([HAVE_WINT_T])
7747
c847540b5de5 Fix bug reported by Bruno Haible in
Paul Eggert <eggert@cs.ucla.edu>
parents: 7739
diff changeset
30
7784
97a9a64ee63c Don't worry about using IRIX 5.3's wctype.h broken definitions;
Paul Eggert <eggert@cs.ucla.edu>
parents: 7782
diff changeset
31 WCTYPE_H=wctype.h
7733
9d60f39f35c1 * MODULES.html.sh: New module wctype.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
32 if test $ac_cv_header_wctype_h = yes; then
8781
ef37a3689142 Make the generated wctype.h more self-contained.
Bruno Haible <bruno@clisp.org>
parents: 7856
diff changeset
33 if test $ac_cv_func_iswcntrl = yes; then
9960
9f9682a4b630 Replace the isw* functions on Linux libc5.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
34 dnl Linux libc5 has an iswprint function that returns 0 for all arguments.
9f9682a4b630 Replace the isw* functions on Linux libc5.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
35 dnl The other functions are likely broken in the same way.
9f9682a4b630 Replace the isw* functions on Linux libc5.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
36 AC_CACHE_CHECK([whether iswcntrl works], [gl_cv_func_iswcntrl_works],
9f9682a4b630 Replace the isw* functions on Linux libc5.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
37 [
9f9682a4b630 Replace the isw* functions on Linux libc5.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
38 AC_TRY_RUN([#include <stddef.h>
9f9682a4b630 Replace the isw* functions on Linux libc5.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
39 #include <stdio.h>
9f9682a4b630 Replace the isw* functions on Linux libc5.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
40 #include <time.h>
9f9682a4b630 Replace the isw* functions on Linux libc5.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
41 #include <wchar.h>
9f9682a4b630 Replace the isw* functions on Linux libc5.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
42 #include <wctype.h>
9f9682a4b630 Replace the isw* functions on Linux libc5.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
43 int main () { return iswprint ('x') == 0; }],
9f9682a4b630 Replace the isw* functions on Linux libc5.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
44 [gl_cv_func_iswcntrl_works=yes], [gl_cv_func_iswcntrl_works=no])
9f9682a4b630 Replace the isw* functions on Linux libc5.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
45 ],
9f9682a4b630 Replace the isw* functions on Linux libc5.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
46 [
9f9682a4b630 Replace the isw* functions on Linux libc5.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
47 AC_TRY_COMPILE([#include <stdlib.h>
9f9682a4b630 Replace the isw* functions on Linux libc5.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
48 #if __GNU_LIBRARY__ == 1
9f9682a4b630 Replace the isw* functions on Linux libc5.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
49 Linux libc5 i18n is broken.
9f9682a4b630 Replace the isw* functions on Linux libc5.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
50 #endif],
9f9682a4b630 Replace the isw* functions on Linux libc5.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
51 [gl_cv_func_iswcntrl_works=yes], [gl_cv_func_iswcntrl_works=no])
9f9682a4b630 Replace the isw* functions on Linux libc5.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
52 ])
9f9682a4b630 Replace the isw* functions on Linux libc5.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
53 if test $gl_cv_func_iswcntrl_works = yes; then
9f9682a4b630 Replace the isw* functions on Linux libc5.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
54 WCTYPE_H=
9f9682a4b630 Replace the isw* functions on Linux libc5.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
55 fi
7784
97a9a64ee63c Don't worry about using IRIX 5.3's wctype.h broken definitions;
Paul Eggert <eggert@cs.ucla.edu>
parents: 7782
diff changeset
56 fi
8995
1025663f7658 * m4/include_next.m4 (gl_INCLUDE_NEXT): Define and AC_SUBST
Paul Eggert <eggert@cs.ucla.edu>
parents: 8781
diff changeset
57 dnl Compute NEXT_WCTYPE_H even if WCTYPE_H is empty,
7799
03006e334f20 * m4/wctype.m4 (gl_WCTYPE_H): Compute ABSOLUTE_WCTYPE_H even if
Paul Eggert <eggert@cs.ucla.edu>
parents: 7784
diff changeset
58 dnl for the benefit of builds from non-distclean directories.
8995
1025663f7658 * m4/include_next.m4 (gl_INCLUDE_NEXT): Define and AC_SUBST
Paul Eggert <eggert@cs.ucla.edu>
parents: 8781
diff changeset
59 gl_CHECK_NEXT_HEADERS([wctype.h])
7733
9d60f39f35c1 * MODULES.html.sh: New module wctype.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
60 HAVE_WCTYPE_H=1
9d60f39f35c1 * MODULES.html.sh: New module wctype.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
61 else
9d60f39f35c1 * MODULES.html.sh: New module wctype.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
62 HAVE_WCTYPE_H=0
9d60f39f35c1 * MODULES.html.sh: New module wctype.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
63 fi
9d60f39f35c1 * MODULES.html.sh: New module wctype.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
64 AC_SUBST([HAVE_WCTYPE_H])
9d60f39f35c1 * MODULES.html.sh: New module wctype.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
65 AC_SUBST([WCTYPE_H])
9960
9f9682a4b630 Replace the isw* functions on Linux libc5.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
66
9f9682a4b630 Replace the isw* functions on Linux libc5.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
67 if test "$gl_cv_func_iswcntrl_works" = no; then
9f9682a4b630 Replace the isw* functions on Linux libc5.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
68 REPLACE_ISWCNTRL=1
9f9682a4b630 Replace the isw* functions on Linux libc5.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
69 else
9f9682a4b630 Replace the isw* functions on Linux libc5.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
70 REPLACE_ISWCNTRL=0
9f9682a4b630 Replace the isw* functions on Linux libc5.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
71 fi
9f9682a4b630 Replace the isw* functions on Linux libc5.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
72 AC_SUBST([REPLACE_ISWCNTRL])
7733
9d60f39f35c1 * MODULES.html.sh: New module wctype.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
73 ])