Subject: pkg/24543: mail/mutt package can't find wchar.h
To: None <>
From: Dave Huang <>
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
>Originator:     Dave Huang
>Release:        NetBSD 1.6ZK
System: NetBSD 1.6ZK NetBSD 1.6ZK (FLUFF) #53: Sat Feb 21 17:17:06 CST 2004 i386
Architecture: i386
Machine: i386
	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

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.

	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

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

	Fix is unknown, as I'm not familiar with autoconf. A
workaround is to simply comment that line out in the configure script.