I made an attempt at fixing the s390x port by cargo culting what has
been done for other architectures. With this patch, I can connect to
the server and start an icewm desktop. However, the screen is still
pretty corrupted - text is offset, etc. See the attached screenshot.
Index: tightvnc-1.3.10/Xvnc/include/Xmd.h
===
--- tightvnc-1.3.10.orig/Xvnc/include/Xmd.h
+++ tightvnc-1.3.10/Xvnc/include/Xmd.h
@@ -59,7 +59,7 @@ SOFTWARE.
#ifdef CRAY
#define WORD64/* 64-bit architecture */
#endif
-#if defined(__alpha) || defined(__alpha__) || defined(__x86_64__) || defined(__powerpc64__) || defined(__aarch64__)
+#if defined(__alpha) || defined(__alpha__) || defined(__x86_64__) || defined(__powerpc64__) || defined(__aarch64__) || defined(__s390x__)
#define LONG64/* 32/64-bit architecture */
#endif
#ifdef __sgi
Index: tightvnc-1.3.10/Xvnc/programs/Xserver/include/servermd.h
===
--- tightvnc-1.3.10.orig/Xvnc/programs/Xserver/include/servermd.h
+++ tightvnc-1.3.10/Xvnc/programs/Xserver/include/servermd.h
@@ -464,6 +464,26 @@ SOFTWARE.
#endif /* Linux/PPC */
+#if defined (linux) && defined(__s390x__)
+# define BITMAP_SCANLINE_UNIT 64
+# define BITMAP_SCANLINE_PAD 64
+# define LOG2_BITMAP_PAD 6
+# define LOG2_BYTES_PER_SCANLINE_PAD 3
+
+/* Add for handling protocol XPutImage and XGetImage; see comment in
+ * Alpha section.
+ */
+#define INTERNAL_VS_EXTERNAL_PADDING
+#define BITMAP_SCANLINE_UNIT_PROTO 32
+
+#define BITMAP_SCANLINE_PAD_PROTO 32
+#define LOG2_BITMAP_PAD_PROTO 5
+#define LOG2_BYTES_PER_SCANLINE_PAD_PROTO 2
+/*#define GLYPHPADBYTES 4
+ #define GETLEFTBITS_ALIGNMENT 1*/
+
+#endif /* linux/s390x */
+
#if defined (linux) && defined(__sparc__)
#define IMAGE_BYTE_ORDER MSBFirst
Index: tightvnc-1.3.10/Xvnc/config/cf/Imake.cf
===
--- tightvnc-1.3.10.orig/Xvnc/config/cf/Imake.cf
+++ tightvnc-1.3.10/Xvnc/config/cf/Imake.cf
@@ -700,6 +700,10 @@ XCOMM Keep cpp from replacing path eleme
# define s390Architecture
# undef __s390__
# endif /* s390 */
+# ifdef __s390x__
+# define s390xArchitecture
+# undef __s390x__
+# endif /* s390x */
# ifdef __aarch64__
# define AArch64Architecture
# undef __aarch64__
Index: tightvnc-1.3.10/Xvnc/config/cf/linux.cf
===
--- tightvnc-1.3.10.orig/Xvnc/config/cf/linux.cf
+++ tightvnc-1.3.10/Xvnc/config/cf/linux.cf
@@ -291,10 +291,10 @@ XCOMM binutils: (LinuxBinUtilsMajorVersi
#endif /* s390Architecture */
#ifdef s390xArchitecture
-#define OptimzedCDebugFlags -O2
+#define OptimizedCDebugFlags -O2
#define LinuxMachineDefines -D__s390x__
#define ServerOSDefines XFree86ServerOSDefines -DDDXTIME -DPART_NET
-#define ServerExtraDefines -DGCCUSESGAS XFree86ServerDefines
+#define ServerExtraDefines -DGCCUSESGAS XFree86ServerDefines -D_XSERVER64
#endif /* s390xArchitecture */
#ifdef Ppc64Architecture