3
last updated: $Date: 2004-03-23 01:23:47 $
5
current maintainer: Bernd Tegge (tegge@repas-aeg.de)
6
original author: Andreas Kardos (kardos@repas-aeg.de)
8
This port is an important step because PostgreSQL is still the only free
9
relational database with full SQL and ODBC support available for QNX 4.
10
The only commercial databases available are Empress RDBMS and Velocis
11
Database Server (not supported for Digital Unix).
13
The most effort required the emulation of System V semaphore sets,
14
shared memory and IPC and of some IEEE floating-point functionality.
16
It is recommended to use the GNU C compiler instead of the Watcom compiler
17
because the Watcom compiler doesn't support a int8 datatype (long or
18
long long int) and it does not have a C++ frontend. The only advantage
19
using Watcom C would be support of Tk and pgaccess.
21
QNX 4 does not offer native support of shared libraries. Therefore the related
22
functionality cannot be used. Shared library support could probably be
23
implemented in future.
25
QNX 4 does not support UNIX domain sockets. Clients must use TCP/IP
26
sockets. Therefore, do not set "listen_addresses" to empty in your
27
postgresql.conf file. In fact, it's advisable to explicitly set
28
"listen_addresses" in an environment using native QNX networking.
29
Otherwise the postmaster might not use the IP-Address you think it does :-)
34
The following prerequisites have been used:
37
QNX 4.25, Watcom C 10.6, GNU make
39
Available from http://www.teaser.fr/~jcmichot/
40
flex-2.5.4a.tar.gz (flex)
41
egcs-112-qnx4-r20.tar[.gz] (GNU C)
43
Available from ftp://ftp.visi.com/users/hawkeyd/qnx/
46
Available from http://quics.qnx.com/cgi-bin/dir_find.cgi?/usr/free/
49
from ftp://ftp.freesoftware.com/pub/infozip/zlib/
54
In order to achieve meaningful results for the regression tests, you need
55
a different shell. The standard QNX shell is quite broken with regard to
56
scripting (even QSSL suggested to use pdksh or bash). Both are available
57
in source and binaries at
58
http://quics.qnx.com/cgi-bin/dir_find.cgi?/usr/free/
60
flex can be built without any problems using the Watcom or GNU C compilers.
62
The current version of bison (1.2.8 at the time of this writing) does not
63
build cleanly on QNX4 with gcc installed, but you can download src and
64
binary of a previous version from the above mentioned ftp site.
67
GNU C can be installed by
68
/etc/install -u egcs112-qnx4-r20.tar[.gz]
70
Although Tcl can be built after some slight code changes using the Watcom
71
compiler, the GNU C compiler should be used instead. Otherwise it would be
72
impossible to link postgres built with GNU C together with libtcl8.0.a built
73
with the Watcom compiler. However, if you are going to build a Watcom version
74
you must build the tcl and tk libraries with Watcom too.
76
To make unix/tclUnixTest.c compilable uncomment
77
#include <sys/resource.h>
79
touch /usr/include/sys/resource.h
80
In unix/Makefile.in replace
81
( echo cd $(TOP_DIR)/tests\; source all ) | ./tcltest
83
( echo cd ../tests\; source all ) | ./tcltest
84
After that Tcl can be built and tested as stated in README.
86
Tk cannot be built with GNU C due to the lack of a stack version of the
87
X11 library. With the Watcom compiler Tk could be built but this is not useful
88
because of the link problems mentioned above.
90
Therefore the Tk interface and the pgaccess tool cannot be supported for a GNU C
91
version of PostgreSQL on QNX 4.
96
On QNX 4 some headers are not in the directories expected. To avoid
97
modifications of the code the following links should be made:
99
ln -s /usr/local/bin/perl /usr/local/bin/perl5
100
ln -s /usr/include/errno.h /usr/include/sys/errno.h
101
ln -s /usr/include/ioctl.h /usr/include/sys/ioctl.h
102
ln -s /usr/src/pgsql/src/backend/port/qnx4/ipc.h /usr/include/sys/ipc.h
103
ln -s /usr/src/pgsql/src/backend/port/qnx4/sem.h /usr/include/sys/sem.h
104
ln -s /usr/src/pgsql/src/backend/port/qnx4/shm.h /usr/include/sys/shm.h
106
For ecgs-2.91.60 the file
107
/usr/local/lib/gcc-lib/i386-pc-qnx4/egcs-2.91.66/include/g++/stl_alloc.h
108
had to be patched (extern "C++" { ... } // extern "C++").
111
If all prerequisites are available postgres can be built and installed by
113
./configure --with-tcl --without-tk --with-perl
114
gmake > make.log 2>&1
115
gmake install > make.install.log 2>&1
121
All other steps can be carried out as stated in the INSTALL file.
126
Sometimes the Watcom library manager wlib crashes with SIGSEGV on some
127
object files. This is a general problem and not PostgreSQL related.
128
Currently bootstrap.o causes such a crash. The workaround is not to include
129
the object file into the SUBSYS.o but link it directly. For further information
130
see backend/Makefile and backend/bootstrap/Makefile.
131
libpgsql.a currently cannot be generated because of the same problem. But this
132
doesn't matter since shared libraries are not supported.
133
(The Makefiles are already changed to ignore this, you don't have to
138
please don't use the QNX shell for the parallel regression tests. Download
139
bash from quics.qnx.com and run 'make SHELL=/usr/local/bin/bash check'
142
The majority of regression tests succeeded. The following tests failed:
145
Some slight deviation in the last digit and "0" instead of "-0".
148
timestamp, tinterval, abstime, horology:
149
Differences for years before the UNIX epoch. The QNX library probably treats
150
time_t as unsigned -> dates before 1970 get moved into the far future.
153
create_function_1, create_function_2, create_type, create_operator,
154
create_view, select_views, triggers, misc, plpgsql:
155
Error messages due to the lack of shared library support.
158
looks like it fails because it depends on tables created by previously
162
An expected failure message contains one blank more than expected.
163
Possibly a faulty output file.
165
int8, subselect, union
166
fails for Watcom version because of lacking int8 support.
168
The current state of this port should be sufficient for lot of applications.
180
---------------------------------------------------------------------------
182
*** ./stl_alloc.h.orig Sat Feb 28 05:17:28 1998
183
--- ./stl_alloc.h Tue Nov 23 04:14:09 1999
187
#pragma set woff 1174
191
// Malloc-based allocator. Typically slower than default alloc below.
192
// Typically thread-safe and more storage efficient.
193
#ifdef __STL_STATIC_TEMPLATE_MEMBER_BUG
199
#endif /* ! __USE_MALLOC */
202
#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
203
#pragma reset woff 1174
206
Patch required to build with gcc:
208
*** /usr/src/postgresql-7.2b3/src/backend/port/qnx4/sem.h Thu Nov 8 21:37:52 2001
209
--- src/backend/port/qnx4/sem.h Mon Dec 10 13:22:18 2001
213
ushort_t sem_num; /* semaphore # */
214
short sem_op; /* semaphore operation */
215
short sem_flg; /* operation flags */
219
+ * command union for semctl.
223
+ int val; /* value for SETVAL */
224
+ struct semid_ds *buf; /* buffer for IPC_STAT, IPC_SET */
225
+ unsigned short int *array; /* array for GETALL, SETALL */
226
+ struct seminfo *__buf; /* buffer for IPC_INFO */
229
extern int semctl(int semid, int semnum, int cmd, /* ... */ union semun arg);