annotate m4/mbswidth.m4 @ 17363:5a51fb7777a9

sys_select, sys_time: port 2013-01-30 Solaris 2.6 fix to Cygwin Problem reported by Marco Atzeri in <http://lists.gnu.org/archive/html/bug-gnulib/2013-03/msg00000.html>. * lib/sys_select.in.h [HAVE_SYS_SELECT_H && _CYGWIN_SYS_TIME_H]: Simply delegate to the system <sys/select.h> in this case too. Also, pay attention to _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H only if OSF/1, since otherwise Cygwin breaks, and it doesn't seem to be needed on Solaris either. * lib/sys_time.in.h [_CYGWIN_SYS_TIME_H]: Simply delgate to the system <sys/time.h> in this case.
author Paul Eggert <eggert@cs.ucla.edu>
date Tue, 19 Mar 2013 09:08:47 -0700
parents e542fd46ad6f
children 344018b6e5d7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13577
d53740f6f336 Modernize AC_TRY_COMPILE invocations.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
1 # mbswidth.m4 serial 18
17249
e542fd46ad6f maint: update all copyright year number ranges
Eric Blake <eblake@redhat.com>
parents: 16201
diff changeset
2 dnl Copyright (C) 2000-2002, 2004, 2006-2013 Free Software Foundation, Inc.
5585
adff74659d81 Use an all-permissive copyright notice, recommended by RMS.
Bruno Haible <bruno@clisp.org>
parents: 5296
diff changeset
3 dnl This file is free software; the Free Software Foundation
adff74659d81 Use an all-permissive copyright notice, recommended by RMS.
Bruno Haible <bruno@clisp.org>
parents: 5296
diff changeset
4 dnl gives unlimited permission to copy and/or distribute it,
adff74659d81 Use an all-permissive copyright notice, recommended by RMS.
Bruno Haible <bruno@clisp.org>
parents: 5296
diff changeset
5 dnl with or without modifications, as long as this notice is preserved.
2755
14dcdce94330 *** empty log message ***
Jim Meyering <jim@meyering.net>
parents:
diff changeset
6
14dcdce94330 *** empty log message ***
Jim Meyering <jim@meyering.net>
parents:
diff changeset
7 dnl autoconf tests required for use of mbswidth.c
14dcdce94330 *** empty log message ***
Jim Meyering <jim@meyering.net>
parents:
diff changeset
8 dnl From Bruno Haible.
14dcdce94330 *** empty log message ***
Jim Meyering <jim@meyering.net>
parents:
diff changeset
9
4108
c1d472db5c30 An independent .m4 file for each module.
Bruno Haible <bruno@clisp.org>
parents: 4091
diff changeset
10 AC_DEFUN([gl_MBSWIDTH],
2755
14dcdce94330 *** empty log message ***
Jim Meyering <jim@meyering.net>
parents:
diff changeset
11 [
7758
ea1da95d3579 * lib/mbchar.h: Just include <wctype.h>; the wctype module
Paul Eggert <eggert@cs.ucla.edu>
parents: 7357
diff changeset
12 AC_CHECK_HEADERS_ONCE([wchar.h])
6876
edba9bd2b197 * mbswidth.m4 (gl_MBSDWIDTH): Move wcwidth from here...
Eric Blake <ebb9@byu.net>
parents: 5585
diff changeset
13 AC_CHECK_FUNCS_ONCE([isascii mbsinit])
3322
1071077a538b (jm_PREREQ_MBSWIDTH): No longer requires AM_C_PROTOTYPES.
Jim Meyering <jim@meyering.net>
parents: 3170
diff changeset
14
4976
4df6aeb9a5c5 Fix portability problem with Tru64 and BSD/OS.
Bruno Haible <bruno@clisp.org>
parents: 4108
diff changeset
15 dnl UnixWare 7.1.1 <wchar.h> has a declaration of a function mbswidth()
4df6aeb9a5c5 Fix portability problem with Tru64 and BSD/OS.
Bruno Haible <bruno@clisp.org>
parents: 4108
diff changeset
16 dnl that clashes with ours.
4df6aeb9a5c5 Fix portability problem with Tru64 and BSD/OS.
Bruno Haible <bruno@clisp.org>
parents: 4108
diff changeset
17 AC_CACHE_CHECK([whether mbswidth is declared in <wchar.h>],
13577
d53740f6f336 Modernize AC_TRY_COMPILE invocations.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
18 [ac_cv_have_decl_mbswidth],
d53740f6f336 Modernize AC_TRY_COMPILE invocations.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
19 [AC_COMPILE_IFELSE(
d53740f6f336 Modernize AC_TRY_COMPILE invocations.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
20 [AC_LANG_PROGRAM(
d53740f6f336 Modernize AC_TRY_COMPILE invocations.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
21 [[
7888
b6376840b47b * modules/fnmatch (Depends-on): Depend on wchar.
Eric Blake <ebb9@byu.net>
parents: 7758
diff changeset
22 /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
b6376840b47b * modules/fnmatch (Depends-on): Depend on wchar.
Eric Blake <ebb9@byu.net>
parents: 7758
diff changeset
23 <wchar.h>.
b6376840b47b * modules/fnmatch (Depends-on): Depend on wchar.
Eric Blake <ebb9@byu.net>
parents: 7758
diff changeset
24 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included
b6376840b47b * modules/fnmatch (Depends-on): Depend on wchar.
Eric Blake <ebb9@byu.net>
parents: 7758
diff changeset
25 before <wchar.h>. */
b6376840b47b * modules/fnmatch (Depends-on): Depend on wchar.
Eric Blake <ebb9@byu.net>
parents: 7758
diff changeset
26 #include <stddef.h>
b6376840b47b * modules/fnmatch (Depends-on): Depend on wchar.
Eric Blake <ebb9@byu.net>
parents: 7758
diff changeset
27 #include <stdio.h>
b6376840b47b * modules/fnmatch (Depends-on): Depend on wchar.
Eric Blake <ebb9@byu.net>
parents: 7758
diff changeset
28 #include <time.h>
b6376840b47b * modules/fnmatch (Depends-on): Depend on wchar.
Eric Blake <ebb9@byu.net>
parents: 7758
diff changeset
29 #include <wchar.h>
13577
d53740f6f336 Modernize AC_TRY_COMPILE invocations.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
30 ]],
d53740f6f336 Modernize AC_TRY_COMPILE invocations.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
31 [[
4976
4df6aeb9a5c5 Fix portability problem with Tru64 and BSD/OS.
Bruno Haible <bruno@clisp.org>
parents: 4108
diff changeset
32 char *p = (char *) mbswidth;
7357
28f050736570 Avoid warning at configure time with "gcc -Wall".
Bruno Haible <bruno@clisp.org>
parents: 6876
diff changeset
33 return !p;
13577
d53740f6f336 Modernize AC_TRY_COMPILE invocations.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
34 ]])],
d53740f6f336 Modernize AC_TRY_COMPILE invocations.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
35 [ac_cv_have_decl_mbswidth=yes],
d53740f6f336 Modernize AC_TRY_COMPILE invocations.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
36 [ac_cv_have_decl_mbswidth=no])])
4976
4df6aeb9a5c5 Fix portability problem with Tru64 and BSD/OS.
Bruno Haible <bruno@clisp.org>
parents: 4108
diff changeset
37 if test $ac_cv_have_decl_mbswidth = yes; then
4df6aeb9a5c5 Fix portability problem with Tru64 and BSD/OS.
Bruno Haible <bruno@clisp.org>
parents: 4108
diff changeset
38 ac_val=1
4df6aeb9a5c5 Fix portability problem with Tru64 and BSD/OS.
Bruno Haible <bruno@clisp.org>
parents: 4108
diff changeset
39 else
4df6aeb9a5c5 Fix portability problem with Tru64 and BSD/OS.
Bruno Haible <bruno@clisp.org>
parents: 4108
diff changeset
40 ac_val=0
4df6aeb9a5c5 Fix portability problem with Tru64 and BSD/OS.
Bruno Haible <bruno@clisp.org>
parents: 4108
diff changeset
41 fi
11007
f6cba5a556ce many *.m4 files: improve m4 quoting
Jim Meyering <meyering@redhat.com>
parents: 10897
diff changeset
42 AC_DEFINE_UNQUOTED([HAVE_DECL_MBSWIDTH_IN_WCHAR_H], [$ac_val],
4976
4df6aeb9a5c5 Fix portability problem with Tru64 and BSD/OS.
Bruno Haible <bruno@clisp.org>
parents: 4108
diff changeset
43 [Define to 1 if you have a declaration of mbswidth() in <wchar.h>, and to 0 otherwise.])
4df6aeb9a5c5 Fix portability problem with Tru64 and BSD/OS.
Bruno Haible <bruno@clisp.org>
parents: 4108
diff changeset
44
3884
6cad2b0cd5ce Reflect name change: s/AC_MBSTATE_T/AC_TYPE_MBSTATE_T.
Jim Meyering <jim@meyering.net>
parents: 3339
diff changeset
45 AC_TYPE_MBSTATE_T
2755
14dcdce94330 *** empty log message ***
Jim Meyering <jim@meyering.net>
parents:
diff changeset
46 ])