Forum

Compiled on Solaris

Richard
9 September 2007, 16:29
Hi,

Just a note to say I've built Hiawatha (v5.12, cache) on Solaris 10 x86, and it's now serving HTTP under a Solaris Zone. I haven't tried a rewrite or SSL build yet.

I'm using the Sun Studio 12 toolchain, and needed to set the following:
MAKE=dmake
CFLAGS=-xc99
LIBS=-lsocket -lnsl

I also had to change flock() to fcntl() in target.c

Thanks for the hard work on Hiawatha. It's a refreshing change from the status quo.

Cheers,
Richard
Hugo Leisink
10 September 2007, 01:39
That's really good to hear. Another OS for my 'works oke' list.

I'd really appreciate if you could let me know the exact changes you've made to the source, so I can make sure the next release will compile 'out of the box' on Solaris. I don't have access to a Solaris machine, so I can't test it myself. If you can try to make SSL and rewrite builds, that would also be great.
Richard
10 September 2007, 16:56
Okay, I've done a complete build now ( Hiawatha v5.12, SSL, cache, URL rewrite ).

I needed to set the following:
MAKE=dmake
CPPFLAGS=-I/usr/sfw/include
LDFLAGS=-L/usr/sfw/lib -R/usr/sfw/lib
LIBS=-lcrypto -lssl -lsocket -lnsl
CFLAGS=-xc99
PATH=/opt/SUNWspro/bin:$PATH

Notes:
OpenSSL lives under /usr/sfw, and the flags are described in man openssl.
Sun Studio 12 path should be ahead of /usr/ucb path.

The code changes were:

At line 1346 of target.c
	/* if (flock(handle_write, LOCK_EX) == -1) { */
if (fcntl(handle_write, F_SETLK, F_WRLCK ) == -1 ) {



At line 1433 of target.c
	/* flock(handle_write, LOCK_UN); */
fcntl(handle_write, F_SETLK, F_UNLCK);

Hugo Leisink
10 September 2007, 17:05
Great!!!! I'll make the necessary changes to the autoconf scripts, so it will compile on Solaris out-of-the-box.

In the Hiawatha source directory, a file 'Makefile' is created after running './configure'. There should be a line in it which starts with 'build_os ='. Can you tell me what comes next on that line? I need it to detect a building on Solaris.
Richard
10 September 2007, 17:38
On my box ( Solaris Express build 35 with BrandZ support ), that line reads:
build_os = solaris2.11

The complete triplet is i386-pc-solaris2.11

Regular Solaris 10 x86 is i386-pc-solaris2.10, and uses the same build tools, paths, etc...

Hugo Leisink
10 September 2007, 18:23
Can I have your e-mail address? If I'm ready with the changes, I'll send you a test version of the next release, so you can test for me if I've done everything right. Send an e-mail to hugo at leisink dot net if you want to help me. Also please send me your config.log file. That would help me alot making Hiawatha ready for Solaris.
Richard
11 September 2007, 10:06
Done. Looking forward to the testing the next one.
This topic has been closed.