Skip to content

Commit 8a372d2

Browse files
committed
Add in port to DG/UX
Submitted by: "Brian E. Gallew" <geek+@cmu.edu>
1 parent 5315d37 commit 8a372d2

File tree

7 files changed

+218
-1
lines changed

7 files changed

+218
-1
lines changed

src/Makefile.global

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#
88
#
99
# IDENTIFICATION
10-
# $Header: /cvsroot/pgsql/src/Attic/Makefile.global,v 1.14 1996/07/25 07:26:37 scrappy Exp $
10+
# $Header: /cvsroot/pgsql/src/Attic/Makefile.global,v 1.15 1996/07/25 20:43:35 scrappy Exp $
1111
#
1212
# NOTES
1313
# This is seen by any Makefiles that include mk/postgres.mk. To
@@ -47,6 +47,7 @@
4747
# bsdi_2_1 - BSD/OS 2.1
4848
# aix - IBM on AIX 3.2.5
4949
# irix5 - SGI MIPS on IRIX 5.3
50+
# dgux - DG/UX 5.4R3.10
5051
# Some hooks are provided for
5152
# svr4 - Intel x86 on Intel SVR4
5253
# next - Motorola MC68K or Intel x86 on NeXTSTEP 3.2

src/backend/port/dgux/Makefile.inc

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#-------------------------------------------------------------------------
2+
#
3+
# Makefile.inc--
4+
# Makefile for port/linux (Linux specific stuff)
5+
#
6+
# Copyright (c) 1994, Regents of the University of California
7+
#
8+
#
9+
# IDENTIFICATION
10+
# $Header: /cvsroot/pgsql/src/backend/port/dgux/Attic/Makefile.inc,v 1.1 1996/07/25 20:43:56 scrappy Exp $
11+
#
12+
# NOTES
13+
# The Linux port is included here by courtesy of Kai Petzke.
14+
#
15+
# (C) 1994, Kai Petzke, wpp@marie.physik.tu-berlin.de
16+
#
17+
#-------------------------------------------------------------------------
18+
19+
BIGOBJS= false
20+
21+
CFLAGS+= -DLINUX_ELF
22+
23+
HEADERS+= machine.h port-protos.h
24+
CFLAGS+= #-DNEED_CBRT
25+

src/backend/port/dgux/dynloader.c

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
/*-------------------------------------------------------------------------
2+
*
3+
* dynloader.c--
4+
* Dynamic Loader for Postgres for DG/UX, generated from those for
5+
* Linux.
6+
*
7+
* Copyright (c) 1994, Regents of the University of California
8+
*
9+
*
10+
* IDENTIFICATION
11+
* $Header: /cvsroot/pgsql/src/backend/port/dgux/Attic/dynloader.c,v 1.1 1996/07/25 20:43:58 scrappy Exp $
12+
*
13+
*-------------------------------------------------------------------------
14+
*/
15+
#include <stdio.h>
16+
#include <dld.h>
17+
#include "postgres.h"
18+
#include "port-protos.h"
19+
#include "utils/elog.h"
20+
#include "fmgr.h"
21+
22+
extern char pg_pathname[];
23+
24+
void *
25+
pg_dlopen(char *filename)
26+
{
27+
static int dl_initialized= 0;
28+
29+
/*
30+
* initializes the dynamic loader with the executable's pathname.
31+
* (only needs to do this the first time pg_dlopen is called.)
32+
*/
33+
if (!dl_initialized) {
34+
if (dld_init (dld_find_executable (pg_pathname))) {
35+
return NULL;
36+
}
37+
/*
38+
* if there are undefined symbols, we want dl to search from the
39+
* following libraries also.
40+
*/
41+
dl_initialized= 1;
42+
}
43+
44+
/*
45+
* link the file, then check for undefined symbols!
46+
*/
47+
if (dld_link(filename)) {
48+
return NULL;
49+
}
50+
51+
/*
52+
* If undefined symbols: try to link with the C and math libraries!
53+
* This could be smarter, if the dynamic linker was able to handle
54+
* shared libs!
55+
*/
56+
if(dld_undefined_sym_count > 0) {
57+
if (dld_link("/usr/lib/libc.a")) {
58+
elog(NOTICE, "dld: Cannot link C library!");
59+
return NULL;
60+
}
61+
if(dld_undefined_sym_count > 0) {
62+
if (dld_link("/usr/lib/libm.a")) {
63+
elog(NOTICE, "dld: Cannot link math library!");
64+
return NULL;
65+
}
66+
if(dld_undefined_sym_count > 0) {
67+
int count = dld_undefined_sym_count;
68+
char **list= dld_list_undefined_sym();
69+
70+
/* list the undefined symbols, if any */
71+
elog(NOTICE, "dld: Undefined:");
72+
do {
73+
elog(NOTICE, " %s", *list);
74+
list++;
75+
count--;
76+
} while(count > 0);
77+
78+
dld_unlink_by_file(filename, 1);
79+
return NULL;
80+
}
81+
}
82+
}
83+
84+
return (void *) strdup(filename);
85+
}
86+
87+
char *
88+
pg_dlerror()
89+
{
90+
return dld_strerror(dld_errno);
91+
}

src/backend/port/dgux/machine.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*-------------------------------------------------------------------------
2+
*
3+
* machine.h--
4+
*
5+
*
6+
*
7+
* Copyright (c) 1994, Regents of the University of California
8+
*
9+
* $Id: machine.h,v 1.1 1996/07/25 20:43:59 scrappy Exp $
10+
*
11+
*-------------------------------------------------------------------------
12+
*/
13+
#ifndef MACHINE_H
14+
#define MACHINE_H
15+
16+
#define BLCKSZ 8192
17+
18+
#endif

src/backend/port/dgux/port-protos.h

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*-------------------------------------------------------------------------
2+
*
3+
* port-protos.h--
4+
* port-specific prototypes for SunOS 4
5+
*
6+
*
7+
* Copyright (c) 1994, Regents of the University of California
8+
*
9+
* $Id: port-protos.h,v 1.1 1996/07/25 20:44:00 scrappy Exp $
10+
*
11+
*-------------------------------------------------------------------------
12+
*/
13+
#ifndef PORT_PROTOS_H
14+
#define PORT_PROTOS_H
15+
16+
#include "fmgr.h" /* for func_ptr */
17+
#include "utils/dynamic_loader.h"
18+
#include "dlfcn.h"
19+
20+
/* dynloader.c */
21+
22+
/* #define pg_dlopen(f) dlopen(f, 1) */
23+
#define pg_dlopen(f) dlopen(f, 2)
24+
#define pg_dlsym dlsym
25+
#define pg_dlclose dlclose
26+
#define pg_dlerror dlerror
27+
28+
/* port.c */
29+
30+
#endif /* PORT_PROTOS_H */

src/backend/port/dgux/port.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*-------------------------------------------------------------------------
2+
*
3+
* port.c--
4+
* Linux-specific routines
5+
*
6+
* Copyright (c) 1994, Regents of the University of California
7+
*
8+
*
9+
* IDENTIFICATION
10+
* $Header: /cvsroot/pgsql/src/backend/port/dgux/Attic/port.c,v 1.1 1996/07/25 20:44:00 scrappy Exp $
11+
*
12+
*-------------------------------------------------------------------------
13+
*/

src/mk/port/postgres.mk.dgux

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#-------------------------------------------------------------------------
2+
#
3+
# postgres.mk.linux--
4+
# Intel x86/Linux specific rules and variables
5+
#
6+
# Copyright (c) 1994-5, Regents of the University of California
7+
#
8+
# $Id: postgres.mk.dgux,v 1.1 1996/07/25 20:45:05 scrappy Exp $
9+
#
10+
# NOTE
11+
# you may remove lines that start with ## which are general comments
12+
#-------------------------------------------------------------------------
13+
ifndef MK_PORT
14+
MK_PORT= linux
15+
16+
RANLIB= ranlib
17+
SLSUFF= .so
18+
#LDFLAGS+= -rdynamic
19+
20+
21+
CFLAGS_SL= -fpic
22+
%.so: %.o
23+
cd $(objdir); $(CC) -shared -o $(@F) $(<F)
24+
25+
#
26+
# for postgres.mk
27+
#
28+
CC= gcc
29+
CFLAGS_OPT= -O2 -pipe
30+
31+
CFLAGS_BE= -D__USE_POSIX_SIGNALS -DUSE_POSIX_SIGNALS -O2
32+
LDADD_BE= -ldl -lfl
33+
34+
LEX = flex
35+
YACC = bison -y
36+
37+
INSTALL=/usr/bin/X11/bsdinst
38+
39+
endif

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy