Subject: pkg/24543: mail/mutt package can't find wchar.h
To: None <gnats-bugs@gnats.NetBSD.org>
From: Dave Huang <khym@azeotrope.org>
List: netbsd-bugs
Date: 02/23/2004 23:36:14
>Number:         24543
>Category:       pkg
>Synopsis:       mail/mutt package can't find wchar.h
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Feb 24 05:37:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Dave Huang
>Release:        NetBSD 1.6ZK
>Organization:
	
>Environment:
	
	
System: NetBSD fluff.azeotrope.org 1.6ZK NetBSD 1.6ZK (FLUFF) #53: Sat Feb 21 17:17:06 CST 2004 khym@fluff.azeotrope.org:/usr/obj.i386/sys/arch/i386/compile/FLUFF i386
Architecture: i386
Machine: i386
>Description:
	The configure script for mutt 1.4.2 fails to find wchar.h,
which causes it to make up definitions for things like mbstate_t. It
#defines mbstate_t as an int, which is much too small--when a libc
function actually wants to use it, it overflows the buffer and
crashes.

The crash seems to occur on systems where a pointer is larger than an
int, or if LC_CTYPE is set to a multibyte locale, such as en_US.UTF-8.
Apparently, some version of -current is also needed, as its multibyte
support is more developed than that of the 1.6 branch. However,
regardless of CPU or NetBSD version, wchar.h is not found, even though
it exists.

>How-To-Repeat:
	Make the mail/mutt package, and observe this during the
configure process:

checking for wchar.h... no
[ ...]
checking for mbstate_t... no

Then check config.log and see:

configure:7529: checking for wchar.h
configure:7539: gcc -E -I/usr/pkg/include -I/usr/include -I/usr/pkg/include -I/usr/include -I$(top_srcdir)/intl conftest.c >/dev/null 2>conftest.out
top_srcdir: not found
configure: failed program was:
#line 7534 "configure"
#include "confdefs.h"
#include <wchar.h>

What's $(top_srcdir), and why isn't it being expanded out? It's coming
from line 7458 of the configure script, or line 758 of configure.in:

CPPFLAGS="$CPPFLAGS -I\$(top_srcdir)/intl"

>Fix:
	Fix is unknown, as I'm not familiar with autoconf. A
workaround is to simply comment that line out in the configure script.
>Release-Note:
>Audit-Trail:
>Unformatted: