[Top][All Lists]

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

[bug-libunistring] Re: gnulib integration

From: Bruno Haible
Subject: [bug-libunistring] Re: gnulib integration
Date: Tue, 14 Sep 2010 13:32:55 +0200
User-agent: KMail/1.9.9

Hi Pádraig,

> When I was first testing
> it I noticed that once I used gl_LIBUNISTRING
> then I needed to link printf with libunistring to
> get u8_uctomb_aux

This is normal and expected. gl_LIBUNISTRING is the macro of the
'libunistring' modules, and this module description specifies:

  $(LTLIBUNISTRING) when linking with libtool, $(LIBUNISTRING) otherwise

So, you need to link every coreutils program that uses the <unistr.h> or
similar include files with $(LIBUNISTRING).

> I noticed that unistr.h 
> was not generated by gnulib, and instead the
> libunistring version was used.
> In recent testing (probably since support for
> libunistring-optional was added?) unistr.h is
> now generated by gnulib even in the case when
> using libunistring.

Yes, these mechanics changed a lot when the 'libunistring-optional'
module was introduced. The principle holds, though, that when you use
the contents of a module, you also have to honor the contents of the
'Link:' field of the module description.

> Now I have the additional "issue" that I must
> include the unistr/u8-mbtouc-unsafe module
> if I want to use that function in my code.

I'm not sure I understand the issue.

When you use the 'libunistring' module, you should be able to use
any functionality from libunistring without asking for gnulib modules.
But then you need to conditionalize these uses upon
(unless you make libunistring an explicit prerequisite of coreutils).

When you use the 'libunistring-optional' module, you can use any
functionality of libunistring, even on platforms where no libunistring
is installed, but you have to ask for the corresponding gnulib module
so that the source code is included.

In which case are you, and what steps would allow me to reproduce
the problem you saw?

> The existing unicodeio module requiring linking
> with libunistring for u8_uctomb_aux issue still exists.

It is documented in the 'Link:' section of the modules/unicodeio
module description.

> So in summary, is the required inclusion of the
> unistr/u8-mbtouc-unsafe module expected,

If you use the u8_mbtouc_unsafe function and the 'libunistring-optional'
module, then yes, you need to request the 'unistr/u8-mbtouc-unsafe' module.
If not, then not. And the 'unicodeio' modules does not use u8_mbtouc_unsafe.

> and is there a way to get unicodeio to use
> the gnulib version of u8_uctomb_aux?

Again, I'm not sure I understand. Do you mean you want to use
'libunistring-optional' but you deem that for the 'u8_uctomb_aux'
function you don't want to use it?


reply via email to

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