Porting to RISC OS

David Relson relson at osagesoftware.com
Sat Sep 6 01:59:09 CEST 2003


Hi Stefan,

You've been busy!

On Sat, 06 Sep 2003 01:13:42 +0200
Stefan Bellon <sbellon at sbellon.de> wrote:

> David Relson wrote:
> > On Fri, 05 Sep 2003 20:20:19 +0200
> > Stefan Bellon <sbellon at sbellon.de> wrote:
> 
> > > What am I missing?
> 
> [snip]
> 
> > Anyhow, I'll take a look and probably post a patch in a while.  For
> > now, don't bother with it.
> 
> Ok, I'll forget about it for now. :-)

I fixed bogowordfreq.c earlier and have committed the changes to CVS. 
The patch has been forwarded to you.

> Then it looks like I have bogofilter running on RISC OS. I'd be happy
> to see my changes going into main CVS tree if you agree.
> 
> I had to change the following:
> 
> 1) Comment out the "#include <db.h>" inside bogoconfig.c as we on
>    RISC OS don't have this header file. I either suggest the
>    ENABLE_TDB_DATASTORE is uncommented again, or another #ifdef is
>    added that checks for !__riscos__:
> 
>      #ifndef __riscos__
>      #include <db.h>
>      #endif

Fixed in CVS by removing the #include.  bogoconfig.c compiles fine
without it.

> 2) Put an "#undef atol" before the redefinition in
> dcdflib/src/dcdflib.c
>    as Norcroft C doesn't like macro redefinitions. So, something like
> 
>      #ifdef __riscos__
>      #undef atol
>      #endif
>      #define atol 1.0e-50
> 
>    would be nice.

Fixed in CVS by adding a simple "#undef atol".  No need for
#ifdef/#endif

> 3) I had to add dcdflib/src/dcdflib.h as fisher.c includes it.
> 
> 4) As RISC OS doesn't have automake/configure etc., I hand-edited a
>    config.h file and a Makefile and can provide it.
> 
> 5) As RISC OS doesn't have a port of Berkeley DB and TDB was too slow,
>    I ported sdbm and qdbm and created interfaces to them. I can
>    provide those files (datastore_sdbm.c and datastore_qdbm.c). (If
>    you're interested: sdbm is about 40 to 50 % slower and needs 30 %
>    more disc space than qdbm for average bogofilter usage.)
> 
> 6) And finally, I found three calls to free() in bogoreader.c but the
>    relevant allocations have been done with xmalloc(), so that I
>    suggest the freeing should be done with xfree() for clarity.

Fixed in CVS.
 
> Should I post dcdflib/src/dcdflib.h, datastore_sdbm.c,
> datastore_qdbm.c and the RISC OS versions of config.h and Makefile
> here to the list or someone of you in private email?

Directory doc/programmer has the OS specific help.  I suggest you write
a simple "README.RISC-OS" to document what needs to be done to build
bogofilter on RISC OS.  Then send it to me in a tarball along with your
other files (config.h, Makefile, datastore_?dbm.c) we should be able to
add it to bogofilter.

David




More information about the bogofilter-dev mailing list