Subject Re: [ib-support] Firebird and FreeBSD
Author John Bellardo

On Saturday, July 14, 2001, at 03:18 AM, Carlos Yu wrote:

> Hi,
> [background]
> Since I can't recompile the FreeBSD kernel, is there anyway I can
> tweak and recompile Firebird to run on my host provider's version of
> FreeBSD?
> Please help...

I have an idea, but I don't know if it is a good one or if it will
work. In jrd/thd.h there are a number of lines like the following:

#if (defined(LINUX) && defined(SUPERSERVER))
#define MULTI_THREAD 1

#if (defined(DARWIN) && defined(SUPERSERVER))
#define MULTI_THREAD 1

The POSIX_THREADS macro makes the code use the pthreads API, including
semaphores. I fairly certain that POSIX_THREADS will not work in CS.
My suggestion:

1) add the following to thd.h by the others -

#if (defined(FREEBSD) && defined(SUPERSERVER))
#define MULTI_THREAD 1

2) recompile Firebird SS. I don't know if the compile will work on
your host provider's system. The build process might depend on CS
working at some point. So you might need to build on a separate system
where CS is functional.

3) get your hosting provider to run your compiled SS.

Assuming you hosts install of FreeBSD supports pthreads (I would be
surprised if it didn't) the above *should* work.

The default Darwin install didn't support SysV semaphores, but it did
support pthreads. I found that the above 4 lines resulted in a SS build
that worked on the default install even though the kernel didn't have
SysV semaphore support. Your mileage may vary.