Bug 4981 - iconv confusion
Summary: iconv confusion
Alias: None
Product: rsync
Classification: Unclassified
Component: core (show other bugs)
Version: 3.0.0
Hardware: PPC Mac OS X
: P3 normal (vote)
Target Milestone: ---
Assignee: Wayne Davison
QA Contact: Rsync QA Contact
Depends on:
Reported: 2007-09-18 11:55 UTC by Joe Holt
Modified: 2008-07-26 10:14 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Joe Holt 2007-09-18 11:55:05 UTC
cvs root doesn't build for me, and it appears to be on account of some confusion in configure and in the code regarding the iconv library.

The make dies with:

gcc -std=gnu99 -g -O2 -DMAINTAINER_MODE -DHAVE_CONFIG_H -Wall -W -I./popt  -o mkrounding -I. ./mkrounding.c
In file included from ./rsync.h:839,
                 from ./mkrounding.c:20:
./proto.h:258: error: parse error before 'ic'

proto.h:258 is:

int iconvbufs(iconv_t ic, xbuf *in, xbuf *out, int flags);

Apparently iconv_t isn't getting defined. iconv_t is part of the iconv library and iconv.h. In rsync.h:368 iconv.h is conditionalized by this line:

#if defined HAVE_ICONV_OPEN && defined HAVE_ICONV_H
#include <iconv.h>

After a little experimentation I discovered that HAVE_ICONV_OPEN on my configuration is undefined. I tried tracing through the configuration files but I don't understand the logic behind the setting of HAVE_ICONV_OPEN. It's my understanding that iconv_open is part and parcel of the iconv library, and I don't understand why a test needs to be made. However configure.in hints at "Solaris and HP-UX weirdness"(?)

To temporarily work around this build problem I reconfigured with --disable-iconv, but since the offending line in proto.h isn't conditionalized it still fails, but for a different reason.

So two problems:

1. cvs root isn't building on OS X due to HAVE_ICONV_OPEN not being set. But iconv_open() exists, so maybe there's a problem with the configuration tests.

2. Attempting to disable iconv support via --disable-iconv fails because some parts of the code are not conditionalized. I came across proto.h:258 and flist.c:1649 (filesfrom_convert). There are probably others.
Comment 1 Wayne Davison 2007-09-18 14:06:51 UTC
I checked in some fixes to get the non-iconv code working again.

If you know a way to do iconv conversions on a mac, let me know.  If not, I may check into it before too long.