bug-gnulib
[Top][All Lists]
Advanced

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

Minix support, part 3


From: Bruno Haible
Subject: Minix support, part 3
Date: Sun, 31 Jul 2011 17:06:41 +0200
User-agent: KMail/1.13.6 (Linux/2.6.37.6-0.5-desktop; KDE/4.6.0; x86_64; ; )

The first file to be compiled already gives a compilation error:

source='allocator.c' object='allocator.o' libtool=no  DEPDIR=.deps depmode=none 
/bin/sh ../build-aux/depcomp  cc -DHAVE_CONFIG_H -I. -I..  
-DGNULIB_STRICT_CHECKING=1    -g -c -o allocator.o allocator.c
"./wchar.h", line 494: redeclaration of mbsinit with different type
"./wchar.h", line 522: redeclaration of mbrtowc with different type
"./wchar.h", line 548: redeclaration of mbrlen with different type
"./wchar.h", line 579: redeclaration of mbsrtowcs with different type
"./wchar.h", line 641: redeclaration of wcrtomb with different type
"./wchar.h", line 672: redeclaration of wcsrtombs with different type
*** Error code 1

The reason is that Minix <wchar.h> declares these 6 functions, although
they are not defined in libc.a.

I'm adding this workaround:


2011-07-31  Bruno Haible  <address@hidden>

        Work around declaration collisions on Minix.
        * m4/mbsinit.m4 (gl_FUNC_MBSINIT): If mbsinit is declared but not
        defined, set REPLACE_MBSINIT.
        * m4/mbrtowc.m4 (gl_FUNC_MBRTOWC): If mbrtowc is declared but not
        defined, set REPLACE_MBRTOWC.
        * m4/mbrlen.m4 (gl_FUNC_MBRLEN): If mbrlen is declared but not defined,
        set REPLACE_MBRLEN.
        * m4/mbsrtowcs.m4 (gl_FUNC_MBSRTOWCS): If mbsrtowcs is declared but not
        defined, set REPLACE_MBSRTOWCS.
        * m4/wcrtomb.m4 (gl_FUNC_WCRTOMB): If wcrtomb is declared but not
        defined, set REPLACE_WCRTOMB.
        * m4/wcsrtombs.m4 (gl_FUNC_WCSRTOMBS): If wcsrtombs is declared but not
        defined, set REPLACE_WCSRTOMBS.

--- m4/mbrlen.m4.orig   Sun Jul 31 17:01:49 2011
+++ m4/mbrlen.m4        Sun Jul 31 15:00:08 2011
@@ -1,4 +1,4 @@
-# mbrlen.m4 serial 7
+# mbrlen.m4 serial 8
 dnl Copyright (C) 2008, 2010-2011 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,6 +13,22 @@
   AC_CHECK_FUNCS_ONCE([mbrlen])
   if test $ac_cv_func_mbrlen = no; then
     HAVE_MBRLEN=0
+    AC_CHECK_DECLS([mbrlen],,, [[
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+]])
+    if test $ac_cv_have_decl_mbrlen = yes; then
+      dnl On Minix 3.1.8, the system's <wchar.h> declares mbrlen() although
+      dnl it does not have the function. Avoid a collision with gnulib's
+      dnl replacement.
+      REPLACE_MBRLEN=1
+    fi
   else
     dnl Most bugs affecting the system's mbrtowc function also affect the
     dnl mbrlen function. So override mbrlen whenever mbrtowc is overridden.
--- m4/mbrtowc.m4.orig  Sun Jul 31 17:01:49 2011
+++ m4/mbrtowc.m4       Sun Jul 31 15:00:08 2011
@@ -1,4 +1,4 @@
-# mbrtowc.m4 serial 24
+# mbrtowc.m4 serial 25
 dnl Copyright (C) 2001-2002, 2004-2005, 2008-2011 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
@@ -15,6 +15,22 @@
   AC_CHECK_FUNCS_ONCE([mbrtowc])
   if test $ac_cv_func_mbrtowc = no; then
     HAVE_MBRTOWC=0
+    AC_CHECK_DECLS([mbrtowc],,, [[
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+]])
+    if test $ac_cv_have_decl_mbrtowc = yes; then
+      dnl On Minix 3.1.8, the system's <wchar.h> declares mbrtowc() although
+      dnl it does not have the function. Avoid a collision with gnulib's
+      dnl replacement.
+      REPLACE_MBRTOWC=1
+    fi
   else
     if test $REPLACE_MBSTATE_T = 1; then
       REPLACE_MBRTOWC=1
--- m4/mbsinit.m4.orig  Sun Jul 31 17:01:49 2011
+++ m4/mbsinit.m4       Sun Jul 31 15:00:07 2011
@@ -1,4 +1,4 @@
-# mbsinit.m4 serial 7
+# mbsinit.m4 serial 8
 dnl Copyright (C) 2008, 2010-2011 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -15,6 +15,22 @@
   AC_CHECK_FUNCS_ONCE([mbsinit])
   if test $ac_cv_func_mbsinit = no; then
     HAVE_MBSINIT=0
+    AC_CHECK_DECLS([mbsinit],,, [[
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+]])
+    if test $ac_cv_have_decl_mbsinit = yes; then
+      dnl On Minix 3.1.8, the system's <wchar.h> declares mbsinit() although
+      dnl it does not have the function. Avoid a collision with gnulib's
+      dnl replacement.
+      REPLACE_MBSINIT=1
+    fi
   else
     if test $REPLACE_MBSTATE_T = 1; then
       REPLACE_MBSINIT=1
--- m4/mbsrtowcs.m4.orig        Sun Jul 31 17:01:49 2011
+++ m4/mbsrtowcs.m4     Sun Jul 31 15:00:08 2011
@@ -1,4 +1,4 @@
-# mbsrtowcs.m4 serial 12
+# mbsrtowcs.m4 serial 13
 dnl Copyright (C) 2008-2011 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -14,6 +14,22 @@
   AC_CHECK_FUNCS_ONCE([mbsrtowcs])
   if test $ac_cv_func_mbsrtowcs = no; then
     HAVE_MBSRTOWCS=0
+    AC_CHECK_DECLS([mbsrtowcs],,, [[
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+]])
+    if test $ac_cv_have_decl_mbsrtowcs = yes; then
+      dnl On Minix 3.1.8, the system's <wchar.h> declares mbsrtowcs() although
+      dnl it does not have the function. Avoid a collision with gnulib's
+      dnl replacement.
+      REPLACE_MBSRTOWCS=1
+    fi
   else
     if test $REPLACE_MBSTATE_T = 1; then
       REPLACE_MBSRTOWCS=1
--- m4/wcrtomb.m4.orig  Sun Jul 31 17:01:49 2011
+++ m4/wcrtomb.m4       Sun Jul 31 15:00:08 2011
@@ -1,4 +1,4 @@
-# wcrtomb.m4 serial 10
+# wcrtomb.m4 serial 11
 dnl Copyright (C) 2008-2011 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -14,6 +14,22 @@
   AC_CHECK_FUNCS_ONCE([wcrtomb])
   if test $ac_cv_func_wcrtomb = no; then
     HAVE_WCRTOMB=0
+    AC_CHECK_DECLS([wcrtomb],,, [[
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+]])
+    if test $ac_cv_have_decl_wcrtomb = yes; then
+      dnl On Minix 3.1.8, the system's <wchar.h> declares wcrtomb() although
+      dnl it does not have the function. Avoid a collision with gnulib's
+      dnl replacement.
+      REPLACE_WCRTOMB=1
+    fi
   else
     if test $REPLACE_MBSTATE_T = 1; then
       REPLACE_WCRTOMB=1
--- m4/wcsrtombs.m4.orig        Sun Jul 31 17:01:49 2011
+++ m4/wcsrtombs.m4     Sun Jul 31 16:31:54 2011
@@ -1,4 +1,4 @@
-# wcsrtombs.m4 serial 10
+# wcsrtombs.m4 serial 11
 dnl Copyright (C) 2008-2011 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -14,6 +14,22 @@
   AC_CHECK_FUNCS_ONCE([wcsrtombs])
   if test $ac_cv_func_wcsrtombs = no; then
     HAVE_WCSRTOMBS=0
+    AC_CHECK_DECLS([wcsrtombs],,, [[
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+]])
+    if test $ac_cv_have_decl_wcsrtombs = yes; then
+      dnl On Minix 3.1.8, the system's <wchar.h> declares wcsrtombs() although
+      dnl it does not have the function. Avoid a collision with gnulib's
+      dnl replacement.
+      REPLACE_WCSRTOMBS=1
+    fi
   else
     if test $REPLACE_MBSTATE_T = 1; then
       REPLACE_WCSRTOMBS=1

-- 
In memoriam Jean Jaurès <http://en.wikipedia.org/wiki/Jean_Jaurès>



reply via email to

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