bug-m4
[Top][All Lists]
Advanced

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

Re: Building m4 on BSDI 4.0.1


From: Eric Blake
Subject: Re: Building m4 on BSDI 4.0.1
Date: Wed, 10 Jan 2007 06:45:55 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.9) Gecko/20061207 Thunderbird/1.5.0.9 Mnenhy/0.7.4.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Chris McGuire on 1/9/2007 9:26 PM:
> > It looks like the following gnulib patch is needed.  Chris, can you
> > confirm one last thing?  Check that the following compiles for you (gcc -c
> > file.c), but that when you comment out the line with <stddef.h>, that the
> > compile fails:
> >
> > /* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>.
> >   Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included
before
> >   <wchar.h>.
> >   BSD/OS 4.1 has a bug: <stdio.h> and <time.h> must be included before
> >   <wchar.h>.
> >   BSDI 4.0.1 has a bug: <stddef.h> must be included before <wchar.h>.
> >  */
> > # include <stddef.h>
> > # include <stdio.h>
> > # include <time.h>
> > # include <wchar.h>
> > wchar_t w;
>

> Eric,
>
> Yes, it did compile. But as you expected, when I remove <stddef.h> it
fails with the following output:
>
> In file included from file.c:10:
> /usr/include/wchar.h:16: syntax error before `*'
...


According to Chris McGuire on 1/9/2007 9:20 PM:
> Thanks Eric, it failed...here's the output for you to investigate:
> 
> ./configure
...
> checking wchar.h usability... yes
> checking wchar.h presence... yes
> checking for wchar.h... yes

Hmm - does AC_CHECK_HEADERS_ONCE cumulatively remember all previously
checked headers?  Otherwise, I can't explain why this portion claims
wchar.h works when we have already established that it is not standalone
on your platform.

> checking wctype.h usability... no
> checking wctype.h presence... no
> checking for wctype.h... no
...
> checking for wchar_t... yes
> checking for wint_t... no

Oops - you already proved that wchar.h DOES define wint_t and wctype_t,
just not wchar_t.  The patch below fixes that.

> checking for bit size of wchar_t... 32
> checking for bit size of wint_t... 32

Odd.  How come this check seemed to find wint_t?

> 
> gmake

Have you considered using the native make, rather than gmake, to help
exercise the potential portability issues in the Makefile?  However, if
native make fails, I am not in the mood to figure out the workarounds for
it, since it is an obsolete version and you have a working gmake.

...
> rm -f wctype.h-t wctype.h
> { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
>           sed -e 's/@''HAVE_WCTYPE_H''@/0/g' \
>               -e 's|@''ABSOLUTE_WCTYPE_H''@|"no/such/file/wctype.h"|g' \
>               -e 's/@''HAVE_WCTYPE_CTMP_BUG''@//g' \
>               -e 's/@''HAVE_WINT_T''@//g' \
>               < ./wctype_.h; \
>         } > wctype.h-t
> mv wctype.h-t wctype.h

Ahh - here we go.  My earlier patch fails, because it was guarded by
HAVE_WINT_T, but your configure output showed that we guessed that bit
wrong.  By the way, the config.log file produced by configure is generally
more useful than the captured output of configure (albeit longer, so it is
often worth compressing it before sending it to a mailing list).

I'm installing the following to gnulib, at which point I'll regenerate
another M4 private snapshot for Chris to try.

2007-01-10  Eric Blake  <address@hidden>

        * lib/wctype_.h [HAVE_WINT_T]: Include <stddef.h> before
        <wchar.h>, to work around BSDI bug in BSD/OS 4.0.1.
        * m4/wcwidth.m4 (gl_FUNC_WCWIDTH): Likewise.
        * m4/wint_t.m4 (gt_TYPE_WINT_T): Likewise.
        Reported by Chris McGuire.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFpO4S84KuGfSFAYARAuT8AKCAI/3uPTGt5LM72DpRgsMV1VFefACgiawy
ogsdGfnnN0QF8IykO0Nq0F0=
=Qxre
-----END PGP SIGNATURE-----
Index: lib/wctype_.h
===================================================================
RCS file: /sources/gnulib/gnulib/lib/wctype_.h,v
retrieving revision 1.5
diff -u -p -r1.5 wctype_.h
--- lib/wctype_.h       6 Jan 2007 00:27:48 -0000       1.5
+++ lib/wctype_.h       10 Jan 2007 13:32:51 -0000
@@ -1,6 +1,6 @@
 /* A substitute for ISO C99 <wctype.h>, for platforms that lack it.
 
-   Copyright (C) 2006 Free Software Foundation, Inc.
+   Copyright (C) 2006, 2007 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -33,8 +33,9 @@
 /* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>.
    Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
    <wchar.h>.
-   BSD/OS 4.1 has a bug: <stdio.h> and <time.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>
Index: m4/wint_t.m4
===================================================================
RCS file: /sources/gnulib/gnulib/m4/wint_t.m4,v
retrieving revision 1.3
diff -u -p -r1.3 wint_t.m4
--- m4/wint_t.m4        18 Jan 2005 13:07:56 -0000      1.3
+++ m4/wint_t.m4        10 Jan 2007 13:32:51 -0000
@@ -1,5 +1,5 @@
-# wint_t.m4 serial 1 (gettext-0.12)
-dnl Copyright (C) 2003 Free Software Foundation, Inc.
+# wint_t.m4 serial 2 (gettext-0.12)
+dnl Copyright (C) 2003, 2007 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -11,7 +11,15 @@ dnl Prerequisite: AC_PROG_CC
 AC_DEFUN([gt_TYPE_WINT_T],
 [
   AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t,
-    [AC_TRY_COMPILE([#include <wchar.h>
+    [AC_TRY_COMPILE([
+/* 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>
        wint_t foo = (wchar_t)'\0';], ,
        gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)])
   if test $gt_cv_c_wint_t = yes; then
Index: m4/wcwidth.m4
===================================================================
RCS file: /sources/gnulib/gnulib/m4/wcwidth.m4,v
retrieving revision 1.7
diff -u -p -r1.7 wcwidth.m4
--- m4/wcwidth.m4       27 Dec 2006 19:54:25 -0000      1.7
+++ m4/wcwidth.m4       10 Jan 2007 13:32:51 -0000
@@ -1,5 +1,5 @@
-# wcwidth.m4 serial 6
-dnl Copyright (C) 2006 Free Software Foundation, Inc.
+# wcwidth.m4 serial 7
+dnl Copyright (C) 2006, 2007 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -22,8 +22,9 @@ AC_DEFUN([gl_FUNC_WCWIDTH],
 #if HAVE_WCHAR_H
 /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
    <wchar.h>.
-   BSD/OS 4.1 has a bug: <stdio.h> and <time.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>

reply via email to

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