Index: configure.in
===================================================================
RCS file: /home/projects/pgsql/cvsroot/pgsql/configure.in,v
retrieving revision 1.63
diff -c -r1.63 configure.in
*** configure.in	2000/10/21 22:36:10	1.63
--- configure.in	2000/10/22 23:28:29
***************
*** 64,69 ****
--- 64,70 ----
      beos*) template=beos ;;
      bsdi*) template=bsdi ;;
    cygwin*) template=win ;;
+   darwin*) template=darwin ;;
      dgux*) template=dgux ;;
   freebsd*) template=freebsd ;;
      hpux*) template=hpux ;;
Index: src/Makefile.shlib
===================================================================
RCS file: /home/projects/pgsql/cvsroot/pgsql/src/Makefile.shlib,v
retrieving revision 1.26
diff -c -r1.26 Makefile.shlib
*** src/Makefile.shlib	2000/10/20 21:03:38	1.26
--- src/Makefile.shlib	2000/10/22 23:28:33
***************
*** 128,133 ****
--- 128,138 ----
    endif
  endif
  
+ ifeq ($(PORTNAME), darwin)
+       shlib		:= lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
+     override CFLAGS	+= $(CFLAGS_SL)
+ endif
+ 
  ifeq ($(PORTNAME), hpux)
  # HPUX doesn't believe in version numbers for shlibs
    shlib			:= lib$(NAME)$(DLSUFFIX)
***************
*** 227,232 ****
--- 232,238 ----
  endif # not win
  
  ifdef shlib
+ ifneq ($(PORTNAME), darwin)
  ifneq ($(PORTNAME), beos)
  ifneq ($(PORTNAME), win)
  ifneq ($(PORTNAME), aix)
***************
*** 275,280 ****
--- 281,295 ----
  	$(CC) -Xlinker -soname=$@ $(LDFLAGS_SL) -o $@ _APP_ $(OBJS) $(SHLIB_LINK)
  
  endif # PORTNAME == beos
+ 
+ else # PORTNAME == darwin
+ 
+ # Darwin case
+ $(shlib): $(OBJS)
+ 	$(CC) $(CFLAGS_SL) -o $@ $(OBJS) $(SHLIB_LINK)
+ 
+ endif # PORTNAME == darwin
+ 
  endif # shlib
  
  
Index: src/backend/port/Makefile.in
===================================================================
RCS file: /home/projects/pgsql/cvsroot/pgsql/src/backend/port/Makefile.in,v
retrieving revision 1.27
diff -c -r1.27 Makefile.in
*** src/backend/port/Makefile.in	2000/10/20 21:03:45	1.27
--- src/backend/port/Makefile.in	2000/10/22 23:28:37
***************
*** 27,32 ****
--- 27,37 ----
  ifeq ($(PORTNAME), qnx4)
  OBJS += getrusage.o qnx4/SUBSYS.o
  endif
+ ifeq ($(PORTNAME), darwin)
+ ifndef HAVE_SYS_SEM_H
+ OBJS += darwin/SUBSYS.o
+ endif	
+ endif
  ifeq ($(PORTNAME), beos)
  OBJS += beos/SUBSYS.o
  endif
***************
*** 39,44 ****
--- 44,54 ----
  
  qnx4.dir:
  	$(MAKE) -C qnx4 all
+ 
+ darwin/SUBSYS.o: darwin.dir
+ 
+ darwin.dir:
+ 	$(MAKE) -C darwin all
  
  beos/SUBSYS.o: beos.dir
  
Index: src/backend/storage/buffer/s_lock.c
===================================================================
RCS file: /home/projects/pgsql/cvsroot/pgsql/src/backend/storage/buffer/s_lock.c,v
retrieving revision 1.24
diff -c -r1.24 s_lock.c
*** src/backend/storage/buffer/s_lock.c	2000/01/26 05:56:52	1.24
--- src/backend/storage/buffer/s_lock.c	2000/10/22 23:28:38
***************
*** 143,148 ****
--- 143,169 ----
  
  #endif	 /* __powerpc__ */
  
+ #if defined(DARWIN_OS)
+ /* Note: need a nice gcc constrained asm version so it can be inlined */
+ static void
+ tas_dummy()
+ {__asm__("                 \n\
+ .globl _tas                \n\
+ _tas:       lwarx r5,0,r3  \n\
+            cmpwi r5,0      \n\
+            bne fail        \n\
+            addi r5,r5,1    \n\
+            stwcx.  r5,0,r3 \n\
+            beq success     \n\
+  fail:     li r3,1         \n\
+            blr             \n\
+  success:  li r3,0         \n\
+            blr             \n\
+   ");
+ }
+ 
+ #endif /* DARWIN_OS */
+ 
  #if defined(__mips__)
  static void
  tas_dummy()
Index: src/test/regress/resultmap
===================================================================
RCS file: /home/projects/pgsql/cvsroot/pgsql/src/test/regress/resultmap,v
retrieving revision 1.35
diff -c -r1.35 resultmap
*** src/test/regress/resultmap	2000/10/22 22:15:09	1.35
--- src/test/regress/resultmap	2000/10/22 23:28:45
***************
*** 13,18 ****
--- 13,19 ----
  float8/i.86-pc-cygwin*=float8-small-is-zero
  geometry/.*-bsdi=geometry-positive-zeros-bsd
  geometry/.*-freebsd=geometry-positive-zeros
+ geometry/.*-apple-darwin1.2=geometry-positive-zeros
  geometry/.*-freebsdelf4.0=geometry-positive-zeros-bsd
  geometry/.*-irix6=geometry-irix
  geometry/.*-netbsd=geometry-positive-zeros
***************
*** 36,41 ****
--- 37,43 ----
  int2/.*-aix4=int2-too-large
  int2/.*-bsdi=int2-too-large
  int2/.*-freebsd=int2-too-large
+ int2/.*-apple-darwin=int2-too-large
  int2/.*-irix6=int2-too-large
  int2/.*-netbsd=int2-too-large
  int2/.*-qnx=int2-too-large
***************
*** 51,56 ****
--- 53,59 ----
  int4/.*-aix4=int4-too-large
  int4/.*-bsdi=int4-too-large
  int4/.*-freebsd=int4-too-large
+ int4/.*-apple-darwin=int4-too-large
  int4/.*-irix6=int4-too-large
  int4/.*-netbsd=int4-too-large
  int4/.*-qnx=int4-too-large
