bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

mbstate_t on HP-UX 11.11


From: Bruno Haible
Subject: mbstate_t on HP-UX 11.11
Date: Sat, 20 Dec 2008 13:43:11 +0100
User-agent: KMail/1.9.9

On HP-UX 11.11, mbstate_t is not defined by <wchar.h> unless _XOPEN_SOURCE is
set to 500. (Even when _HPUX_SOURCE is set!)

I have submitted a patch so that autoconf sets this flag by default. But there
are so many INSTALL files which only recommend CC="cc -Ae", that IMO this
needs to be handled by the gnulib 'extensions' module as well. Therefore I'm
committing this:


2008-12-20  Bruno Haible  <address@hidden>

        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.

--- m4/extensions.m4.orig       2008-12-20 13:38:26.000000000 +0100
+++ m4/extensions.m4    2008-12-20 13:25:43.000000000 +0100
@@ -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_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 @@
       [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
--- m4/mbstate_t.m4.orig        2008-12-20 13:38:26.000000000 +0100
+++ m4/mbstate_t.m4     2008-12-20 13:28:24.000000000 +0100
@@ -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 @@
 # 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 @@
    else
      AC_DEFINE([mbstate_t], int,
               [Define to a type if <wchar.h> does not define.])
-   fi])
+   fi
+])
--- modules/fnmatch.orig        2008-12-20 13:38:26.000000000 +0100
+++ modules/fnmatch     2008-12-20 13:29:36.000000000 +0100
@@ -16,6 +16,7 @@
 wctype
 memchr
 memcmp
+extensions
 
 configure.ac:
 # No macro. You should also use one of fnmatch-posix or fnmatch-gnu.
--- modules/mbrlen.orig 2008-12-20 13:38:26.000000000 +0100
+++ modules/mbrlen      2008-12-20 13:29:21.000000000 +0100
@@ -9,6 +9,7 @@
 Depends-on:
 wchar
 mbrtowc
+extensions
 
 configure.ac:
 gl_FUNC_MBRLEN
--- modules/mbrtowc.orig        2008-12-20 13:38:26.000000000 +0100
+++ modules/mbrtowc     2008-12-20 13:29:15.000000000 +0100
@@ -11,6 +11,7 @@
 localcharset
 streq
 verify
+extensions
 
 configure.ac:
 gl_FUNC_MBRTOWC
--- modules/mbsinit.orig        2008-12-20 13:38:26.000000000 +0100
+++ modules/mbsinit     2008-12-20 13:29:11.000000000 +0100
@@ -9,6 +9,7 @@
 Depends-on:
 wchar
 verify
+extensions
 
 configure.ac:
 gl_FUNC_MBSINIT
--- modules/mbsrtowcs.orig      2008-12-20 13:38:26.000000000 +0100
+++ modules/mbsrtowcs   2008-12-20 13:29:32.000000000 +0100
@@ -11,6 +11,7 @@
 wchar
 mbrtowc
 strnlen1
+extensions
 
 configure.ac:
 gl_FUNC_MBSRTOWCS
--- modules/mbswidth.orig       2008-12-20 13:38:26.000000000 +0100
+++ modules/mbswidth    2008-12-20 13:29:25.000000000 +0100
@@ -12,6 +12,7 @@
 wchar
 wctype
 wcwidth
+extensions
 
 configure.ac:
 gl_MBSWIDTH
--- modules/quotearg.orig       2008-12-20 13:38:26.000000000 +0100
+++ modules/quotearg    2008-12-20 13:29:53.000000000 +0100
@@ -9,6 +9,7 @@
 m4/quotearg.m4
 
 Depends-on:
+extensions
 gettext-h
 memcmp
 stdbool
--- modules/strftime.orig       2008-12-20 13:38:26.000000000 +0100
+++ modules/strftime    2008-12-20 13:29:47.000000000 +0100
@@ -9,6 +9,7 @@
 m4/strftime.m4
 
 Depends-on:
+extensions
 stdbool
 time_r
 wchar




reply via email to

[Prev in Thread] Current Thread [Next in Thread]