Massive commits for SunOS4 port.

This commit is contained in:
Tatsuo Ishii 2001-02-27 08:13:31 +00:00
parent 919ace07d5
commit df247b821d
15 changed files with 339 additions and 148 deletions

378
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -777,6 +777,9 @@ AC_CHECK_FUNCS([fcvt getopt_long memmove pstat setproctitle setsid sigprocmask s
dnl Check whether <unistd.h> declares fdatasync(). dnl Check whether <unistd.h> declares fdatasync().
AC_EGREP_HEADER(fdatasync, unistd.h, AC_DEFINE(HAVE_FDATASYNC_DECL)) AC_EGREP_HEADER(fdatasync, unistd.h, AC_DEFINE(HAVE_FDATASYNC_DECL))
dnl Check whether <unistd.h> declares optarg
AC_EGREP_HEADER(optarg, unistd.h, AC_DEFINE(HAVE_OPTARG_DECL))
AC_CACHE_CHECK([for PS_STRINGS], [pgac_cv_var_PS_STRINGS], AC_CACHE_CHECK([for PS_STRINGS], [pgac_cv_var_PS_STRINGS],
[AC_TRY_LINK( [AC_TRY_LINK(
[#include <machine/vmparam.h> [#include <machine/vmparam.h>
@ -1073,6 +1076,12 @@ AC_DEFINE_UNQUOTED(INT64_FORMAT, $INT64_FORMAT)
AC_CHECK_FUNCS([strtoll strtoq], [break]) AC_CHECK_FUNCS([strtoll strtoq], [break])
AC_CHECK_FUNCS([strtoull strtouq], [break]) AC_CHECK_FUNCS([strtoull strtouq], [break])
dnl psql needs atexit() or on_exit()
AC_CHECK_FUNC(atexit,
[AC_DEFINE(HAVE_ATEXIT)],
[AC_CHECK_FUNCS(on_exit,
[AC_DEFINE(HAVE_ON_EXIT)],
[AC_MSG_ERROR([atexi() nor on_exit() found])])])
dnl Need a #define for the size of Datum (unsigned long) dnl Need a #define for the size of Datum (unsigned long)

View File

@ -1,5 +1,5 @@
# -*-makefile-*- # -*-makefile-*-
# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.119 2001/02/20 19:20:28 petere Exp $ # $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.120 2001/02/27 08:13:29 ishii Exp $
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# All PostgreSQL makefiles include this file and use the variables it sets, # All PostgreSQL makefiles include this file and use the variables it sets,
@ -288,6 +288,7 @@ INET_ATON = @INET_ATON@
STRERROR = @STRERROR@ STRERROR = @STRERROR@
SNPRINTF = @SNPRINTF@ SNPRINTF = @SNPRINTF@
STRDUP = @STRDUP@ STRDUP = @STRDUP@
STRTOUL = @STRTOUL@
########################################################################## ##########################################################################

View File

@ -6,7 +6,7 @@
# Copyright (c) 1998, Regents of the University of California # Copyright (c) 1998, Regents of the University of California
# #
# IDENTIFICATION # IDENTIFICATION
# $Header: /cvsroot/pgsql/src/Makefile.shlib,v 1.45 2001/02/20 19:20:28 petere Exp $ # $Header: /cvsroot/pgsql/src/Makefile.shlib,v 1.46 2001/02/27 08:13:29 ishii Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
@ -184,6 +184,11 @@ ifeq ($(PORTNAME), solaris)
SHLIB_LINK += -lm -lc SHLIB_LINK += -lm -lc
endif endif
ifeq ($(PORTNAME), sunos4)
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
LINK.shared = $(LD) -assert pure-text -Bdynamic
endif
ifeq ($(PORTNAME), osf) ifeq ($(PORTNAME), osf)
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION) shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
LINK.shared = $(LD) -shared -expect_unresolved '*' LINK.shared = $(LD) -shared -expect_unresolved '*'

View File

@ -1,7 +1,7 @@
/* ----------------------------------------------------------------------- /* -----------------------------------------------------------------------
* formatting.c * formatting.c
* *
* $Header: /cvsroot/pgsql/src/backend/utils/adt/formatting.c,v 1.32 2001/02/12 12:52:02 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/formatting.c,v 1.33 2001/02/27 08:13:28 ishii Exp $
* *
* *
* Portions Copyright (c) 1999-2000, PostgreSQL Global Development Group * Portions Copyright (c) 1999-2000, PostgreSQL Global Development Group
@ -1398,7 +1398,7 @@ int4len(int4 num)
{ {
char b[16]; char b[16];
return sprintf(b, "%d", num); return snprintf(b, sizeof(b), "%d", num);
} }
/* ---------- /* ----------
@ -3211,7 +3211,7 @@ int_to_roman(int number)
fill_str(result, '#', 15); fill_str(result, '#', 15);
return result; return result;
} }
len = sprintf(numstr, "%d", number); len = snprintf(numstr, sizeof(numstr), "%d", number);
for (p = numstr; *p != '\0'; p++, --len) for (p = numstr; *p != '\0'; p++, --len)
{ {
@ -4013,7 +4013,7 @@ NUM_processor(FormatNode *node, NUMDesc *Num, char *inout, char *number,
Np->inout_p += strlen(Np->inout_p) - 1; Np->inout_p += strlen(Np->inout_p) - 1;
} }
else else
Np->inout_p += sprintf(Np->inout_p, "%15s", Np->number_p) - 1; Np->inout_p += snprintf(Np->inout_p, plen - (Np->inout_p - Np->inout), "%15s", Np->number_p) - 1;
break; break;
case NUM_rn: case NUM_rn:
@ -4023,7 +4023,7 @@ NUM_processor(FormatNode *node, NUMDesc *Num, char *inout, char *number,
Np->inout_p += strlen(Np->inout_p) - 1; Np->inout_p += strlen(Np->inout_p) - 1;
} }
else else
Np->inout_p += sprintf(Np->inout_p, "%15s", str_tolower(Np->number_p)) - 1; Np->inout_p += snprintf(Np->inout_p, plen - (Np->inout_p - Np->inout), "%15s", str_tolower(Np->number_p)) - 1;
break; break;
case NUM_th: case NUM_th:

View File

@ -5,7 +5,7 @@
# Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group # Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California # Portions Copyright (c) 1994, Regents of the University of California
# #
# $Header: /cvsroot/pgsql/src/bin/pg_dump/Makefile,v 1.29 2001/02/20 19:20:28 petere Exp $ # $Header: /cvsroot/pgsql/src/bin/pg_dump/Makefile,v 1.30 2001/02/27 08:13:28 ishii Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
@ -14,7 +14,21 @@ top_builddir = ../../..
include $(top_builddir)/src/Makefile.global include $(top_builddir)/src/Makefile.global
OBJS= pg_backup_archiver.o pg_backup_db.o pg_backup_custom.o pg_backup_files.o \ OBJS= pg_backup_archiver.o pg_backup_db.o pg_backup_custom.o pg_backup_files.o \
pg_backup_null.o pg_backup_tar.o $(STRDUP) pg_backup_null.o pg_backup_tar.o
ifdef STRDUP
OBJS+=$(top_builddir)/src/utils/strdup.o
$(top_builddir)/src/utils/strdup.o:
$(MAKE) -C $(top_builddir)/src/utils strdup.o
endif
ifdef STRTOUL
OBJS+=$(top_builddir)/src/backend/port/strtoul.o
$(top_builddir)/src/backend/port/strtoul.o:
$(MAKE) -C $(top_builddir)/src/backend/port strtoul.o
endif
override CPPFLAGS := -I$(libpq_srcdir) $(CPPFLAGS) override CPPFLAGS := -I$(libpq_srcdir) $(CPPFLAGS)
@ -26,9 +40,6 @@ pg_dump: pg_dump.o common.o $(OBJS) $(libpq_builddir)/libpq.a
pg_restore: pg_restore.o $(OBJS) $(libpq_builddir)/libpq.a pg_restore: pg_restore.o $(OBJS) $(libpq_builddir)/libpq.a
$(CC) $(CFLAGS) pg_restore.o $(OBJS) $(libpq) $(LDFLAGS) $(LIBS) -o $@ $(CC) $(CFLAGS) pg_restore.o $(OBJS) $(libpq) $(LDFLAGS) $(LIBS) -o $@
../../utils/strdup.o:
$(MAKE) -C ../../utils strdup.o
pg_dumpall: pg_dumpall.sh pg_dumpall: pg_dumpall.sh
sed -e 's,@VERSION@,$(VERSION),g' \ sed -e 's,@VERSION@,$(VERSION),g' \
-e 's,@MULTIBYTE@,$(MULTIBYTE),g' \ -e 's,@MULTIBYTE@,$(MULTIBYTE),g' \

View File

@ -68,8 +68,13 @@
#ifdef HAVE_GETOPT_H #ifdef HAVE_GETOPT_H
#include <getopt.h> #include <getopt.h>
#else #else
#ifdef HAVE_OPTARG_DECL
#include <unistd.h> #include <unistd.h>
#endif #else
extern char *optarg;
extern int optind, opterr, optopt;
#endif /* HAVE_OPTARG_DECL */
#endif /* HAVE_GETOPT_H */
/* Forward decls */ /* Forward decls */
static void usage(const char *progname); static void usage(const char *progname);

View File

@ -6,13 +6,21 @@
* *
* Copyright (C) 2000 by PostgreSQL Global Development Group * Copyright (C) 2000 by PostgreSQL Global Development Group
* *
* $Header: /cvsroot/pgsql/src/bin/pg_id/Attic/pg_id.c,v 1.17 2001/02/10 02:31:27 tgl Exp $ * $Header: /cvsroot/pgsql/src/bin/pg_id/Attic/pg_id.c,v 1.18 2001/02/27 08:13:28 ishii Exp $
*/ */
#include "postgres_fe.h" #include "postgres_fe.h"
#ifdef HAVE_GETOPT_H #ifdef HAVE_GETOPT_H
#include <getopt.h> #include <getopt.h>
#endif #else
#ifdef HAVE_OPTARG_DECL
#include <unistd.h>
#else
extern char *optarg;
extern int optind, opterr, optopt;
#endif /* HAVE_OPTARG_DECL */
#endif /* HAVE_GETOPT_H */
#include <pwd.h> #include <pwd.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>

View File

@ -5,7 +5,7 @@
# Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group # Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California # Portions Copyright (c) 1994, Regents of the University of California
# #
# $Header: /cvsroot/pgsql/src/bin/psql/Makefile,v 1.29 2001/02/20 19:20:29 petere Exp $ # $Header: /cvsroot/pgsql/src/bin/psql/Makefile,v 1.30 2001/02/27 08:13:27 ishii Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
@ -46,6 +46,13 @@ $(top_builddir)/src/backend/port/snprintf.o:
$(MAKE) -C $(top_builddir)/src/backend/port snprintf.o $(MAKE) -C $(top_builddir)/src/backend/port snprintf.o
endif endif
ifdef STRTOUL
OBJS+=$(top_builddir)/src/backend/port/strtoul.o
$(top_builddir)/src/backend/port/strtoul.o:
$(MAKE) -C $(top_builddir)/src/backend/port strtoul.o
endif
# End of hacks for picking up backend 'port' modules # End of hacks for picking up backend 'port' modules
psql: $(OBJS) $(libpq_builddir)/libpq.a psql: $(OBJS) $(libpq_builddir)/libpq.a

View File

@ -3,7 +3,7 @@
* *
* Copyright 2000 by PostgreSQL Global Development Group * Copyright 2000 by PostgreSQL Global Development Group
* *
* $Header: /cvsroot/pgsql/src/bin/psql/input.c,v 1.15 2001/02/10 02:31:28 tgl Exp $ * $Header: /cvsroot/pgsql/src/bin/psql/input.c,v 1.16 2001/02/27 08:13:27 ishii Exp $
*/ */
#include "postgres_fe.h" #include "postgres_fe.h"
#include "input.h" #include "input.h"
@ -151,7 +151,11 @@ initializeInput(int flags)
} }
#endif #endif
#ifdef HAVE_ATEXIT
atexit(finishInput); atexit(finishInput);
#else
on_exit(finishInput);
#endif
} }

View File

@ -3,7 +3,7 @@
* *
* Copyright 2000 by PostgreSQL Global Development Group * Copyright 2000 by PostgreSQL Global Development Group
* *
* $Header: /cvsroot/pgsql/src/bin/psql/print.c,v 1.15 2001/02/10 02:31:28 tgl Exp $ * $Header: /cvsroot/pgsql/src/bin/psql/print.c,v 1.16 2001/02/27 08:13:27 ishii Exp $
*/ */
#include "postgres_fe.h" #include "postgres_fe.h"
#include "print.h" #include "print.h"
@ -21,6 +21,8 @@
#include "pqsignal.h" #include "pqsignal.h"
#include "libpq-fe.h" #include "libpq-fe.h"
#include "settings.h"
#ifndef __CYGWIN__ #ifndef __CYGWIN__
#define DEFAULT_PAGER "more" #define DEFAULT_PAGER "more"
#else #else

View File

@ -3,10 +3,11 @@
* *
* Copyright 2000 by PostgreSQL Global Development Group * Copyright 2000 by PostgreSQL Global Development Group
* *
* $Header: /cvsroot/pgsql/src/bin/psql/stringutils.c,v 1.27 2001/02/10 02:31:28 tgl Exp $ * $Header: /cvsroot/pgsql/src/bin/psql/stringutils.c,v 1.28 2001/02/27 08:13:27 ishii Exp $
*/ */
#include "postgres_fe.h" #include "postgres_fe.h"
#include "stringutils.h" #include "stringutils.h"
#include "settings.h"
#include <ctype.h> #include <ctype.h>
#include <assert.h> #include <assert.h>

View File

@ -8,7 +8,7 @@
* or in config.h afterwards. Of course, if you edit config.h, then your * or in config.h afterwards. Of course, if you edit config.h, then your
* changes will be overwritten the next time you run configure. * changes will be overwritten the next time you run configure.
* *
* $Id: config.h.in,v 1.158 2001/02/18 04:39:42 tgl Exp $ * $Id: config.h.in,v 1.159 2001/02/27 08:13:27 ishii Exp $
*/ */
#ifndef CONFIG_H #ifndef CONFIG_H
@ -579,6 +579,9 @@ extern int fdatasync(int fildes);
/* Set to 1 if you have getopt_long() (GNU long options) */ /* Set to 1 if you have getopt_long() (GNU long options) */
#undef HAVE_GETOPT_LONG #undef HAVE_GETOPT_LONG
/* Set to 1 if optarg is declared in unistd.h */
#undef HAVE_OPTARG_DECL
/* Set to 1 if you have union semun */ /* Set to 1 if you have union semun */
#undef HAVE_UNION_SEMUN #undef HAVE_UNION_SEMUN
@ -651,6 +654,11 @@ extern int fdatasync(int fildes);
# define HAVE_STRTOULL 1 # define HAVE_STRTOULL 1
#endif #endif
/* Define if you have atexit() */
#undef HAVE_ATEXIT
/* Define if you have on_exit() */
#undef HAVE_ON_EXIT
/* /*
*------------------------------------------------------------------------ *------------------------------------------------------------------------

View File

@ -8,6 +8,9 @@
#ifdef HAVE_GETOPT_H #ifdef HAVE_GETOPT_H
#include "getopt.h" #include "getopt.h"
#else
extern char *optarg;
extern int optind, opterr, optopt;
#endif #endif
#include "extern.h" #include "extern.h"

View File

@ -2,7 +2,7 @@ AROPT = cr
DLSUFFIX = .so DLSUFFIX = .so
ifeq ($(GCC), yes) ifeq ($(GCC), yes)
CFLAGS_SL = -fPIC CFLAGS_SL = -fpic
else else
CFLAGS_SL = -PIC CFLAGS_SL = -PIC
endif endif
@ -13,4 +13,5 @@ CXXFLAGS_SL = -PIC
endif endif
%.so: %.o %.so: %.o
$(LD) -dc -dp -Bdynamic -o $@ $< $(LD) -assert pure-text -Bdynamic -o $@ $<