summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarc G. Fournier <scrappy@hub.org>1997-03-25 09:21:59 +0000
committerMarc G. Fournier <scrappy@hub.org>1997-03-25 09:21:59 +0000
commitc2e73db87ad91eabcb639e397229ba865f597668 (patch)
tree171ff3f749cafdfdba76507ab55c7395954b1447 /src
parent6304e2c273b9ae13f4fde44c02c535c56b45cd91 (diff)
Various patches for shared libraries under i386-solaris by:
Christoph Kaesling <ck@dog.pfalz.sub.de>
Diffstat (limited to 'src')
-rw-r--r--src/interfaces/libpgtcl/Makefile20
-rw-r--r--src/interfaces/libpq++/Makefile32
-rw-r--r--src/interfaces/libpq/Makefile10
-rw-r--r--src/port/i386_solaris.h32
4 files changed, 79 insertions, 15 deletions
diff --git a/src/interfaces/libpgtcl/Makefile b/src/interfaces/libpgtcl/Makefile
index 10d8099b3b7..6780b71c694 100644
--- a/src/interfaces/libpgtcl/Makefile
+++ b/src/interfaces/libpgtcl/Makefile
@@ -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)
diff --git a/src/interfaces/libpq++/Makefile b/src/interfaces/libpq++/Makefile
index 7707c186a31..f3f0e12dc1f 100644
--- a/src/interfaces/libpq++/Makefile
+++ b/src/interfaces/libpq++/Makefile
@@ -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
diff --git a/src/interfaces/libpq/Makefile b/src/interfaces/libpq/Makefile
index 973249647d5..8fbdd8098a8 100644
--- a/src/interfaces/libpq/Makefile
+++ b/src/interfaces/libpq/Makefile
@@ -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
diff --git a/src/port/i386_solaris.h b/src/port/i386_solaris.h
index aa78ba5f6c1..0ac1116f06f 100644
--- a/src/port/i386_solaris.h
+++ b/src/port/i386_solaris.h
@@ -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
+