Ensure mbstate_t is defined on HP-UX 11.11.
authorBruno Haible <bruno@clisp.org>
Sat, 20 Dec 2008 12:43:27 +0000 (13:43 +0100)
committerBruno Haible <bruno@clisp.org>
Sat, 20 Dec 2008 12:43:27 +0000 (13:43 +0100)
ChangeLog
m4/extensions.m4
m4/mbstate_t.m4
modules/fnmatch
modules/mbrlen
modules/mbrtowc
modules/mbsinit
modules/mbsrtowcs
modules/mbswidth
modules/quotearg
modules/strftime

index ecc957b..b64554b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,21 @@
 2008-12-20  Bruno Haible  <bruno@clisp.org>
 
+       Ensure mbstate_t is defined on HP-UX 11.11.
+       * m4/extensions.m4 (AC_USE_SYSTEM_EXTENSIONS): Require
+       AC_CANONICAL_HOST. On HP-UX, define _XOPEN_SOURCE to 500.
+       * m4/mbstate_t.m4 (AC_TYPE_MBSTATE_T): Require
+       AC_USE_SYSTEM_EXTENSIONS.
+       * modules/fnmatch (Depends-on): Add extensions.
+       * modules/mbrlen (Depends-on): Likewise.
+       * modules/mbrtowc (Depends-on): Likewise.
+       * modules/mbsinit (Depends-on): Likewise.
+       * modules/mbsrtowcs (Depends-on): Likewise.
+       * modules/mbswidth (Depends-on): Likewise.
+       * modules/quotearg (Depends-on): Likewise.
+       * modules/strftime (Depends-on): Likewise.
+
+2008-12-20  Bruno Haible  <bruno@clisp.org>
+
        Ensure wctob is declared on IRIX 6.5.
        * lib/wchar.in.h (wctob): Declare also when HAVE_DECL_WCTOB is 0.
        * m4/wctob.m4 (gl_FUNC_WCTOB): Set HAVE_DECL_WCTOB instead of
index 917af94..611fcfd 100644 (file)
@@ -1,4 +1,4 @@
-# serial 5  -*- Autoconf -*-
+# serial 6  -*- Autoconf -*-
 # Enable extensions on systems that normally disable them.
 
 # Copyright (C) 2003, 2006-2008 Free Software Foundation, Inc.
@@ -24,6 +24,8 @@ AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
 [AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
 AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
 
+  AC_REQUIRE([AC_CANONICAL_HOST])
+
   AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=])
   if test "$MINIX" = yes; then
     AC_DEFINE([_POSIX_SOURCE], [1],
@@ -36,6 +38,16 @@ AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
       [Define to 1 if on MINIX.])
   fi
 
+  dnl HP-UX 11.11 defines mbstate_t only if _XOPEN_SOURCE is defined to 500,
+  dnl regardless of whether the flags -Ae or _D_HPUX_SOURCE=1 are already
+  dnl provided.
+  case "$host_os" in
+    hpux*)
+      AC_DEFINE([_XOPEN_SOURCE], [500],
+        [Define to 500 only on HP-UX.])
+      ;;
+  esac
+
   AH_VERBATIM([__EXTENSIONS__],
 [/* Enable extensions on AIX 3, Interix.  */
 #ifndef _ALL_SOURCE
index 0da32b6..d2153d9 100644 (file)
@@ -1,4 +1,4 @@
-# mbstate_t.m4 serial 10
+# mbstate_t.m4 serial 11
 dnl Copyright (C) 2000-2002, 2008 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -13,7 +13,10 @@ dnl with or without modifications, as long as this notice is preserved.
 # AC_TYPE_MBSTATE_T
 # -----------------
 AC_DEFUN([AC_TYPE_MBSTATE_T],
-  [AC_CACHE_CHECK([for mbstate_t], ac_cv_type_mbstate_t,
+[
+   AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) dnl for HP-UX 11.11
+
+   AC_CACHE_CHECK([for mbstate_t], ac_cv_type_mbstate_t,
      [AC_COMPILE_IFELSE(
        [AC_LANG_PROGRAM(
           [AC_INCLUDES_DEFAULT[
@@ -27,4 +30,5 @@ AC_DEFUN([AC_TYPE_MBSTATE_T],
    else
      AC_DEFINE([mbstate_t], int,
               [Define to a type if <wchar.h> does not define.])
-   fi])
+   fi
+])
index 3187a7d..def7040 100644 (file)
@@ -16,6 +16,7 @@ wchar
 wctype
 memchr
 memcmp
+extensions
 
 configure.ac:
 # No macro. You should also use one of fnmatch-posix or fnmatch-gnu.
index cbd48d1..e7f3673 100644 (file)
@@ -9,6 +9,7 @@ m4/mbstate_t.m4
 Depends-on:
 wchar
 mbrtowc
+extensions
 
 configure.ac:
 gl_FUNC_MBRLEN
index be1ff35..c17fbd5 100644 (file)
@@ -11,6 +11,7 @@ wchar
 localcharset
 streq
 verify
+extensions
 
 configure.ac:
 gl_FUNC_MBRTOWC
index 173adf2..3f7cc37 100644 (file)
@@ -9,6 +9,7 @@ m4/mbstate_t.m4
 Depends-on:
 wchar
 verify
+extensions
 
 configure.ac:
 gl_FUNC_MBSINIT
index 4707e80..c28f42e 100644 (file)
@@ -3,6 +3,7 @@ mbsrtowcs() function: convert string to wide string.
 
 Files:
 lib/mbsrtowcs.c
+lib/mbsrtowcs-state.c
 m4/mbsrtowcs.m4
 m4/mbstate_t.m4
 
@@ -10,6 +11,7 @@ Depends-on:
 wchar
 mbrtowc
 strnlen1
+extensions
 
 configure.ac:
 gl_FUNC_MBSRTOWCS
index b6ec4c4..6094ef6 100644 (file)
@@ -12,6 +12,7 @@ Depends-on:
 wchar
 wctype
 wcwidth
+extensions
 
 configure.ac:
 gl_MBSWIDTH
index 09524fe..9a2245f 100644 (file)
@@ -9,6 +9,7 @@ m4/mbrtowc.m4
 m4/quotearg.m4
 
 Depends-on:
+extensions
 gettext-h
 memcmp
 stdbool
index e414737..cc45452 100644 (file)
@@ -9,6 +9,7 @@ m4/tm_gmtoff.m4
 m4/strftime.m4
 
 Depends-on:
+extensions
 stdbool
 time_r
 wchar