Thread: Re: [PORTS] PostgreSQL 6.5.2 ported to QNX 4

Re: [PORTS] PostgreSQL 6.5.2 ported to QNX 4

From
"Kardos, Dr. Andreas"
Date:
>Send to the "patches" mailing list, unless the patches are
>prohibitively large. afaik the upper limit on mail size for patches is
>big.


Done.

>If it is OK with you, I will put your summary of steps required into
>our source tree as doc/FAQ_QNX. If you have access to the source tree
>you can make changes from there, or if not I'll mail to you the file
>as I've committed it and if it is OK you can make changes from that
>version.


I am new to PostgreSQL so I probably don't have access to the source tree.

>How would you suggest I mention it in the "ports list"? Since you need
>to patch the sources, I guess it isn't "fully supported", but does
>"needs minor patches" describe it correctly?


Yes that's right. But the new QNX port specific files could be completly
included into the standard distribution. Some sources have been extended
with "#ifdef __QNX__". These extensions could be integrated too. Two files
(arrayfuncs.c and chunk.c) have been fixed to reduce warnings. These fixes
are valid for all platforms.

The majority of changed files are Makefiles because on QNX it is not
possible to generate all the "backend/.../SUBSYS.o" as objects because
the -r option is not supported. On QNX I generate archive files now. This is
a general question. I would prefer the archive solution. If the standard
distribution will not be changed this way it will be neccessary to patch the
"backend/.../Makefile"s. Furthermore I couldn't include the bootstrap.o and
ipc.o files into the SUBSYS.o archives because the QNX archiver wlib crashes
with them. I don't know why. Therefore I included them directly into
backend/Makefile

Because I am new to PostgreSQL I would prefer if someone of the core
developers could include the extensions/changes into the source tree.

Completly new files:

pgsql/doc/README.qnx4
pgsql/src/makefiles/Makefile.qnx4
pgsql/src/template/QNX
pgsql/src/include/port/qnx4.h
pgsql/src/backend/port/dynloader/qnx4.h
pgsql/src/backend/port/dynloader/qnx4.c
pgsql/src/backend/port/qnx4/Makefile
pgsql/src/backend/port/qnx4/isnan.c
pgsql/src/backend/port/qnx4/rint.c
pgsql/src/backend/port/qnx4/sem.c
pgsql/src/backend/port/qnx4/shm.c
pgsql/src/backend/port/qnx4/tstrint.c
pgsql/src/backend/port/qnx4/tstsem.c
pgsql/src/backend/port/qnx4/tstshm.c

Extended files:

pgsql/src/backend/port/isinf.c
pgsql/src/backend/postmaster/postmaster.c
pgsql/src/backend/utils/adt/arrayfuncs.c
pgsql/src/backend/utils/adt/chunk.c
pgsql/src/bin/pg_passwd/pg_passwd.c
pgsql/src/include/storage/s_lock.h
pgsql/src/include/utils/builtins.h
pgsql/src/config.guess
pgsql/src/config.sub
pgsql/src/configure

Patched files:

pgsql/src/backend/access/common/Makefile
pgsql/src/backend/access/gist/Makefile
pgsql/src/backend/access/hash/Makefile
pgsql/src/backend/access/heap/Makefile
pgsql/src/backend/access/index/Makefile
pgsql/src/backend/access/nbtree/Makefile
pgsql/src/backend/access/rtree/Makefile
pgsql/src/backend/access/transam/Makefile
pgsql/src/backend/access/Makefile
pgsql/src/backend/bootstrap/Makefile
pgsql/src/backend/catalog/Makefile
pgsql/src/backend/commands/Makefile
pgsql/src/backend/executor/Makefile
pgsql/src/backend/lib/Makefile
pgsql/src/backend/libpq/Makefile
pgsql/src/backend/main/Makefile
pgsql/src/backend/nodes/Makefile
pgsql/src/backend/optimizer/geqo/Makefile
pgsql/src/backend/optimizer/path/Makefile
pgsql/src/backend/optimizer/plan/Makefile
pgsql/src/backend/optimizer/prep/Makefile
pgsql/src/backend/optimizer/util/Makefile
pgsql/src/backend/optimizer/Makefile
pgsql/src/backend/parser/Makefile
pgsql/src/backend/port/Makefile.in
pgsql/src/backend/postmaster/Makefile
pgsql/src/backend/regex/Makefile
pgsql/src/backend/rewrite/Makefile
pgsql/src/backend/storage/buffer/Makefile
pgsql/src/backend/storage/file/Makefile
pgsql/src/backend/storage/ipc/Makefile
pgsql/src/backend/storage/large_object/Makefile
pgsql/src/backend/storage/lmgr/Makefile
pgsql/src/backend/storage/page/Makefile
pgsql/src/backend/storage/smgr/Makefile
pgsql/src/backend/storage/Makefile
pgsql/src/backend/tcop/Makefile
pgsql/src/backend/utils/adt/Makefile
pgsql/src/backend/utils/cache/Makefile
pgsql/src/backend/utils/error/Makefile
pgsql/src/backend/utils/fmgr/Makefile
pgsql/src/backend/utils/hash/Makefile
pgsql/src/backend/utils/init/Makefile
pgsql/src/backend/utils/misc/Makefile
pgsql/src/backend/utils/mmgr/Makefile
pgsql/src/backend/utils/sort/Makefile
pgsql/src/backend/utils/time/Makefile
pgsql/src/backend/utils/Makefile
pgsql/src/backend/Makefile
pgsql/src/interfaces/libpgtcl/Makefile.in
pgsql/src/interfaces/libpq/Makefile.in
pgsql/src/interfaces/libpq++/Makefile.in
pgsql/src/pl/plpgsql/src/Makefile.in

pgsql/src/test/regress/regress.sh

The new and changes files could go into standard distribution. The patched
Makefiles can be incorporated only if the standard
$(LD) -r -o SUBSYS.o $(OBJS)
will be changed to
$(AR) $(AROPT) SUBSYS.o $(OBJS)
May be there is a more elegant way to do this. But I don't know one.

pgsql/src/Makefile.custom should be treated separately.


Sorry for my poor English.

Andreas



Re: [PORTS] PostgreSQL 6.5.2 ported to QNX 4

From
Bruce Momjian
Date:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
> >Send to the "patches" mailing list, unless the patches are
> >prohibitively large. afaik the upper limit on mail size for patches is
> >big.
>
>
> Done.

Got it.

>
> >If it is OK with you, I will put your summary of steps required into
> >our source tree as doc/FAQ_QNX. If you have access to the source tree
> >you can make changes from there, or if not I'll mail to you the file
> >as I've committed it and if it is OK you can make changes from that
> >version.
>

FAQ added to source tree.

>
> I am new to PostgreSQL so I probably don't have access to the source tree.
>
> >How would you suggest I mention it in the "ports list"? Since you need
> >to patch the sources, I guess it isn't "fully supported", but does
> >"needs minor patches" describe it correctly?
>
>
> Yes that's right. But the new QNX port specific files could be completly
> included into the standard distribution. Some sources have been extended
> with "#ifdef __QNX__". These extensions could be integrated too. Two files
> (arrayfuncs.c and chunk.c) have been fixed to reduce warnings. These fixes
> are valid for all platforms.

arrayfuncs and chunk.c changes added.

>
> The majority of changed files are Makefiles because on QNX it is not
> possible to generate all the "backend/.../SUBSYS.o" as objects because
> the -r option is not supported. On QNX I generate archive files now. This is
> a general question. I would prefer the archive solution. If the standard
> distribution will not be changed this way it will be neccessary to patch the
> "backend/.../Makefile"s. Furthermore I couldn't include the bootstrap.o and
> ipc.o files into the SUBSYS.o archives because the QNX archiver wlib crashes
> with them. I don't know why. Therefore I included them directly into
> backend/Makefile

These are problematic.  Changing $(LD) -r to $(AR) will not work on many
platforms.  In the current source tree.  I have changed all $(LD) -r to
$(LD) $(LDREL), and defined LDREL= -r.  The -r can now be overridden in
Makefile.qnx.  You can now define $LD as 'ar' in qnx.


Can you tell me what the QNX operating system is?  Is it that real-time
OS?

>
> Because I am new to PostgreSQL I would prefer if someone of the core
> developers could include the extensions/changes into the source tree.


I am seeing you remove the semicolon here:

    @if [ ! -d $(HEADERDIR) ]; then mkdir $(HEADERDIR); fi

                                 ^

That will not work on many platforms.  We need those semicolons.  There
is another way we could do it, buy using "[ test ] && action", so there
would be no if...then...fi.  However, that's a lot of tests to change.
Please let me know why the semicolon is a problem, and whether there is
an upgraded shell that will allow it on QNX.


I have not added any of the #if QNX code.  My recommendation is that you
grab a copy of the current tree via cvs, which will have the changes I
just made, and see if you can get that to work.  You will find that most
of your stuff will work fine, and that only a few areas now have to be
modified.

I will then be glad to include all the rest of your changes.  I could
apply your QNX-specific code, but because I need to get this into
6.6/7.0 I need your help, I am waiting until you have the current tree
installed so I know for sure we are going to have QNX as a port.

With the ld -r changed now, and Makefile.qnx updated properly, your
changes for QNX are minimal.

Please contact the ports list when you have more information.

--
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026