Various patches for shared libraries under i386-solaris by:

Christoph Kaesling <ck@dog.pfalz.sub.de>
This commit is contained in:
Marc G. Fournier 1997-03-25 09:21:59 +00:00
parent 6304e2c273
commit c2e73db87a
4 changed files with 79 additions and 15 deletions

View File

@ -7,7 +7,7 @@
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/Makefile,v 1.10 1997/03/17 22:05:08 scrappy Exp $
# $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/Makefile,v 1.11 1997/03/25 09:19:41 scrappy Exp $
#
#-------------------------------------------------------------------------
@ -30,24 +30,26 @@ ifeq ($(CC), gcc)
endif
shlib :=
install-shlib-dep :=
ifeq ($(PORTNAME), linux)
ifdef LINUX_ELF
ifeq ($(CC), gcc)
CFLAGS += -fpic -fPIC
endif
shlib := libpgtcl.so.1
install-shlib-dep := install-shlib
LDFLAGS += -L ../libpq -lpq
endif
endif
ifeq ($(PORTNAME), i386_solaris)
CFLAGS+= -fPIC
endif
OBJS= pgtcl.o pgtclCmds.o pgtclId.o
ifdef LINUX_ELF
shlib := libpgtcl.so.1
install-shlib-dep := install-shlib
LDFLAGS += -L ../libpq -lpq
else
shlib :=
install-shlib-dep :=
endif
all: libpgtcl.a $(shlib)

View File

@ -7,7 +7,7 @@
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/interfaces/libpq++/Attic/Makefile,v 1.6 1997/02/13 10:00:23 scrappy Exp $
# $Header: /cvsroot/pgsql/src/interfaces/libpq++/Attic/Makefile,v 1.7 1997/03/25 09:20:32 scrappy Exp $
#
#-------------------------------------------------------------------------
@ -39,7 +39,17 @@ endif
OBJS = pgenv.o pgconnection.o pgtransdb.o pgcursordb.o pglobject.o
all: $(LIBNAME).a install examples
# Shared library stuff
SHLIB :=
INSTALL-SHLIB-DEP :=
ifeq ($(PORTNAME), i386_solaris)
INSTALL-SHLIB-DEP := install-shlib
SHLIB := libpq++.so.1
LDFLAGS_SL = -G -z text
CFLAGS += -fPIC
endif
all: $(LIBNAME).a $(SHLIB) install examples
$(LIBNAME).a: $(OBJS)
ifdef MK_NO_LORDER
@ -49,14 +59,17 @@ else
endif
$(RANLIB) $(LIBNAME).a
$(SHLIB): $(OBJS)
$(LD) $(LDFLAGS) $(LDFLAGS_SL) -o $@ $(OBJS)
.PHONY: examples
examples:
$(MAKE) -C examples all
.PHONY: beforeinstall-headers install-headers
.PHONY: install install-$(LIBNAME) doc
.PHONY: install beforeinstall-lib install-$(LIBNAME) doc
install: install-headers install-$(LIBNAME) doc
install: install-headers install-$(LIBNAME) $(INSTALL-SHLIB-DEP) doc
LIBPGXXDIR = $(LIBNAME)
LIBPGXXHEADERDIR = $(HEADERDIR)/$(LIBPGXXDIR)
@ -79,9 +92,18 @@ beforeinstall-headers:
@if [ ! -d $(HEADERDIR) ]; then mkdir $(HEADERDIR); fi
@if [ ! -d $(LIBPGXXHEADERDIR) ]; then mkdir $(LIBPGXXHEADERDIR); fi
install-$(LIBNAME): $(LIBNAME).a
beforeinstall-lib:
@if [ ! -d $(DESTDIR)/$(LIBDIR) ] ; then mkdir $(DESTDIR)/$(LIBDIR); fi
install-$(LIBNAME): $(LIBNAME).a beforeinstall-lib
$(INSTALL) $(INSTL_LIB_OPTS) $(LIBNAME).a $(DESTDIR)$(LIBDIR)/$(LIBNAME).a
install-shlib: $(SHLIBNAME) beforeinstall-lib
$(INSTALL) $(INSTL_SHLIB_OPTS) $(SHLIB) $(DESTDIR)/$(LIBDIR)/$(SHLIB)
rm -f $(DESTDIR)/$(LIBDIR)/libpq++.so
ln -sf $(SHLIB) $(DESTDIR)/$(LIBDIR)/libpq++.so
doc:
$(MAKE) -C man install

View File

@ -7,7 +7,7 @@
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/interfaces/libpq/Makefile,v 1.32 1997/03/25 09:08:05 scrappy Exp $
# $Header: /cvsroot/pgsql/src/interfaces/libpq/Makefile,v 1.33 1997/03/25 09:20:12 scrappy Exp $
#
#-------------------------------------------------------------------------
@ -42,6 +42,12 @@ ifeq ($(PORTNAME), BSD44_derived)
LDFLAGS_SL = -x -Bshareable -Bforcearchive
CFLAGS += -fpic -DPIC
endif
ifeq ($(PORTNAME), i386_solaris)
install-shlib-dep := install-shlib
shlib := libpq.so.1
LDFLAGS_SL = -G -z text
CFLAGS += -fPIC
endif
all: libpq.a $(shlib) c.h
@ -71,6 +77,8 @@ pqcomprim.c: ../backend/libpq/pqcomprim.c
$(shlib): $(OBJS)
$(LD) $(LDFLAGS) $(LDFLAGS_SL) -o $@ $(OBJS)
ln -sf $@ libpq.so
c.h: ../include/c.h
rm -f c.h

View File

@ -4,3 +4,35 @@
# define SYSV_DIRENT
# define HAS_TEST_AND_SET
typedef unsigned char slock_t;
#include <sys/isa_defs.h>
#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
#ifndef HAVE_RUSAGE
#define HAVE_RUSAGE 1
#endif