Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit b99ee7f

Browse files
committed
This is the minimal version of the Darwin support patch from
Bruce Hartzler <bruceh@mail.utexas.edu>. It contains shared library support, regression test map, and the usual template files. The dynamic loader is missing, the spin lock code apparently doesn't assemble due to syntax problems, and semaphores are to be hoped for from Apple.
1 parent dc0f5cb commit b99ee7f

File tree

9 files changed

+435
-367
lines changed

9 files changed

+435
-367
lines changed

configure

Lines changed: 365 additions & 364 deletions
Large diffs are not rendered by default.

configure.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ case $host_os in
6464
beos*) template=beos ;;
6565
bsdi*) template=bsdi ;;
6666
cygwin*) template=win ;;
67+
darwin*) template=darwin ;;
6768
dgux*) template=dgux ;;
6869
freebsd*) template=freebsd ;;
6970
hpux*) template=hpux ;;

src/Makefile.shlib

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# Copyright (c) 1998, Regents of the University of California
77
#
88
# IDENTIFICATION
9-
# $Header: /cvsroot/pgsql/src/Makefile.shlib,v 1.30 2000/10/27 23:59:39 petere Exp $
9+
# $Header: /cvsroot/pgsql/src/Makefile.shlib,v 1.31 2000/10/31 19:55:18 petere Exp $
1010
#
1111
#-------------------------------------------------------------------------
1212

@@ -52,9 +52,9 @@
5252
# Got that? Look at src/interfaces/libpq/Makefile for an example.
5353

5454
ifndef cplusplus
55-
COMPILER = $(CC)
55+
COMPILER = $(CC) $(CFLAGS)
5656
else
57-
COMPILER = $(CXX)
57+
COMPILER = $(CXX) $(CXXFLAGS)
5858
endif
5959

6060

@@ -103,6 +103,11 @@ ifeq ($(PORTNAME), aix)
103103
SHLIB_LINK += -lc
104104
endif
105105

106+
ifeq ($(PORTNAME), darwin)
107+
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
108+
LINK.shared = $(COMPILER) $(CFLAGS_SL)
109+
endif
110+
106111
ifeq ($(PORTNAME), openbsd)
107112
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
108113
ifdef ELF_SYSTEM

src/backend/port/dynloader/darwin.c

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* This is a place holder until someone supplies a dynamic loader
3+
* interface for this platform.
4+
*
5+
* $Header: /cvsroot/pgsql/src/backend/port/dynloader/darwin.c,v 1.1 2000/10/31 19:55:19 petere Exp $
6+
*/
7+
8+
#include "postgres.h"
9+
#include "fmgr.h"
10+
#include "utils/dynamic_loader.h"
11+
#include "dynloader.h"
12+
13+
void *
14+
pg_dlopen(char *filename)
15+
{
16+
return (void *) NULL;
17+
}
18+
19+
PGFunction
20+
pg_dlsym(void *handle, char *funcname)
21+
{
22+
return NULL;
23+
}
24+
25+
void
26+
pg_dlclose(void *handle)
27+
{
28+
}
29+
30+
char *
31+
pg_dlerror()
32+
{
33+
static char errmsg[] = "the dynamic loader for darwin doesn't exist yet";
34+
35+
return errmsg;
36+
}

src/backend/port/dynloader/darwin.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/* $Header: /cvsroot/pgsql/src/backend/port/dynloader/darwin.h,v 1.1 2000/10/31 19:55:19 petere Exp $ */
2+
void *pg_dlopen(char *filename);
3+
PGFunction pg_dlsym(void *handle, char *funcname);
4+
void pg_dlclose(void *handle);
5+
char *pg_dlerror();

src/include/port/darwin.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#define HAS_TEST_AND_SET
2+
#if defined(__powerpc__)
3+
typedef unsigned int slock_t;
4+
#else
5+
typedef unsigned char slock_t;
6+
#endif

src/makefiles/Makefile.darwin

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
AROPT = cr
2+
3+
DLSUFFIX = .so
4+
CFLAGS_SL = -bundle -undefined suppress
5+
6+
%.so: %.o
7+
$(CC) $(CFLAGS) $(CFLAGS_SL) -o $@ $<

src/template/darwin

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# regular cpp is broken in current development releases
2+
CC="$CC -traditional-cpp"
3+
# be on safe side while they sort out their compiler
4+
CFLAGS=-O0

src/test/regress/resultmap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ float8/.*-qnx=float8-exp-three-digits
1212
float8/alpha.*-dec-osf=float8-fp-exception
1313
float8/i.86-pc-cygwin=float8-small-is-zero
1414
geometry/.*-bsdi=geometry-positive-zeros-bsd
15+
geometry/.*-darwin=geometry-positive-zeros
1516
geometry/.*-freebsd=geometry-positive-zeros
1617
geometry/.*-freebsd4.0=geometry-positive-zeros-bsd
1718
geometry/.*-irix6=geometry-irix
@@ -35,6 +36,7 @@ horology/sparc-sun-solaris=horology-solaris-1947
3536
horology/.*-sysv5uw=horology-solaris-1947
3637
int2/.*-aix4=int2-too-large
3738
int2/.*-bsdi=int2-too-large
39+
int2/.*-darwin=int2-too-large
3840
int2/.*-freebsd=int2-too-large
3941
int2/.*-irix6=int2-too-large
4042
int2/.*-netbsd=int2-too-large
@@ -50,6 +52,7 @@ int2/.*-sysv5uw=int2-too-large
5052
int2/.*-beos=int2-range-error
5153
int4/.*-aix4=int4-too-large
5254
int4/.*-bsdi=int4-too-large
55+
int4/.*-darwin=int4-too-large
5356
int4/.*-freebsd=int4-too-large
5457
int4/.*-irix6=int4-too-large
5558
int4/.*-netbsd=int4-too-large

0 commit comments

Comments
 (0)