--- /home/neale/postgresql-6.5.3/src/include/port/linux.h	Sun Mar 14 11:03:11 1999
+++ include/port/linux.h	Fri Jan 21 15:57:20 2000
@@ -14,12 +14,15 @@
 #elif defined(__alpha)
 typedef long int slock_t;
 
 #elif defined(__mips)
 typedef unsigned int slock_t;
 
+#elif defined(__s390__)
+typedef unsigned int slock_t;
+
 #else							/* i386 probably */
 typedef unsigned char slock_t;
 
 #endif
 
 #if (__GLIBC__ >= 2)
--- /home/neale/postgresql-6.5.3/src/config.sub	Mon Apr 19 20:26:31 1999
+++ config.sub	Thu Jan 20 19:27:52 2000
@@ -150,13 +150,13 @@
 	# Recognize the basic CPU types without company name.
 	# Some are omitted here because they have special meanings below.
 	tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
 		| arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \
 		| 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 | hppa2.0 \
 		| alpha | alphaev5 | alphaev56 | we32k | ns16k | clipper \
-		| i370 | sh | powerpc | powerpcle | 1750a | dsp16xx | pdp11 \
+		| i370 | s390 | sh | powerpc | powerpcle | 1750a | dsp16xx | pdp11 \
 		| mips64 | mipsel | mips64el | mips64orion | mips64orionel \
 		| mipstx39 | mipstx39el \
 		| sparc | sparclet | sparclite | sparc64 | v850)
 		basic_machine=$basic_machine-unknown
 		;;
 	# We use `pc' rather than `unknown'
@@ -346,12 +346,16 @@
 		os=-nextstep3
 		;;
 	i370-ibm* | ibm*)
 		basic_machine=i370-ibm
 		os=-mvs
 		;;
+	s390-ibm*)
+		basic_machine=s390-ibm
+		os=-linux
+		;;
 # I'm not sure what "Sysv32" means.  Should this be sysv3.2?
 	i[34567]86v32)
 		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
 		os=-sysv32
 		;;
 	i[34567]86v4*)
@@ -870,12 +874,15 @@
 		;;
 	*-ns)
 		os=-genix
 		;;
 	i370-*)
 		os=-mvs
+		;;
+	s390-*)
+		os=-linux
 		;;
 	*-next)
 		os=-nextstep3
 		;;
         *-gould)
 		os=-sysv
--- /home/neale/postgresql-6.5.3/src/interfaces/odbc/misc.h	Wed Dec 30 19:26:44 1998
+++ interfaces/odbc/misc.h	Fri Jan 21 13:19:46 2000
@@ -23,22 +23,22 @@
 
 /*	Uncomment MY_LOG define to compile in the mylog() statements.
 	Then, debug logging will occur if 'Debug' is set to 1 in the ODBCINST.INI
 	portion of the registry.  You may have to manually add this key.
 	This logfile is intended for development use, not for an end user!
 */
-#define MY_LOG
+// #define MY_LOG
 
 
 /*	Uncomment Q_LOG to compile in the qlog() statements (Communications log, i.e. CommLog).
 	This logfile contains serious log statements that are intended for an
 	end user to be able to read and understand.  It is controlled by the
 	'CommLog' flag in the ODBCINST.INI portion of the registry (see above),
 	which is manipulated on the setup/connection dialog boxes.
 */
-#define Q_LOG
+// #define Q_LOG
 
 
 #ifdef MY_LOG
   #define MYLOGFILE	"mylog_"
   #ifndef WIN32
     #define MYLOGDIR	"/tmp"
--- include/storage/s_lock.h,v	Fri Jan 21 10:18:44 2000
+++ include/storage/s_lock.h	Fri Jan 21 15:48:40 2000
@@ -119,13 +119,35 @@
 __asm__("lock; xchgb %0,%1": "=q"(_res), "=m"(*lock):"0"(_res));
 	return (int) _res;
 }
 
 #endif	 /* __i386__ */
 
+#if defined(__s390__)
+/*
+ * S/390 Linux
+ */
+#define TAS(lock)	tas(lock)
 
+static inline int
+tas(volatile slock_t *lock)
+{
+ int _res;
+
+        __asm__ __volatile("    la    1,1\n"
+			   "    l     2,%2\n"
+                           "    slr   0,0\n"
+                           "    cs    0,1,0(2)\n"
+			   "    lr    %1,0"
+                           : "=m" (lock), "=d" (_res)
+                           : "m" (lock) 
+			   : "0", "1", "2");
+
+	return (_res);
+}
+#endif	 /* __s390__ */
 
 #if defined(__arm32__)
 #define TAS(lock) tas(lock)
 
 static __inline__ int
 tas(volatile slock_t *lock)
