Re: SunOS4

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>
Cc: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: SunOS4
Date: 2001-02-21 16:34:32
Message-ID: Pine.LNX.4.30.0102211713590.1381-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tatsuo Ishii writes:

> o c.h 's sunos4 part should not include varargs.h. (Tom has already
> fixed it) Instead, stdlib.h and stdarg.h should be included.

This should be okay by now.

> o no RAND_MAX or EXIT_FAILURE found. I simply added them to c.h.

EXIT_FAILURE is defined in src/bin/psql/settings.h; I can't find it used
outside psql. RAND_MAX should be inside an #ifndef RAND_MAX, not in a
SunOS specific section.

> o regex/utils.h included twice somewhere. I added #ifndef
> UTILS_H... to utils.h

Okay.

> o utils/adt/formatting.c rely on sprintf() returns length of formatted
> strings. This is not true for SunOS4. I have changed sprintf to
> snprintf.

Okay.

> o SunOS4 does not have strdup, strtoul. --> use backend/port/strtoul.c
> etc.

Okay. Instead of ../../etc. in makefiles you should use $(top_srcdir) or
$(top_builddir).

> o SunOS4 does not have atexit (used in psql). --> igore it

Maybe on_exit() is available, or even more portable?

> o SunOS4 does not have getopt. --> use utils/getopt.c. also getopt.h
> need to be created, and checking for getopt is needed to configure.in.

Ugh.

#include "../../utils/getopt.h" is definitely not good.

+ #ifndef HAVE_GETOPT_H
+ char *__progname = "pg_id";
+ #endif

seems to be misguided.

The getopt.h file doesn't seem necessary. The external variables should
be defined in every program that needs them. The getopt() function
doesn't need to be declared.

> o to make shared library I have added an entry for SunOS4 in
> Makefile.shlib.

I'm not sure that entry is right. Libtool wants it to look like

$(LD) -assert pure-text -Bshareable

you have

$(LD) -dc -dp -Bdynamic

>
> o to make shared libraries (such as libpgeasy.so) relying on libpq,
> "ld foo.o bar.o ... -L ../libpq -lpq" is executed but fails. I
> changed it to:
> ld foo.o bar.o ... ../libpq.a
> instead.

Can you elaborate on why that's necessary? Perhaps a problem with the
command line (see above)? Why only ecpg?

> o pg_id needs Makefile.in.

Nothing needs a Makefile.in. Substitution symbols go in Makefile.global.

> included are patched for *7.0.x*. Sould I make same changes to 7.1?
> Comments anyone?

7.0 build patches are pretty much useless for 7.1, I'm afraid. You should
work with 7.1 before proceeding.

--
Peter Eisentraut peter_e(at)gmx(dot)net http://yi.org/peter-e/

In response to

  • SunOS4 at 2001-02-21 06:52:58 from Tatsuo Ishii

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Lamar Owen 2001-02-21 16:44:03 Re: beta5 ...
Previous Message Peter Eisentraut 2001-02-21 16:10:08 Re: beta5 ...