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

Re: [Xen-devel] [PATCH 3 of 5] blktap2: fix vhd compilation under uclibc



2011/12/19 Ian Campbell <Ian.Campbell@xxxxxxxxxx>:
> On Mon, 2011-12-19 at 13:30 +0000, Roger Pau Monnà wrote:
>> 2011/12/19 Ian Campbell <Ian.Campbell@xxxxxxxxxx>:
>> > On Mon, 2011-12-19 at 12:30 +0000, Roger Pau Monnà wrote:
>> >> What's strange is that libvhd (which uses iconv) compiles and links
>> >> fine,
>> >
>> > libvhd needs -liconv but it will compile and link without it fine. It is
>> > only when you try to link something against that library that the
>> > problem will manifest itself.
>> >
>> >> Âbut vhd-util that uses libvhd complains about undefined
>> >> references to iconv, when vhd-util doesn't use iconv.
>> >
>> > Right.
>> >
>> > Ian.
>>
>> I have a expression that checks for libiconv, but it will only detect
>> it if ldconfig is present, if the system doesn't have ldconfig
>> (NetBSD), libiconv will not be detected even if it is present:
>>
>> which ldconfig 2>&1 >/dev/null && (ldconfig -p | grep -q libiconv &&
>> echo 'y' || echo 'n') || echo 'n'
>
> Urgh, surely there's a better way!
>
> Perhaps grepping for LIBICONV_PLUG or libiconv_open or something unique
> in iconv.h would be better?

grep -q LIBICONV_PLUG /usr/include/iconv.h && echo 'y' || echo 'n'

Does the job, but I don't know how reliable it is to rely on
LIBICONV_PLUG. Tested on NetBSD, Debian 6.0.3 and Alpine 2.3.2 with
success.

> BTW did you try defining LIBICONV_PLUG?

LIBICONV_PLUG should not be defined, because that prevents iconv from
defining iconv_open, iconv_close... as alias to libiconv_open,
libiconv_close... and libvhd uses this functions.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.