Re: [libxml++] patch to allow building without glibmm



On Thu, 2005-10-27 at 02:47 +0200, Vadim Zeitlin wrote:
>  Hello,
> 
>  I've searched this list archives for the reasons as to why libxml++
> requires glibmm when it would seem that it hardly uses any of its
> functionality but couldn't find any real answer. Sorry if I missed
> something but to me it looks that std::string could be used instead of
> Glib::ustring just as well: indeed, I've even seen in the archives a
> suggestion to typedef Glib::ustring as std::string instead of using the
> real class. Unfortunately, it's not quite that simple as in a few places
> Glib::ustring::bytes() is used and std::string doesn't have (nor need) this
> method. Also, I wanted to have a clean way to build libxml++ without glibmm
> and so I've created the attached patch to do it.

Sounds OK, though I don't think many people will really need it.

>  The patch is rather short so you can probably read it quicker than I can
> explain it, but nevertheless here is the summary:
> 
> 1. add --without-ustring configure option (off by default), when it is used
>    the (new) stub file libxml++/glibmm/ustring.h is used instead of the real
>    one

I'd prefer not to include a different filename. I wouldn't want some
people to think that the dummy implementation there is actually the real
ustring.

> 2. define LIBXML_USE_STD_STRING when this option is used, this can be also
>    used by MSVC users to build without glibmm under Windows
> 3. use LIBXML_USE_STD_STRING in a few places in the code to select between
>    Glib::ustring::bytes() and std::string::size(): this is a bit ugly, of
>    course, but the only other alternatives are to either derive
>    Glib::ustring from std::string or to define some STRING_BYTES() macro
>    and both of them have their problems as well -- but if it would be
>    preferrable to do it like this, please let me know and I'll redo the
>    patch
> 4. updated the docs to mention the changes above (not sure if the file
>    docs/manual/libxml++_without_code.xml is the right one to update, again,
>    please let me know if it isn't and I'll redo it)
> 
> 
>  I sincerely hope this patch can be applied as it makes building the
> library on non-Linux systems (even other Unices such as Darwin or HP-UX,
> IRIX, ... are problematic without speaking about building glibmm and all
> its dependencies under Windows)

There is an installer for Windows (I think it even includes libxml++
now). And glibmm (and gtkmm) build on almost all Unixes, even with the
proprietary compilers. TheWrittenWord.com provide binary packages.

Could you put the patch in bugzilla, please?

Murray





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