built 6.4.2 on SCO OpenServer 5.0.5

From: Andrew Merrill <andrew(at)compclass(dot)com>
To: pgsql-ports(at)hub(dot)org, jboris(at)adphila(dot)org
Subject: built 6.4.2 on SCO OpenServer 5.0.5
Date: 1999-03-30 18:50:50
Message-ID: 37011D0A.3C63FCB2@compclass.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-ports

I recently successfully built PostgreSQL 6.4.2 on SCO OpenServer 5.0.5,
using SCO's UDK compiler.

(For those not familiar with SCO, they have two distinct product lines,
OpenServer and UnixWare, both current and supported by SCO. It would be
nice if PostgreSQL continued to work on both. OpenServer is SVR3.2
based, and UnixWare 7 is SVR5 based.)

SCO's UDK compiler is their UnixWare compiler, but it runs on UnixWare
7, UnixWare 2.1.X, and OpenServer 5.X, and produces binaries that will
run on all three platforms. I have not tried the native SCO OpenServer
compiler yet.

The biggest problem is in pgsql/src/backend/libpq/pqcomm.c.

In the StreamServerPort() function, on line 534, setsockopt() is used to
set the socket to SO_REUSEADDR. This fails under OpenServer for UNIX
domain sockets (family AF_UNIX). It works fine for AF_INET sockets.
So, I surrounded the call to setsockopt() with an check for the correct
family:

if (family == AF_INET) {

if ((setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (char *) &one,
sizeof(one))) == -1)
{
sprintf(PQerrormsg,
"FATAL: StreamServerPort: setsockopt (SO_REUSEADDR) failed:
errno=%d\n", errno);
fputs(PQerrormsg, stderr);
pqdebug("%s", PQerrormsg);
return STATUS_ERROR;
}

}

However, I don't know enough about UNIX domain sockets to know if this
is really a good idea or not. (Help, please?) I always use TCP/IP for
my own work anyway.

If you are using SCO's UDK, you are essentially pretending that you are
using UnixWare. So, you need to also make the following changes:

In pgsql/src/include/port, replace sco.h with unixware.h.

In pgsql/src/template/sco, replace the CFLAGS line with:

CFLAGS:-O -Kpentium,host,inline,loop_unroll,alloca

If you installed bison and flex (I did; they're on SCO's SkunkWare CD),
then also change the YACC and LEX lines in the same file to:

YACC:bison
LEX:flex

If you want to use the readline library with psql (so you can use the
up-arrow to get previous commands, etc.), make sure to install the
*UnixWare* version from the SkunkWare CD, as the OpenServer version on
the CD is not compatible with the new UDK compiler.

Make sure that you have '.' (period) in your PATH when you build.

The command line I used for configure was:

configure --with-libs=/usr/local/lib --with-includes=/usr/local/include
--without-CXX

I haven't been able to build the C++ interface with the UDK, so I just
disable it.

This worked for me; ask if you have any trouble.

Andrew Merrill

Responses

Browse pgsql-ports by date

  From Date Subject
Next Message Billy G. Allie 1999-03-31 08:06:41 Bug Report - Compile errors in vacuum.c and shmem.c
Previous Message Thomas Lockhart 1999-03-29 17:55:20 Re: [PORTS] Port Bug Report: PostgreSQL does not compile on ARM systems