Commit 4d76a801 authored by Peter Eisentraut's avatar Peter Eisentraut

Unify solaris_i386 and solaris_sparc templates. They were almost identical

anyway, the rest being due to them not being kept in sync.  Add configure
test for lorder and use it (on Solaris) when found.
parent cbe5f73a
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -70,11 +70,7 @@ nextstep*) template=nextstep ;;
osf*) template=osf ;;
qnx*) template=qnx4 ;;
sco*) template=sco ;;
solaris*)
case $host_cpu in
sparc) template=solaris_sparc ;;
i?86) template=solaris_i386 ;;
esac ;;
solaris*) template=solaris ;;
sunos*) template=sunos4 ;;
sysv4.2*)
case $host_vendor in
......@@ -83,7 +79,6 @@ nextstep*) template=nextstep ;;
sysv4*) template=svr4 ;;
sysv5uw*) template=unixware ;;
ultrix*) template=ultrix4 ;;
beos*) template=beos ;;
esac
if test x"$template" = x"" ; then
......@@ -112,15 +107,15 @@ AC_LINK_FILES([src/backend/port/dynloader/${template}.h], [src/include/dynloader
AC_LINK_FILES([src/include/port/${template}.h], [src/include/os.h])
AC_LINK_FILES([src/makefiles/Makefile.${template}], [src/Makefile.port])
# Pick right test-and-set (TAS) code. Most platforms have inline
# assembler code in their port include file, so we just use a dummy
# file here.
# Pick right test-and-set (TAS) code. Most platforms have inline
# assembler code in src/include/storage/s_lock.h, so we just use
# a dummy file here.
tas_file=dummy.s
need_tas=no
case $template in
hpux) need_tas=yes; tas_file=hpux.s ;;
solaris_sparc) need_tas=yes; tas_file=solaris_sparc.s ;;
solaris_i386) need_tas=yes; tas_file=solaris_i386.s ;;
case $host in
*-*-hpux*) need_tas=yes; tas_file=hpux.s ;;
sparc-*-solaris*) need_tas=yes; tas_file=solaris_sparc.s ;;
i?86-*-solaris) need_tas=yes; tas_file=solaris_i386.s ;;
esac
if test "$need_tas" = yes ; then
......@@ -593,8 +588,9 @@ AC_PROG_AWK
PGAC_PATH_FLEX
AC_PROG_LN_S
AC_PROG_RANLIB
AC_CHECK_PROGS(LORDER, lorder)
AC_PATH_PROG(TAR, tar)
AC_CHECK_PROGS(PERL, perl,)
AC_CHECK_PROGS(PERL, perl)
AC_PROG_YACC
AC_SUBST(YFLAGS)
if test "$with_tk" = yes; then
......
# -*-makefile-*-
# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.99 2000/10/10 13:04:46 momjian Exp $
# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.100 2000/10/10 21:22:21 petere Exp $
#------------------------------------------------------------------------------
# All PostgreSQL makefiles include this file and use the variables it sets,
......@@ -157,6 +157,7 @@ LDREL = -r
LDOUT = -o
DLSUFFIX = @DLSUFFIX@
RANLIB = @RANLIB@
LORDER = @LORDER@
X = @EXEEXT@
# Miscellaneous
......
......@@ -6,7 +6,7 @@
# Copyright (c) 1998, Regents of the University of California
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/Makefile.shlib,v 1.24 2000/10/07 14:39:06 momjian Exp $
# $Header: /cvsroot/pgsql/src/Makefile.shlib,v 1.25 2000/10/10 21:22:21 petere Exp $
#
#-------------------------------------------------------------------------
......@@ -70,7 +70,7 @@ ifeq ($(PORTNAME), aix)
SHLIB_LINK += -lc
endif
ifeq ($(PORTNAME), bsd)
ifeq ($(PORTNAME), openbsd)
ifdef BSD_SHLIB
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
ifdef ELF_SYSTEM
......@@ -149,21 +149,14 @@ ifeq ($(PORTNAME), linux)
CFLAGS += $(CFLAGS_SL)
endif
ifeq ($(PORTNAME), solaris_i386)
ifeq ($(PORTNAME), solaris)
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
LDFLAGS_SL := -G
SHLIB_LINK += -ldl -lsocket -lresolv -lnsl -lm -lc
CFLAGS += $(CFLAGS_SL)
endif
ifeq ($(PORTNAME), solaris_sparc)
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
LDFLAGS_SL := -G
SHLIB_LINK += -ldl -lsocket -lresolv -lnsl -lm -lc
CFLAGS += $(CFLAGS_SL)
endif
ifeq ($(PORTNAME), alpha)
ifeq ($(PORTNAME), osf)
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
LDFLAGS_SL += -shared -expect_unresolved '*'
endif
......@@ -219,11 +212,15 @@ all-lib: lib$(NAME).a $(shlib)
ifneq ($(PORTNAME), win)
ifndef LORDER
MK_NO_LORDER := true
endif
lib$(NAME).a: $(OBJS)
ifdef MK_NO_LORDER
$(AR) $(AROPT) $@ $(OBJS)
$(AR) $(AROPT) $@ $^
else
$(AR) $(AROPT) $@ `lorder $(OBJS) | tsort`
$(AR) $(AROPT) $@ `$(LORDER) $^ | tsort`
endif
$(RANLIB) $@
......
/* Dummy file used for nothing at this point
*
* see solaris_i386.h
* see solaris.h
*/
/* $Header: /cvsroot/pgsql/src/backend/port/dynloader/solaris.h,v 1.1 2000/10/10 21:22:23 petere Exp $ */
#ifndef DYNLOADER_SOLARIS_H
#define DYNLOADER_SOLARIS_H
#include "config.h"
#include <dlfcn.h>
#include "fmgr.h"
#include "utils/dynamic_loader.h"
#define pg_dlopen(f) dlopen(f,1)
#define pg_dlsym dlsym
#define pg_dlclose dlclose
#define pg_dlerror dlerror
#endif /* DYNLOADER_SOLARIS_H */
/*-------------------------------------------------------------------------
*
* port_protos.h
* port-specific prototypes for SunOS 4
*
*
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: solaris_i386.h,v 1.5 2000/01/26 05:56:44 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef PORT_PROTOS_H
#define PORT_PROTOS_H
#include <dlfcn.h>
#include "fmgr.h"
#include "utils/dynamic_loader.h"
/* dynloader.c */
/*
* Dynamic Loader on SunOS 4.
*
* this dynamic loader uses the system dynamic loading interface for shared
* libraries (ie. dlopen/dlsym/dlclose). The user must specify a shared
* library as the file to be dynamically loaded.
*
*/
#define pg_dlopen(f) dlopen(f,1)
#define pg_dlsym dlsym
#define pg_dlclose dlclose
#define pg_dlerror dlerror
#endif /* PORT_PROTOS_H */
/* Dummy file used for nothing at this point
*
* see solaris_i386.h
*/
/*-------------------------------------------------------------------------
*
* port_protos.h
* port-specific prototypes for SunOS 4
*
*
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: solaris_sparc.h,v 1.5 2000/01/26 05:56:44 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef PORT_PROTOS_H
#define PORT_PROTOS_H
#include <netinet/in.h> /* For struct in_addr */
#include <arpa/inet.h>
#include <dlfcn.h>
#include "fmgr.h"
#include "utils/dynamic_loader.h"
/* dynloader.c */
/*
* Dynamic Loader on SunOS 4.
*
* this dynamic loader uses the system dynamic loading interface for shared
* libraries (ie. dlopen/dlsym/dlclose). The user must specify a shared
* library as the file to be dynamically loaded.
*
*/
#define pg_dlopen(f) dlopen(f,1)
#define pg_dlsym dlsym
#define pg_dlclose dlclose
#define pg_dlerror dlerror
#endif /* PORT_PROTOS_H */
......@@ -12,7 +12,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/tioga/Attic/tgRecipe.c,v 1.16 2000/01/26 05:57:10 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/tioga/Attic/tgRecipe.c,v 1.17 2000/10/10 21:22:24 petere Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -92,12 +92,12 @@ first character\n", ARRAY_LEFT_DELIM);
return result;
}
if ((beginQuote = index(str, ARRAY_ELEM_LEFT)) == NULL)
if ((beginQuote = strchr(str, ARRAY_ELEM_LEFT)) == NULL)
{
elog(NOTICE, "textArray2ArrTgString: missing a begin quote\n");
return result;
}
if ((endQuote = index(beginQuote + 1, '"')) == NULL)
if ((endQuote = strchr(beginQuote + 1, '"')) == NULL)
{
elog(NOTICE, "textArray2ArrTgString: missing an end quote\n");
return result;
......
/* $Header: /cvsroot/pgsql/src/include/port/solaris.h,v 1.1 2000/10/10 21:22:26 petere Exp $ */
#define USE_POSIX_TIME
#define NO_EMPTY_STMTS
#define SYSV_DIRENT
#define HAS_TEST_AND_SET
typedef unsigned char slock_t;
/*
* Sort this out for all operting systems some time. The __xxx
* symbols are defined on both GCC and Solaris CC, although GCC
* doesn't document them. The __xxx__ symbols are only on GCC.
*/
#if defined(__i386) && !defined(__i386__)
# define __i386__
#endif
#if defined(__sparc) && !defined(__sparc__)
# define __sparc__
#endif
#if defined(__i386__)
# include <sys/isa_defs.h>
#endif
#ifndef BIG_ENDIAN
#define BIG_ENDIAN 4321
#endif
#ifndef LITTLE_ENDIAN
#define LITTLE_ENDIAN 1234
#endif
#ifndef PDP_ENDIAN
#define PDP_ENDIAN 3412
#endif
#ifndef BYTE_ORDER
# ifdef __sparc__
# define BYTE_ORDER BIG_ENDIAN
# endif
# ifdef __i386__
# define BYTE_ORDER LITTLE_ENDIAN
# endif
#endif
#ifndef NAN
# if defined(__GNUC__) && defined(__i386__)
# ifndef __nan_bytes
# define __nan_bytes { 0, 0, 0, 0, 0, 0, 0xf8, 0x7f }
# endif
# define NAN \
(__extension__ ((union { unsigned char __c[8]; double __d; }) \
{ __nan_bytes }).__d)
# else /* not GNUC and i386 */
# define NAN (0.0/0.0)
# endif /* GCC. */
#endif /* not NAN */
#define USE_POSIX_TIME
#define NO_EMPTY_STMTS
#define SYSV_DIRENT
#define HAS_TEST_AND_SET
typedef unsigned char slock_t;
#include "sys/isa_defs.h"
#ifndef BIG_ENDIAN
#define BIG_ENDIAN 4321
#endif
#ifndef LITTLE_ENDIAN
#define LITTLE_ENDIAN 1234
#endif
#ifndef PDP_ENDIAN
#define PDP_ENDIAN 3412
#endif
#ifndef BYTE_ORDER
#define BYTE_ORDER LITTLE_ENDIAN
#endif
#ifndef NAN
#ifndef __nan_bytes
#define __nan_bytes { 0, 0, 0, 0, 0, 0, 0xf8, 0x7f }
#endif /* __nan_bytes */
#ifdef __GNUC__
#define NAN \
(__extension__ ((union { unsigned char __c[8]; \
double __d; }) \
{ __nan_bytes }).__d)
#else /* Not GCC. */
#define NAN (*(__const double *) __nan)
#endif /* GCC. */
#endif /* NAN */
#ifndef index
#define index strchr
#endif
#define USE_POSIX_TIME
#define NO_EMPTY_STMTS
#define SYSV_DIRENT
#define HAS_TEST_AND_SET
typedef unsigned char slock_t;
#ifndef BIG_ENDIAN
#define BIG_ENDIAN 4321
#endif
#ifndef LITTLE_ENDIAN
#define LITTLE_ENDIAN 1234
#endif
#ifndef PDP_ENDIAN
#define PDP_ENDIAN 3412
#endif
#ifndef BYTE_ORDER
#define BYTE_ORDER BIG_ENDIAN
#endif
# $Header: /cvsroot/pgsql/src/makefiles/Makefile.solaris,v 1.1 2000/10/10 21:22:28 petere Exp $
%.so: %.o
$(LD) -G -Bdynamic -o $@ $<
%.so: %.o
$(LD) -G -Bdynamic -o $@ $<
%.so: %.o
$(LD) -G -Bdynamic -o $@ $<
MK_NO_LORDER=true
......@@ -5,6 +5,7 @@ if test "$GCC" = yes ; then
CFLAGS=
SHARED_LIB=-fPIC
else
CFLAGS='-Xa -v -D__sparc__ -D__sun__'
CC="$CC -Xa" # relaxed ISO C mode
CFLAGS=-v # -v is like gcc -Wall
SHARED_LIB=-KPIC
fi
DLSUFFIX=.so
if test "$GCC" = yes ; then
AROPT=crs
CFLAGS=
SHARED_LIB=-fPIC
else
AROPT=cq
CFLAGS=
SHARED_LIB=-KPIC
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment