Re: [gdome]removing glib dependence



In message <Pine LNX 4 33 0202131635540 10641-100000 knut anidea com>
          "T.J. Mather" <tjmather tjmather com> wrote:

> I got the e-mail from somebody who is having a hard time installing glib
> on Mac OS X.  I was wondering if we could remove the glib dependence to
> make it easier for people on non-linux platforms to install.  I noticed
> that some of the functions in glib are available in libxml2, and the
> others we could probably rewrite?
>
> Thanks,
> TJ
>
> ---------- Forwarded message ----------
> Date: Wed, 13 Feb 2002 14:32:45 -0500
> From: Nyk Cowham <nyk forumone com>
> To: perl-xml listserv ActiveState com
> Subject: PPM for XML-GDOME?
>
> Hi:
>
> After spending many hours pulling my hair out trying to get GDOME to
> compile on my Mac OS X machine without a great deal of success, I was
> wondering if instead there was a PPM package for ActivePerl available. I
> checked the usual places: http://www.xmlproj.com/PPM and
> http://theoryx5.uwinnipeg.ca/ppmpackages/ but with no luck.
>
> Anyone working on compiling a PPM for ActivePerl? Seems I can only use
> XML-GDOME on Linux at the moment. I would like to use this for the Perl
> binding to JXTA (http://jxtaperl.jxta.org/), but everything must work on
> at least: Linux, ActivePerl, Cygwin, and Mac (OS 9 and OS X). That is a
> pretty tall order, but Perl is a cross-platform environment, right? :)
>
> Also, if anyone has successfully ported the GDOME libraries to OS X I
> would love to hear about it. The problem I have hit on is really with
> the glibs.

Porting GDome2 to RISC OS was something of a daunting prospect because of
the use of GLib. The way I build things for RISC OS is to use *only* the
standard functions provided by the Norcroft compiler. That means standard
C (no unixisms) and very little else. Compiling GLib was a typical example
of trying to wedge something unix-y into RISC OS. It's not easy, generally.
The principles I use on building GLib are 'if it doesn't compile straight
off, ditch it'. Some things just aren't going to work anyhow (a good example
is threading), so losing them isn't a big deal.

Compiling GLib was only the means to make GDome2 compile; I don't really
want to be messing around with it, if possible, so I took shortcuts and
used a few little libraries that I wrote for RISC OS.

One of the things that Norcroft requires is strict typing - if you mix
types, you're going to hit problems because it's not as lax as GCC seems
to be on these things. Another problem I regularly his is that of not
having 'long long'; mostly this can be coded around by just ditching
the relevant code and crossing your fingers (ok, so it's scary to do that,
but I'm not building GDome2 for anything more than testing LibXML2 against
at present). Modern compilers don't have this problem, obviously!

Yet another issue is that of using write/read/open/close. I prefer to use
the FILE * functions, for the simple reason that they're available in the
standard C library that Norcroft provides, where as write/read/open/close
are not. So, these function calls need changing. This is quite aside from
the issue of filenames (which didn't seem to crop up) on RISC OS - the
path separator is a . character; the extension separator is a / character,
although RISC OS doesn't use extensions as anything more than cosmetic
devices - file types numbers are associated with the files to indicate
their contents, rather than extensions.

In one or two places, the were discrepencies between the declarations and
definitions of funtions, which Norcroft throws up as serious errors -
c.gstrfuncs, g_strncasecmp is an example.

alloca to allocate things on the stack is a no-no with Norcroft, so switch
to using malloc instead.

Not having auto-configuration doesn't help porting such things, but it
doesn't make the process much more difficult - you just have to write
the configuration files and makefile yourself which is no real hardship
as it also aids understanding what the code needs to do.

I don't know how different to unix, Mac OS X is, but my experiences with
GLib under RISC OS which has some quite

Of these and other issues, building GLib was interesting, but certainly
not as bad as many other sources. RISC OS /is/ an alien platform, and
needs work.

I hadn't intended to do anything with the glib work, really - it was a
means to an end, but for anyone interested in the compatibility issues,
I've put up a file of diffs to glib 1.13.12 at

 http://homepage.ntlworld.com/justin.fletcher/XML/archives/glib-1.13.12-diffs.zip

along with a Makefile which should indicate the files which have and have
not been built. The zip is only 31k.

-- 
Gerph {djf0-.3w6e2w2.226,6q6w2q2,2.3,2m4}
URL: http://www.movspclr.co.uk/
... Eyes to the heavens, screaming at the sky;
    Trying to send you messages, but choking on goodbye.



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