You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xerces.apache.org by Daniel Lang <dl...@leo.org> on 2000/02/17 16:26:17 UTC

FreeBSD port

Hi,

I just started working with Xerces and I would be _very_
interested in a FreeBSD version. I started some basic (maybe
naive) porting work, like adding to Makefiles, AutoSense, 
fixed a bit in configure.in, runConfigure and adopted
the Platform-Files from Linux. I guess you have done
this stuff, as well.

I ran into serious problems with the Iconv transcoder
(did nothing with ICU, btw), as multibyte-char supports
seems differently on FreeBSD (esp. mbstowcs() acts
very differently than the Linux version, towupper()
and iswspace() may be substituted by toupper() and
isspace(), as they may be able to handle wide-chars
as well (as far as I could tell).
 
I browsed the list-archive to get an impression about the
current status, but the last mails concerning FreeBSD
seem to be from december. 

Please give me a quick update, about your work, and tell me
how I could use it or contribute to it. If necessary
I will subscribe to xerces-dev.

Regards,
 Daniel
-- 
IRCnet: Mr-Spock
     - kommst du siehst du, gehst du hast du, weisst du, krass! -
RL: Daniel Lang * dl@leo.org * +49 89 8540017 * http://www.leo.org/~dl/

Re: FreeBSD port

Posted by Daniel Lang <dl...@leo.org>.
Howdy,

Jonathan McDowell wrote on Thu, Feb 17, 2000 at 10:42:42PM +0000:
[..]
> > towupper() and iswspace() may be substituted by toupper() and
> > isspace(), as they may be able to handle wide-chars as well (as far as
> > I could tell).
> Ah. If they can handle wide-chars then that would solve one of the
> problems I'm having.
Currently, I'm not sure, I'm having a more detailed look at the
source and find, that these function don't use char but 'int',
which seems to conform to ANSI C. Internal they use the _BSD_CT_RUNE_T_
which is in turn an int again. Since int holds 32 bit, it is large
enough to hold wide-chars, as well.... then again, it seems the bits
are used to represent attributes of a 'rune' like beeing uppercase,
lowercase, word, whitespace, etc...
To clearify things, I try to contact a developer...

> What wcs are you using? I'm building under FreeBSD 3.2 and it doesn't
> have one as standard.
I assume this is a wide-char library ? In fact I use none. I run
3.4-STABLE.

[..]
> I've put a bit up at http://www.earth.li/~noodles/programming.html about
> how far I've got. This has also got links to my patch against Xerces
> 1.0.1 and the modified version of David Cross' libwcs that I'm using.
A few comments to your patch:

- Thread handling: in Makefile.incl you specify
  EXTRA_LINK_OPTIONS=-lc -lc_r -lstdc++ -pthread

This is overkill and probably a problem, as well.

libc is the standard non-threaded c-library.
libc_r is the threaded and thread-safe version of libc
only _either_ one should be linked against.

The -pthread switch is special to FreeBSD's gcc and does
nothing else, but linking against -lc_r instead of -lc.

This does not work, you use gcc-2.95.2 from the ports-collection
(as I do, since I need a current c++ compiler, and a libstdc++).

In my approach I just link against -lc_r, and maybe this could
be checked in the autoconf makros, as well.

With FreeBSD 4.0 (which is coming soon) the linuxthreads-port
will build, that provides a libpthread, to map threads on
kernel-schedulable entities. This may then be used as an alternative
to libc_r. Just to keep it in mind. 

Most of your patch is very similar to my work, so far. 

In the Platform-Utils, I ran across timeb.h and ftime()
as well, but I guess it's a bad idea to put effort into something
thats obsolete and replaced by (maybe better but ) surely more
common ways. So for getCurrentMillis() is used it that way:

#include <sys/time.h>

unsigned long XMLPlatformUtils::getCurrentMillis()
{
    struct timeval aTime;
    struct timezone noZone;
    gettimeofday(&aTime, &noZone);
    return (unsigned long)(aTime.tv_sec*1000 + aTime.tv_usec);
}

Note, that the timezone struct is unsused, by I provide it anyway
to avoid any memory corruption. Although it may not be necessary
and passing NULL would be ok. I'm not excperienced enough, to 
make such a guess :-}.

> Current problems are with iswspace/towupper and what I think is a linker
> issue with the sample programs; any light anyone can shed on these would
> be most welcome.
Ok, altough my main problem seems to be mbstowcs(). I keep you
up to date.

Regards,
 Daniel
-- 
IRCnet: Mr-Spock     - Cool people don't move, they just hang around. -  
RL: Daniel Lang * dl@leo.org * +49 89 8540017 * http://www.leo.org/~dl/

Re: FreeBSD port

Posted by Jonathan McDowell <no...@earth.li>.
On Thu, Feb 17, 2000 at 03:26:17PM +0000, Daniel Lang wrote:

> I just started working with Xerces and I would be _very_ interested in
> a FreeBSD version. I started some basic (maybe naive) porting work,
> like adding to Makefiles, AutoSense, fixed a bit in configure.in,
> runConfigure and adopted the Platform-Files from Linux. I guess you
> have done this stuff, as well.

Yup.

> I ran into serious problems with the Iconv transcoder (did nothing
> with ICU, btw), as multibyte-char supports seems differently on
> FreeBSD (esp. mbstowcs() acts very differently than the Linux version,
> towupper() and iswspace() may be substituted by toupper() and
> isspace(), as they may be able to handle wide-chars as well (as far as
> I could tell).

Ah. If they can handle wide-chars then that would solve one of the
problems I'm having.

What wcs are you using? I'm building under FreeBSD 3.2 and it doesn't
have one as standard.

> Please give me a quick update, about your work, and tell me how I
> could use it or contribute to it. If necessary I will subscribe to
> xerces-dev.

I've put a bit up at http://www.earth.li/~noodles/programming.html about
how far I've got. This has also got links to my patch against Xerces
1.0.1 and the modified version of David Cross' libwcs that I'm using.

Current problems are with iswspace/towupper and what I think is a linker
issue with the sample programs; any light anyone can shed on these would
be most welcome.

J.

-- 
Programmer, |   Every bug you find is the last    | Tel/SMS (Orange):
student and |                one.                 |  +44-7974-678646
BHMF.       |                                     | Made by HuggieTag